-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (44 loc) · 1.37 KB
/
main.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
name: Node CI
on: [push, pull_request]
jobs:
build-node:
runs-on: ubuntu-latest
strategy:
matrix:
mongodb-version: [5.0]
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.17.0
uses: actions/setup-node@v4
with:
node-version: 20.17.0
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v4
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: MongoDB in GitHub Actions
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: npm install, build, test and doc
run: |
npm ci
npm run build --if-present
npm run test
npm run doc
npm run postman
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
CI: true
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
MONGODB_URI_LOCAL: ${{ secrets.MONGODB_URI_LOCAL }}