fix: cypress run at github workflow #4
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: Jest Tests | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 18 | |
- name: Install Frontend Dependencies | |
run: yarn install | |
- name: Run Emulator | |
run: yarn emulator & echo $! > emulator_pid.txt | |
- name: Seed Database | |
run: yarn seed | |
- name: Run Jest Tests | |
run: yarn test --ci --watchAll=false --silent | |
- name: Cypress:Start the development server | |
run: PORT=3000 yarn dev & echo $! > frontend_pid.txt | |
- name: Cypress:Run Tests | |
run: yarn test:cypress | |
- name: Stop Emulator | |
run: kill $(cat emulator_pid.txt) | |
if: always() | |
- name: Stop Front | |
run: kill $(cat frontend_pid.txt) | |
if: always() | |
- name: Install Backend Dependencies | |
run: | | |
cd functions | |
yarn install | |
- name: Run Backend Tests | |
run: | | |
cd functions | |
yarn test --ci --watchAll=false |