Mining is explicitly prohibited on Google Cloud. Google suspended my account for using a crypto miner. I've used the Azure trial before though to mine. For Google Cloud, you might look into alternative methods to generate income. There are coins like SIA, MaidSafe, FileCoin, etc. that let you sell storage and bandwidth for coins. Since these are not CPU intensive, it might pass Google Cloud monitoring. I didn't know they forbid cryptocurrency mining until they showed me the ToS:
https://cloud.google.com/terms/free-trial/
2. Limitations. During the Free Trial:
2.1 Customer’s use of Google Compute Engine is restricted to only eight cores of concurrent usage per Free Trial (as further described in Documentation);
2.2 Customer may not use the Services to engage in mining cryptocurrency;
2.3 Certain Services and features will not be available under the Free Trial, as indicated in the Google Cloud Console; and
2.4 The SLAs do not apply.
~~~
https://groups.google.com/forum/#!topic/gce-discussion/hKUPZrvnMvs
Immediate action required: Your Google Cloud Platform / API project XXXX is being suspended
We’ve recently detected activity on your Google Cloud Platform / APIs project that violates our Terms of Service or Acceptable Use Policy.
Specifically, your project XXXX (XXXX-XXXX) was suspended for violating our Free Terms of Service by mining cryptocurrency.
Please take a moment to review the Google Cloud Platform Terms of Service, the Acceptable Use Policy and the applicable Terms of Service for the specific Google API you are using so that you do not violate our terms and policies in the future.