Skip to content

Commit

Permalink
Create github workflow to run tests
Browse files Browse the repository at this point in the history
First, it will run the unit tests, and only if they all pass, it
will run the end-to-end tests (against Chrome and Firefox.)
  • Loading branch information
wlsf82 committed Dec 14, 2021
1 parent 0cdb208 commit 258d4be
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: ci

on:
push:
branches:
- development
- master
pull_request:

jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Run unit tests 🧪
run: yarn test
end-to-end-tests-chrome:
needs: unit-tests
runs-on: ubuntu-latest
container: cypress/base:16.5.0
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
uses: cypress-io/github-action@v2
with:
install-command: yarn install
runTests: false
- name: Run end-to-end tests on Chrome 🧪
uses: cypress-io/github-action@v2
env:
API_URL: ${{ secrets.API_URL }}
PORT: ${{ secrets.PORT }}
MONGODB_LOCAL_URL: ${{ secrets.MONGODB_LOCAL_URL }}
CYPRESS_user: ${{ secrets.CYPRESS_user }}
CYPRESS_password: ${{ secrets.CYPRESS_password }}
with:
install: false
start: yarn start:dev, yarn start:frontend
command: yarn test:cy
end-to-end-tests-firefox:
needs: unit-tests
runs-on: ubuntu-latest
container: cypress/base:16.5.0
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
uses: cypress-io/github-action@v2
with:
install-command: yarn install
runTests: false
- name: Run end-to-end tests on Firefox 🧪
uses: cypress-io/github-action@v2
env:
API_URL: ${{ secrets.API_URL }}
PORT: ${{ secrets.PORT }}
MONGODB_LOCAL_URL: ${{ secrets.MONGODB_LOCAL_URL }}
CYPRESS_user: ${{ secrets.CYPRESS_user }}
CYPRESS_password: ${{ secrets.CYPRESS_password }}
with:
install: false
start: yarn start:dev, yarn start:frontend
command: yarn test:cy:firefox

0 comments on commit 258d4be

Please sign in to comment.