forked from Atos-Research-and-Innovation/IoTagent-LoRaWAN
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (59 loc) · 1.58 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# This action works with pull requests and pushes
name: Test
on:
pull_request:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [12, 14, 16]
env:
COVERALLS_REPO_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN_SECRET}}
steps:
- uses: actions/checkout@v2
- run: |
cd docker/mosquitto/config-ssl/certs
bash generate-ca.sh
cd ../../..
docker compose -f docker-compose-dev.yml up -d
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: "Unit Tests with Node.js ${{ matrix.node }}"
run: |
npm install
npm test
- run: |
cd docker
docker compose -f docker-compose-dev.yml down -v
code-coverage:
name: Coveralls Code Coverage
runs-on: ubuntu-latest
needs: test
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: "Test Coverage with Node.js 14.x"
uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/checkout@v2
- run: |
cd docker/mosquitto/config-ssl/certs
bash generate-ca.sh
cd ../../..
docker compose -f docker-compose-dev.yml up -d
- run: |
npm install
npm run test:coverage
- name: Push to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: |
cd docker
docker compose -f docker-compose-dev.yml down -v