Production scheduled tests #4839
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
name: Production scheduled tests | |
on: | |
schedule: | |
- cron: '30 */6 * * *' | |
concurrency: production_environment | |
jobs: | |
setup: | |
name: Setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.2.2 | |
- name: Set Node version | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: yarn | |
- name: Restore Node modules | |
id: node-modules | |
uses: actions/cache@v4.1.2 | |
with: | |
path: | | |
./node_modules | |
./applications/*/*/node_modules | |
./packages/*/node_modules | |
key: ${{ runner.os }}-modules-v4-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-modules- | |
- name: Restore cache | |
id: cache | |
uses: actions/cache@v4.1.2 | |
with: | |
path: ~/.cache/Cypress | |
key: ${{ runner.os }}-cache-v4-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cache- | |
- name: Install dependencies | |
if: steps.node-modules.outputs.cache-hit != 'true' || steps.cache.outputs.cache-hit != 'true' | |
run: yarn | |
warm-up: | |
name: Warm up | |
runs-on: ubuntu-latest | |
needs: | |
- setup | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN_ACCOUNTS_BACKEND }} | |
STAGE: production | |
YARN_ENABLE_IMMUTABLE_INSTALLS: false | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.2.2 | |
- name: Set Node version | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: yarn | |
- name: Generate packages cache key | |
run: ./scripts/checksum.sh ./packages.txt packages | |
- name: Restore Node modules | |
uses: actions/cache@v4.1.2 | |
with: | |
path: | | |
./node_modules | |
./applications/*/*/node_modules | |
./packages/*/node_modules | |
key: ${{ runner.os }}-modules-v4-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-modules- | |
- name: Restore packages | |
uses: actions/cache@v4.1.2 | |
with: | |
path: ./packages/*/lib | |
key: ${{ runner.os }}-packages-v4-${{ hashFiles('**/packages.txt') }} | |
restore-keys: | | |
${{ runner.os }}-packages- | |
- name: Restore application cache | |
uses: actions/cache@v4.1.2 | |
with: | |
path: | | |
./applications/accounts/warm-up/node_modules/.cache | |
./applications/accounts/warm-up/.serverless | |
key: ${{ runner.os }}-accounts-warm-up-v4-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-accounts-warm-up-v4- | |
- name: Warm up | |
run: yarn workspace @accounts/warm-up start --stage $STAGE | |
accounts-tests: | |
name: Accounts tests | |
runs-on: ubuntu-latest | |
needs: warm-up | |
strategy: | |
fail-fast: false | |
matrix: | |
containers: | |
- 1 | |
- 2 | |
env: | |
CURRENTS_API_URL: ${{ secrets.CYPRESS_API_URL }} | |
CURRENTS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
CYPRESS_BASE_URL: https://accounts.motechdevelopment.co.uk | |
CYPRESS_AUDIENCE: ${{ secrets.ACCOUNTS_APP_AUDIENCE }} | |
CYPRESS_AUTH_URL: ${{ secrets.CYPRESS_AUTH_URL_PROD }} | |
CYPRESS_CLIENT_ID: ${{ secrets.ACCOUNTS_APP_CLIENT_ID_PROD }} | |
CYPRESS_PASSWORD: ${{ secrets.CYPRESS_PASSWORD }} | |
CYPRESS_USERNAME: ${{ secrets.CYPRESS_USERNAME }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.2.2 | |
- name: Set Node version | |
uses: actions/setup-node@v4.1.0 | |
with: | |
node-version-file: .nvmrc | |
cache: yarn | |
- name: Restore Node modules | |
uses: actions/cache@v4.1.2 | |
with: | |
path: | | |
./node_modules | |
./applications/*/*/node_modules | |
./packages/*/node_modules | |
key: ${{ runner.os }}-modules-v4-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-modules- | |
- name: Restore cache | |
uses: actions/cache@v4.1.2 | |
with: | |
path: ~/.cache/Cypress | |
key: ${{ runner.os }}-cache-v4-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cache- | |
- name: Smoke tests | |
uses: cypress-io/github-action@v6.7.7 | |
with: | |
command: yarn workspace @accounts/client e2e-ci | |
install: false |