From 266d24b1b56d9de660c5696254885376183009d9 Mon Sep 17 00:00:00 2001 From: Rob Wood Date: Thu, 19 Dec 2024 14:15:47 -0500 Subject: [PATCH] Add production sanity test to CI (#799) --- .github/workflows/deploy-production.yml | 35 +++++++++++++++++ .github/workflows/nightly-tests.yml | 50 +++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 .github/workflows/nightly-tests.yml diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index c3db9c195..754402bb6 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -233,3 +233,38 @@ jobs: terragrunt validate terragrunt plan -var "image=${{ steps.get_ecr_tag.outputs.ecr_tag }}" -out tfplan terragrunt apply tfplan + + prod-sanity-browserstack: + name: prod-sanity-browserstack + needs: [deploy-prod-backend, deploy-prod-frontend] + runs-on: ubuntu-latest + environment: production + env: + APPT_PROD_LOGIN_EMAIL: ${{ secrets.E2E_APPT_PROD_LOGIN_EMAIL }} + APPT_PROD_LOGIN_PWORD: ${{ secrets.E2E_APPT_PROD_LOGIN_PASSWORD }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + cache-dependency-path: 'test/e2e/package-lock.json' + + - name: Install dependencies + run: | + cd ./test/e2e + npm install + + - name: BrowserStack Env Setup + uses: browserstack/github-actions/setup-env@master + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + project-name: 'Thunderbird Appointment' + + - name: Run Playwright Tests on Browserstack + run: | + cd ./test/e2e + cp .env.example .env + npm run prod-sanity-test-browserstack diff --git a/.github/workflows/nightly-tests.yml b/.github/workflows/nightly-tests.yml new file mode 100644 index 000000000..b5f5fa73d --- /dev/null +++ b/.github/workflows/nightly-tests.yml @@ -0,0 +1,50 @@ +name: nightly-tests + +concurrency: + group: nightly-tests + cancel-in-progress: true + +on: + schedule: + # run every day at 1am UTC (8PM EST) + - cron: '0 1 * * *' + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: read # This is required for actions/checkout + +jobs: + prod-sanity-browserstack: + name: prod-sanity-browserstack + runs-on: ubuntu-latest + environment: production + env: + APPT_PROD_LOGIN_EMAIL: ${{ secrets.E2E_APPT_PROD_LOGIN_EMAIL }} + APPT_PROD_LOGIN_PWORD: ${{ secrets.E2E_APPT_PROD_LOGIN_PASSWORD }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + cache-dependency-path: 'test/e2e/package-lock.json' + + - name: Install dependencies + run: | + cd ./test/e2e + npm install + + - name: BrowserStack Env Setup + uses: browserstack/github-actions/setup-env@master + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + project-name: 'Thunderbird Appointment' + + - name: Run Playwright Tests on Browserstack + run: | + cd ./test/e2e + cp .env.example .env + npm run prod-sanity-test-browserstack