-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (81 loc) · 2.57 KB
/
ci.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
82
83
84
85
86
---
name: Node.JS CI
on: # yamllint disable-line rule:truthy
push:
paths-ignore:
- "*.md"
pull_request:
paths-ignore:
- "*.md"
permissions: read-all
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [22]
os: [ubuntu-latest]
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Cache node modules
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm ci
- name: Validate dependency licenses
run: |
npm run license-checker
- name: Start MongoDB in docker
uses: DigiPie/mongo-action@6d27db18a4ce1bb707cd221e3408e5c7a8590c8c
with:
image_version: latest
port: 27017
- name: Run tests
run: |
npm run coverage:lcov
env:
CI: true
MONGODB_URI: mongodb://localhost:27017/test-db # use mongoDB docker
- name: Coveralls Parallel
uses: coverallsapp/github-action@4cdef0b2dbe0c9aa26bed48edb868db738625e79
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.os }}-${{ matrix.node-version }}
parallel: true
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@4cdef0b2dbe0c9aa26bed48edb868db738625e79
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
automerge:
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
needs: test
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@0fa926bf56cf573a599afcc6d39b25b734fd6252
with:
github-token: ${{secrets.GITHUB_TOKEN}}