Skip to content

Commit ee3a63b

Browse files
committed
Create github workflow to run tests
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.)
1 parent 860225f commit ee3a63b

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
- master
8+
pull_request:
9+
10+
jobs:
11+
unit-tests:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Install dependencies
16+
run: yarn install
17+
- name: Run unit tests 🧪
18+
run: yarn test
19+
end-to-end-tests-chrome:
20+
needs: unit-tests
21+
runs-on: ubuntu-latest
22+
container: cypress/base:16.5.0
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
- name: Install dependencies
27+
uses: cypress-io/github-action@v2
28+
with:
29+
install-command: yarn install
30+
runTests: false
31+
- name: Run end-to-end tests on Chrome 🧪
32+
uses: cypress-io/github-action@v2
33+
env:
34+
API_URL: ${{ secrets.API_URL }}
35+
PORT: ${{ secrets.PORT }}
36+
MONGODB_LOCAL_URL: ${{ secrets.MONGODB_LOCAL_URL }}
37+
CYPRESS_user: ${{ secrets.CYPRESS_user }}
38+
CYPRESS_password: ${{ secrets.CYPRESS_password }}
39+
with:
40+
install: false
41+
start: |
42+
yarn start:dev
43+
yarn start:frontend
44+
command: yarn test:cy
45+
end-to-end-tests-firefox:
46+
needs: unit-tests
47+
runs-on: ubuntu-latest
48+
container: cypress/base:16.5.0
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v2
52+
- name: Install dependencies
53+
uses: cypress-io/github-action@v2
54+
with:
55+
install-command: yarn install
56+
runTests: false
57+
- name: Run end-to-end tests on Firefox 🧪
58+
uses: cypress-io/github-action@v2
59+
env:
60+
API_URL: ${{ secrets.API_URL }}
61+
PORT: ${{ secrets.PORT }}
62+
MONGODB_LOCAL_URL: ${{ secrets.MONGODB_LOCAL_URL }}
63+
CYPRESS_user: ${{ secrets.CYPRESS_user }}
64+
CYPRESS_password: ${{ secrets.CYPRESS_password }}
65+
with:
66+
install: false
67+
start: |
68+
yarn start:dev
69+
yarn start:frontend
70+
command: yarn test:cy:firefox

0 commit comments

Comments
 (0)