forked from okv/east-mongo
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.52 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
name: Test
on: [push]
env:
DEFAULT_NODE_VERSION: '20'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
cache: 'yarn'
- name: Install dependencies
run: yarn
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Lint
run: yarn lint
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node_version: [18, 20, 22]
mongodb_driver_version: ['4.17.2', '5.5.0', '5.9.2', '6.7.0']
steps:
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
cache: 'yarn'
- name: Install dependencies
run: yarn
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Install MongoDB driver
run: yarn add -DE mongodb@${{ matrix.mongodb_driver_version }}; yarn
- name: Compile app
run: yarn build
- uses: supercharge/[email protected]
- uses: supercharge/[email protected]
- name: Run tests
run: yarn test
env:
MONGODB_URI: mongodb://localhost:27017/east_mongo_test
- name: Upload Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}