-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (71 loc) · 2.13 KB
/
push.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: OpenTMI CI
on:
push:
branches:
- master
pull_request:
paths-ignore:
- '**/*.md'
- '.github/workflows/docker.yml'
env:
CHROME_BIN: "/usr/bin/google-chrome"
NODE_ENV: test
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
permissions:
checks: write
contents: write
pull-requests: write
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: install mongodb tools
run: sudo apt-get install -y mongodb-org-shell
- name: install dependencies
run: npm ci
- name: run unit tests
run: npm run test-unit-ci
- name: coveralls
run: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- name: Create mongoDB Docker container
run: sudo docker run -d -p 27017:27017 mongo:4.4.10-focal
- name: api tests
run: |
MOCHA_FILE=junit/apitests.xml NODE_OPTIONS=--trace-warnings grunt apitests --silent
- name: cluster tests
run: |
MOCHA_FILE=junit/clustertests.xml grunt clustertests --silent
- name: lint
run: |
npm run lint
- uses: actions/upload-artifact@v4
if: success() || failure() # run this step even if previous step failed
with:
# Artifact name
name: logs-${{ matrix.node-version }}
path: log/*
- uses: actions/upload-artifact@v4
with:
# Artifact name
name: coverage-report-${{ matrix.node-version }}
path: coverage/lcov-report/**
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
# Name of the check run which will be created
name: Unit Test report ${{ matrix.node-version }}
path: report_unit.json
reporter: mocha-json