test-command #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: | |
# A user with write status to the repo can from a PR comment: | |
# run a single test | |
# /test make=<make-target> region=<region> | |
# run ping test | |
# /test ping | |
# run all tests in the makefile | |
# /test | |
name: test | |
on: | |
repository_dispatch: | |
types: [test-command] | |
permissions: | |
id-token: write | |
contents: read | |
defaults: | |
run: | |
# We need -e -o pipefail for consistency with GitHub Actions' default behavior | |
shell: bash -e -o pipefail {0} | |
jobs: | |
e2e-test: | |
uses: defenseunicorns/delivery-github-actions-workflows/.github/workflows/e2e-test.yml@main | |
secrets: | |
APPLICATION_ID: ${{ secrets.NARWHAL_BOT_APP_ID }} | |
APPLICATION_PRIVATE_KEY: ${{ secrets.NARWHAL_BOT_SECRET }} | |
AWS_COMMERCIAL_ROLE_TO_ASSUME: ${{ secrets.NARWHAL_AWS_COMMERCIAL_ROLE_TO_ASSUME }} | |
AWS_GOVCLOUD_ROLE_TO_ASSUME: ${{ secrets.NARWHAL_AWS_GOVCLOUD_ROLE_TO_ASSUME }} | |
with: | |
# check if the required slash command args are present, if so populate the json matrix, else pass in null and relevant e2e tests that would require a make target and region will be skipped | |
e2e-test-matrix: ${{ (contains(github.event.client_payload.slash_command_args.named, 'make') && contains(github.event.client_payload.slash_command_args.named, 'region')) && format('[{{"make-target":"{0}", "region":"{1}"}}]', github.event.client_payload.slash_command_args.named.make, github.event.client_payload.slash_command_args.named.region) || null }} |