The diverse range of resources which underlie the utility of quantum states in practical tasks motivates the development of universally applicable methods to measure and compare resources of different types. However, many of such approaches were hitherto limited to the finite-dimensional setting or were not connected with operational tasks. We overcome this by introducing a general method of quantifying resources for continuous-variable quantum systems based on the robustness measure, applicable to a plethora of physically relevant resources such as optical nonclassicality, entanglement, genuine non-Gaussianity, and coherence. We demonstrate in particular that the measure has a direct operational interpretation as the advantage enabled by a given state in a class of channel discrimination tasks. We show that the robustness constitutes a well-behaved, bona fide resource quantifier in any convex resource theory, contrary to a related negativity-based measure known as the standard robustness. Furthermore, we show the robustness to be directly observable -- it can be computed as the expectation value of a single witness operator -- and establish general methods for evaluating the measure. Explicitly applying our results to the relevant resources, we demonstrate the exact computability of the robustness for several classes of states.