Skip to content

Commit bd1ccae

Browse files
committed
Run mocha tests via Docker.
1 parent 07b2d91 commit bd1ccae

File tree

5 files changed

+52
-1224
lines changed

5 files changed

+52
-1224
lines changed

.github/workflows/nodejs.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Node CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: Setup Node.js
11+
uses: actions/setup-node@v1
12+
with:
13+
node-version: 12.x
14+
- name: npm install
15+
run: npm install
16+
env:
17+
CI: true
18+
- name: lint
19+
run: npm run lint
20+
env:
21+
CI: true
22+
23+
unit:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v1
27+
- name: mocha
28+
run: docker-compose run --rm mocha
29+
- name: docker-compose logs
30+
if: always()
31+
run: docker-compose logs nginx
32+
- name: docker-compose down
33+
if: always()
34+
run: docker-compose down -v

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: '3.7'
2+
services:
3+
nginx:
4+
image: nginx:alpine
5+
ports:
6+
- 127.0.0.1:80:80
7+
- ${SERVER_HOST:-127.0.0.1}:${SERVER_PORT-}:80
8+
volumes:
9+
- .:/usr/share/nginx/html:ro
10+
mocha:
11+
image: blueimp/mocha-chrome
12+
command: http://nginx/test
13+
environment:
14+
- WAIT_FOR_HOSTS=nginx:80
15+
depends_on:
16+
- nginx

0 commit comments

Comments
 (0)