Skip to content

Commit 258d4be

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 0cdb208 commit 258d4be

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/ci.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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: yarn start:dev, yarn start:frontend
42+
command: yarn test:cy
43+
end-to-end-tests-firefox:
44+
needs: unit-tests
45+
runs-on: ubuntu-latest
46+
container: cypress/base:16.5.0
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v2
50+
- name: Install dependencies
51+
uses: cypress-io/github-action@v2
52+
with:
53+
install-command: yarn install
54+
runTests: false
55+
- name: Run end-to-end tests on Firefox 🧪
56+
uses: cypress-io/github-action@v2
57+
env:
58+
API_URL: ${{ secrets.API_URL }}
59+
PORT: ${{ secrets.PORT }}
60+
MONGODB_LOCAL_URL: ${{ secrets.MONGODB_LOCAL_URL }}
61+
CYPRESS_user: ${{ secrets.CYPRESS_user }}
62+
CYPRESS_password: ${{ secrets.CYPRESS_password }}
63+
with:
64+
install: false
65+
start: yarn start:dev, yarn start:frontend
66+
command: yarn test:cy:firefox

0 commit comments

Comments
 (0)