Skip to content

Commit c57fd29

Browse files
committed
Add Github Actions "E2E Test" workflow
1 parent 38f7011 commit c57fd29

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ Dockerfile
22
docker-compose.yml
33
.dockerignore
44
.git
5+
.github
56
.gitignore

.github/workflows/e2e-test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: E2E Test
2+
on: [push, pull_request]
3+
4+
jobs:
5+
e2e-test:
6+
name: Node.js
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
node-version: ["10.x", "12.x", "14.x"]
13+
14+
steps:
15+
- name: Checkout https://github.com/${{ github.repository }}@${{ github.ref }}
16+
uses: actions/checkout@v2
17+
with:
18+
persist-credentials: false
19+
20+
- name: Set up Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: Use cache
26+
uses: actions/cache@v2
27+
with:
28+
path: |
29+
~/.npm
30+
~/.cache
31+
key: ${{ runner.os }}-node${{ matrix.node-version }}-E2E-${{ hashFiles('package-lock.json') }}
32+
33+
- name: Install dependencies
34+
run: |
35+
npm ci
36+
npm run cy:verify
37+
38+
- name: Start MongoDB
39+
run: |
40+
docker run -d -p 27017:27017 mongo:4.0
41+
timeout 60s bash -c 'until nc -z -w 2 localhost 27017 && echo MongoDB ready; do sleep 2; done'
42+
43+
- name: Run E2E test suite
44+
run: |
45+
NODE_ENV=test npm start -- --silent &
46+
npm run test:ci

0 commit comments

Comments
 (0)