-
Notifications
You must be signed in to change notification settings - Fork 6
81 lines (77 loc) · 2.33 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
76
77
78
79
80
81
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-22.04
strategy:
matrix:
node-version: [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@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Setup mongo tools
uses: boly38/action-mongo-tools@stable
- 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
- 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/**
- uses: actions/upload-artifact@v4
if: success() || failure() # run this step even if previous step failed
with:
# Artifact name
name: npm-logs-${{ matrix.node-version }}
path: /home/runner/.npm/_logs
- 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