-
Notifications
You must be signed in to change notification settings - Fork 28
58 lines (55 loc) · 1.63 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
48
49
50
51
52
53
54
55
56
57
58
name: CI
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest]
node: ['18', '20']
name: Node ${{ matrix.node }} (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: install dependencies
run: npm ci --ignore-engines --ignore-scripts
- name: lint code
run: npm run lint
env:
CI: true
- name: run tests
run: npm run test
env:
CI: true
- name: coverage
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
verbose: false
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
CI: true
release:
name: do semantic release
runs-on: 'ubuntu-latest'
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '20'
- name: install dependencies
run: npm ci --ignore-engines --ignore-scripts
- name: release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}