@@ -263,3 +263,99 @@ jobs:
263
263
GITHUB_TARGET_URL : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
264
264
GITHUB_REF : ${{ github.event.client_payload.pull_request.head.ref }}
265
265
GITHUB_OWNER : ${{ github.event.client_payload.github.payload.repository.owner.login }}
266
+
267
+ # Run the Game E2E test
268
+ e2e-general-cli :
269
+ runs-on : ubuntu-latest
270
+ needs : [ parse, build ]
271
+ if : needs.parse.outputs.run-e2e == 'true'
272
+ container : cloudposse/test-harness:latest
273
+ steps :
274
+ # Update GitHub status for pending pipeline run
275
+ - name : " Update GitHub Status for pending"
276
+ uses : docker://cloudposse/github-status-updater
277
+ with :
278
+ args : " -action update_state -ref ${{ github.event.client_payload.pull_request.head.sha }} -repo ${{ github.event.client_payload.github.payload.repository.name }}"
279
+ env :
280
+ GITHUB_TOKEN : ${{ secrets.PAT }}
281
+ GITHUB_STATE : pending
282
+ GITHUB_CONTEXT : " /test e2e - General CLI"
283
+ GITHUB_DESCRIPTION : " started by @${{ github.event.client_payload.github.actor }}"
284
+ GITHUB_TARGET_URL : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
285
+ GITHUB_REF : ${{ github.event.client_payload.pull_request.head.ref }}
286
+ GITHUB_OWNER : ${{ github.event.client_payload.github.payload.repository.owner.login }}
287
+
288
+ # Checkout the code from GitHub Pull Request
289
+ - name : " Checkout the code"
290
+ uses : actions/checkout@v2
291
+ with :
292
+ token : ${{ secrets.PAT }}
293
+ repository : ${{ github.event.client_payload.pull_request.head.repo.full_name }}
294
+ ref : ${{ github.event.client_payload.pull_request.head.ref }}
295
+
296
+ # Download the built artifacts
297
+ - name : " Download the built artifacts"
298
+ uses : actions/download-artifact@v2
299
+
300
+ - name : " Run E2E tests"
301
+ shell : bash -x -e -o pipefail {0}
302
+ env :
303
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID_DEFENSEUNICORNS_COMMERCIAL_SA_ZARF }}
304
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY_DEFENSEUNICORNS_COMMERCIAL_SA_ZARF }}
305
+ AWS_DEFAULT_REGION : us-east-1
306
+ run : |
307
+ # cloudposse/test-harness has golang 1.15, we need 1.16. This is the easiest way I know to do it. This should definitely be revisited and cleaned up.
308
+ git clone --branch v0.8.0 --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf
309
+ source ~/.asdf/asdf.sh
310
+ export PATH="$HOME/.asdf/bin:$PATH"
311
+ asdf plugin-add golang https://github.com/kennyp/asdf-golang.git
312
+ asdf install golang 1.16.7
313
+ asdf global golang 1.16.7
314
+ export GOPATH="$HOME/go"
315
+ export PATH="$PATH:$GOPATH/bin"
316
+ chmod +x build/zarf
317
+ make test-cloud-e2e-general-cli
318
+
319
+ # Update GitHub status for failing pipeline run
320
+ - name : " Update GitHub Status for failure"
321
+ if : ${{ failure() }}
322
+ uses : docker://cloudposse/github-status-updater
323
+ with :
324
+ args : " -action update_state -ref ${{ github.event.client_payload.pull_request.head.sha }} -repo ${{ github.event.client_payload.github.payload.repository.name }}"
325
+ env :
326
+ GITHUB_TOKEN : ${{ secrets.PAT }}
327
+ GITHUB_STATE : failure
328
+ GITHUB_CONTEXT : " /test e2e - General CLI"
329
+ GITHUB_DESCRIPTION : " run failed"
330
+ GITHUB_TARGET_URL : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
331
+ GITHUB_REF : ${{ github.event.client_payload.pull_request.head.ref }}
332
+ GITHUB_OWNER : ${{ github.event.client_payload.github.payload.repository.owner.login }}
333
+
334
+ # Update GitHub status for successful pipeline run
335
+ - name : " Update GitHub Status for success"
336
+ uses : docker://cloudposse/github-status-updater
337
+ with :
338
+ args : " -action update_state -ref ${{ github.event.client_payload.pull_request.head.sha }} -repo ${{ github.event.client_payload.github.payload.repository.name }}"
339
+ env :
340
+ GITHUB_TOKEN : ${{ secrets.PAT }}
341
+ GITHUB_STATE : success
342
+ GITHUB_CONTEXT : " /test e2e - General CLI"
343
+ GITHUB_DESCRIPTION : " run passed"
344
+ GITHUB_TARGET_URL : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
345
+ GITHUB_REF : ${{ github.event.client_payload.pull_request.head.ref }}
346
+ GITHUB_OWNER : ${{ github.event.client_payload.github.payload.repository.owner.login }}
347
+
348
+ # Update GitHub status for cancelled pipeline run
349
+ - name : " Update GitHub Status for cancelled"
350
+ if : ${{ cancelled() }}
351
+ uses : docker://cloudposse/github-status-updater
352
+ with :
353
+ args : " -action update_state -ref ${{ github.event.client_payload.pull_request.head.sha }} -repo ${{ github.event.client_payload.github.payload.repository.name }}"
354
+ env :
355
+ GITHUB_TOKEN : ${{ secrets.PAT }}
356
+ GITHUB_STATE : error
357
+ GITHUB_CONTEXT : " /test e2e - General CLI"
358
+ GITHUB_DESCRIPTION : " run cancelled"
359
+ GITHUB_TARGET_URL : https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
360
+ GITHUB_REF : ${{ github.event.client_payload.pull_request.head.ref }}
361
+ GITHUB_OWNER : ${{ github.event.client_payload.github.payload.repository.owner.login }}
0 commit comments