-
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (33 loc) · 1.05 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
name: Test
on:
push:
branches: [ 'master' ]
pull_request:
branches: [ 'master', 'v[0-9]*' ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm i -g "npm@$(npm pkg get engines.npm | grep -Eom 1 '[^"]+')"
- run: npm i --no-save semver
- name: Get Node version from package.json
id: get_node_version
run: |
v="$(npm pkg get engines.node)"
v="$(node -p "require(\"semver/ranges/min-version\")($v).toString()")"
echo "min_node_version=$v" >> "$GITHUB_OUTPUT"
- run: git reset --hard
- run: git clean -fx
- uses: actions/setup-node@v3
with:
node-version: ${{ steps.get_node_version.outputs.min_node_version }}
- run: npm ci --engine-strict=false
- run: npm run build --if-present
- run: npm test
env:
INPUT_TOKEN: ${{ github.token }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: coverage/lcov.info