From bcc325d7f8b337fe40adb9051789b737730e883e Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Tue, 23 Aug 2022 23:49:55 -0400 Subject: [PATCH] ci(auth): retry GCP authentication if fails (#4940) Previous behavior: Sometimes Google Cloud authentication fails, this might happen before IAM permissions are fully propagated Expected behavior: If the authentication fails, retry at least 3 times before exiting with a non zero exit code Applied solution: Google GitHub Actions for auth recently added this a `retries` feature which is now implemented to workaround this issue. Note: https://github.com/google-github-actions/auth/commit/95a6bc2a27ae409a01ea58dd0732eccaa088ec07 Fixes https://github.com/ZcashFoundation/zebra/issues/4846 --- .github/workflows/build-docker-image.yml | 1 + .github/workflows/continous-delivery.yml | 2 ++ .github/workflows/continous-integration-docker.yml | 1 + .github/workflows/delete-gcp-resources.yml | 1 + .github/workflows/deploy-gcp-tests.yml | 11 +++++++++++ .github/workflows/zcash-lightwalletd.yml | 1 + .github/workflows/zcashd-manual-deploy.yml | 1 + 7 files changed, 18 insertions(+) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index ba570bb5..9b337a1a 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -83,6 +83,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' diff --git a/.github/workflows/continous-delivery.yml b/.github/workflows/continous-delivery.yml index 7bb1bb17..51401205 100644 --- a/.github/workflows/continous-delivery.yml +++ b/.github/workflows/continous-delivery.yml @@ -56,6 +56,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -120,6 +121,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' diff --git a/.github/workflows/continous-integration-docker.yml b/.github/workflows/continous-integration-docker.yml index 14fdd108..4b6a0e4f 100644 --- a/.github/workflows/continous-integration-docker.yml +++ b/.github/workflows/continous-integration-docker.yml @@ -87,6 +87,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' diff --git a/.github/workflows/delete-gcp-resources.yml b/.github/workflows/delete-gcp-resources.yml index 6cb58f7a..44a994b3 100644 --- a/.github/workflows/delete-gcp-resources.yml +++ b/.github/workflows/delete-gcp-resources.yml @@ -18,6 +18,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' diff --git a/.github/workflows/deploy-gcp-tests.yml b/.github/workflows/deploy-gcp-tests.yml index 9ee0f0f2..cae43077 100644 --- a/.github/workflows/deploy-gcp-tests.yml +++ b/.github/workflows/deploy-gcp-tests.yml @@ -120,6 +120,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -187,6 +188,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -241,6 +243,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -369,6 +372,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -494,6 +498,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -552,6 +557,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -606,6 +612,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -664,6 +671,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -718,6 +726,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -774,6 +783,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' @@ -831,6 +841,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' diff --git a/.github/workflows/zcash-lightwalletd.yml b/.github/workflows/zcash-lightwalletd.yml index f04f032f..959c76eb 100644 --- a/.github/workflows/zcash-lightwalletd.yml +++ b/.github/workflows/zcash-lightwalletd.yml @@ -101,6 +101,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token' diff --git a/.github/workflows/zcashd-manual-deploy.yml b/.github/workflows/zcashd-manual-deploy.yml index 0099b307..515cee44 100644 --- a/.github/workflows/zcashd-manual-deploy.yml +++ b/.github/workflows/zcashd-manual-deploy.yml @@ -42,6 +42,7 @@ jobs: id: auth uses: google-github-actions/auth@v0.8.0 with: + retries: '3' workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' token_format: 'access_token'