Merge pull request #84 from avantifellows/feature/node-engine #15
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: Tests | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm install | |
- name: Run Jest tests | |
uses: willcaul/jest-github-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
test-command: 'npm run test:jest' | |
e2e-tests-chrome: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cypress run (Chrome) | |
uses: cypress-io/github-action@v6 | |
env: | |
APP_ENV: ${{ secrets.TESTING_APP_ENV }} | |
AF_DB_URL: ${{ secrets.STAGING_AF_DB_URL }} | |
AF_BEARER_TOKEN: ${{ secrets.STAGING_AF_BEARER_TOKEN }} | |
with: | |
build: npm run build | |
start: npm run start | |
wait-on: 'http://localhost:3000' | |
browser: chrome | |
e2e-tests-firefox: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cypress run (Firefox) | |
uses: cypress-io/github-action@v6 | |
env: | |
APP_ENV: ${{ secrets.TESTING_APP_ENV }} | |
AF_DB_URL: ${{ secrets.STAGING_AF_DB_URL }} | |
AF_BEARER_TOKEN: ${{ secrets.STAGING_AF_BEARER_TOKEN }} | |
with: | |
build: npm run build | |
start: npm run start | |
wait-on: 'http://localhost:3000' | |
browser: firefox |