From 927ca89c455c3a1905ac0e5aaf7a645fbb9a23b0 Mon Sep 17 00:00:00 2001 From: Scott Prutton Date: Tue, 25 Jun 2024 09:41:21 -0400 Subject: [PATCH] feat: cypress on cron, cancel on deploy --- .github/workflows/crons.yml | 17 +++++++++++++++++ .github/workflows/deploy-on-main.yml | 7 +++++++ .github/workflows/e2e-validation.yml | 6 +++--- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/crons.yml diff --git a/.github/workflows/crons.yml b/.github/workflows/crons.yml new file mode 100644 index 0000000000..fe9bc8aafe --- /dev/null +++ b/.github/workflows/crons.yml @@ -0,0 +1,17 @@ +on: + schedule: + - cron: '*/15 * * * *' # Runs every 15 minutes + +# We want to ensure that in-progress cron runs are canceled +# when do a deploy so they don't fail erroneously, but these +# cannot cancel deploys +concurrency: + group: e2e + cancel-in-progress: false + +jobs: + e2e-validation: + uses: ./.github/workflows/e2e-validation.yml + with: + environment: tools + secrets: inherit diff --git a/.github/workflows/deploy-on-main.yml b/.github/workflows/deploy-on-main.yml index 2daeddf42f..4ea5b01af0 100644 --- a/.github/workflows/deploy-on-main.yml +++ b/.github/workflows/deploy-on-main.yml @@ -2,6 +2,13 @@ on: push: branches: - main + +# We want to ensure that in-progress cron runs are canceled +# when do a deploy so they don't fail erroneously +concurrency: + group: e2e + cancel-in-progress: true + jobs: deploy-tools-prod: uses: ./.github/workflows/deploy-stack.yml diff --git a/.github/workflows/e2e-validation.yml b/.github/workflows/e2e-validation.yml index b586e7111d..fed67af579 100644 --- a/.github/workflows/e2e-validation.yml +++ b/.github/workflows/e2e-validation.yml @@ -1,8 +1,6 @@ name: Cypress E2E Tests on: -# schedule: -# - cron: '*/5 * * * *' # Runs every 5 minutes workflow_call: inputs: environment: @@ -30,7 +28,9 @@ jobs: fail-fast: false matrix: # run copies of the current job in parallel - containers: [1] # , 2, 3, 4, 5, 6, 7, 8, 9, 10] - temp disabled mass + # TODO: we really should build once and set it as an + # artifact so we aren't rebuilding for each of these + containers: [1, 2, 3] #, 4, 5, 6, 7, 8, 9, 10] - temp disabled mass steps: - name: Checkout code uses: actions/checkout@v3