@@ -28,80 +28,80 @@ jobs:
28
28
runs-on : ' ubuntu-latest'
29
29
30
30
steps :
31
- - id : ' checkout'
32
- name : ' Checkout'
33
- uses : ' actions/checkout@v4 '
34
-
35
- - id : ' compute-test-uid'
36
- name : ' Compute test UID'
37
- run : |-
38
- echo "TEST_UID=${GITHUB_JOB}-${GITHUB_SHA::7}-${GITHUB_RUN_NUMBER}" >> ${GITHUB_ENV}
39
-
40
- - id : ' set-up-node'
41
- name : ' Set up Node'
42
- uses : ' actions/setup-node@v4 '
43
- with :
44
- node-version : ' 20.x'
45
-
46
- - id : ' build'
47
- name : ' Build'
48
- run : ' npm ci && npm run build'
49
-
50
- - id : ' auth'
51
- name : ' Auth'
52
- uses : ' google-github-actions/auth@v2'
53
- with :
54
- workload_identity_provider : ' ${{ vars.WIF_PROVIDER_NAME }}'
55
- service_account : ' ${{ vars.SERVICE_ACCOUNT_EMAIL }}'
56
-
57
- - id : ' gcloud-setup'
58
- name : ' Set up Cloud SDK'
59
- uses : ' google-github-actions/setup-gcloud@v2'
60
- with :
61
- project_id : ' ${{ vars.PROJECT_ID }}'
62
-
63
- - id : ' populate-pipeline-template'
64
- name : ' Populate values in template for Cloud Deploy pipeline and target'
65
- run : ' envsubst < tests/fixtures/clouddeploy.yaml.template > tests/fixtures/clouddeploy.yaml'
66
- env :
67
- PROJECT_ID : ' ${{ vars.PROJECT_ID }}'
68
- REGION : ' ${{ env.REGION }}'
69
-
70
- - id : ' create-pipeline'
71
- name : ' Create pipeline'
72
- run : ' gcloud deploy apply --file=tests/fixtures/clouddeploy.yaml --region=${REGION}'
73
-
74
- - id : ' create-release'
75
- name : ' Create release'
76
- uses : ' ./'
77
- with :
78
- name : ' ${{ env.TEST_UID }}'
79
- region : ' ${{ env.REGION }}'
80
- delivery_pipeline : ' gha-test-pipeline'
81
- source : ' tests/fixtures/'
82
- images : ' gha-test-app=gcr.io/cloudrun/hello:latest'
83
- description : ' GHA test ${{ env.TEST_UID }}'
84
- disable_initial_rollout : true
85
- labels : |-
86
- label1=value1
87
- annotations : |-
88
- annotation1=value1
89
-
90
- - id : ' report-release'
91
- name : ' Report Cloud Deploy release'
92
- run : |-
93
- echo "Created release: ${{ steps.create-release.outputs.name }}"
94
- echo "Release link: ${{ steps.create-release.outputs.link }}"
95
-
96
- - id : ' run-e2e-tests'
97
- name : ' Run Tests'
98
- run : ' npm run e2e-tests'
99
- env :
100
- ANNOTATIONS : ' {"git-sha":"${{ github.sha }}", "annotation1":"value1"}'
101
- DELIVERY_PIPELINE : ' gha-test-pipeline'
102
- DESCRIPTION : ' GHA test ${{ env.TEST_UID }}'
103
- IMAGES : ' gha-test-app=gcr.io/cloudrun/hello:latest'
104
- LABELS : ' {"managed-by":"github-actions", "label1":"value1"}'
105
- NAME : ' projects/${{ vars.PROJECT_ID }}/locations/${{ env.REGION }}/deliveryPipelines/gha-test-pipeline/releases/${{ env.TEST_UID }}'
106
- PROJECT_ID : ' ${{ vars.PROJECT_ID }}'
107
- REGION : ' ${{ env.REGION }}'
31
+ - id : ' checkout'
32
+ name : ' Checkout'
33
+ uses : ' actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 ' # ratchet:actions/checkout@v4
34
+
35
+ - id : ' compute-test-uid'
36
+ name : ' Compute test UID'
37
+ run : |-
38
+ echo "TEST_UID=${GITHUB_JOB}-${GITHUB_SHA::7}-${GITHUB_RUN_NUMBER}" >> ${GITHUB_ENV}
39
+
40
+ - id : ' set-up-node'
41
+ name : ' Set up Node'
42
+ uses : ' actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a ' # ratchet:actions/setup-node@v4
43
+ with :
44
+ node-version : ' 20.x'
45
+
46
+ - id : ' build'
47
+ name : ' Build'
48
+ run : ' npm ci && npm run build'
49
+
50
+ - id : ' auth'
51
+ name : ' Auth'
52
+ uses : ' google-github-actions/auth@v2' # ratchet:exclude
53
+ with :
54
+ workload_identity_provider : ' ${{ vars.WIF_PROVIDER_NAME }}'
55
+ service_account : ' ${{ vars.SERVICE_ACCOUNT_EMAIL }}'
56
+
57
+ - id : ' gcloud-setup'
58
+ name : ' Set up Cloud SDK'
59
+ uses : ' google-github-actions/setup-gcloud@v2' # ratchet:exclude
60
+ with :
61
+ project_id : ' ${{ vars.PROJECT_ID }}'
62
+
63
+ - id : ' populate-pipeline-template'
64
+ name : ' Populate values in template for Cloud Deploy pipeline and target'
65
+ run : ' envsubst < tests/fixtures/clouddeploy.yaml.template > tests/fixtures/clouddeploy.yaml'
66
+ env :
67
+ PROJECT_ID : ' ${{ vars.PROJECT_ID }}'
68
+ REGION : ' ${{ env.REGION }}'
69
+
70
+ - id : ' create-pipeline'
71
+ name : ' Create pipeline'
72
+ run : ' gcloud deploy apply --file=tests/fixtures/clouddeploy.yaml --region=${REGION}'
73
+
74
+ - id : ' create-release'
75
+ name : ' Create release'
76
+ uses : ' ./'
77
+ with :
78
+ name : ' ${{ env.TEST_UID }}'
79
+ region : ' ${{ env.REGION }}'
80
+ delivery_pipeline : ' gha-test-pipeline'
81
+ source : ' tests/fixtures/'
82
+ images : ' gha-test-app=gcr.io/cloudrun/hello:latest'
83
+ description : ' GHA test ${{ env.TEST_UID }}'
84
+ disable_initial_rollout : true
85
+ labels : |-
86
+ label1=value1
87
+ annotations : |-
88
+ annotation1=value1
89
+
90
+ - id : ' report-release'
91
+ name : ' Report Cloud Deploy release'
92
+ run : |-
93
+ echo "Created release: ${{ steps.create-release.outputs.name }}"
94
+ echo "Release link: ${{ steps.create-release.outputs.link }}"
95
+
96
+ - id : ' run-e2e-tests'
97
+ name : ' Run Tests'
98
+ run : ' npm run e2e-tests'
99
+ env :
100
+ ANNOTATIONS : ' {"git-sha":"${{ github.sha }}", "annotation1":"value1"}'
101
+ DELIVERY_PIPELINE : ' gha-test-pipeline'
102
+ DESCRIPTION : ' GHA test ${{ env.TEST_UID }}'
103
+ IMAGES : ' gha-test-app=gcr.io/cloudrun/hello:latest'
104
+ LABELS : ' {"managed-by":"github-actions", "label1":"value1"}'
105
+ NAME : ' projects/${{ vars.PROJECT_ID }}/locations/${{ env.REGION }}/deliveryPipelines/gha-test-pipeline/releases/${{ env.TEST_UID }}'
106
+ PROJECT_ID : ' ${{ vars.PROJECT_ID }}'
107
+ REGION : ' ${{ env.REGION }}'
0 commit comments