Skip to content

Production scheduled tests #4340

Production scheduled tests

Production scheduled tests #4340

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/[email protected]
- name: Set Node version
uses: actions/[email protected]
with:
node-version-file: .nvmrc
cache: yarn
- name: Restore Node modules
id: node-modules
uses: actions/[email protected]
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/[email protected]
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 }}
STAGE: production
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Set Node version
uses: actions/[email protected]
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/[email protected]
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/[email protected]
with:
path: ./packages/*/lib
key: ${{ runner.os }}-packages-v4-${{ hashFiles('**/packages.txt') }}
restore-keys: |
${{ runner.os }}-packages-
- name: Restore application cache
uses: actions/[email protected]
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/[email protected]
- name: Set Node version
uses: actions/[email protected]
with:
node-version-file: .nvmrc
cache: yarn
- name: Restore Node modules
uses: actions/[email protected]
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/[email protected]
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cache-v4-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-cache-
- name: Smoke tests
uses: cypress-io/[email protected]
with:
command: yarn workspace @accounts/client e2e-ci
install: false