-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (76 loc) · 1.99 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
compat:
name: Check compatibility
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node_version:
- 18
- 20
- 22
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
cache: 'npm'
node-version: ${{ matrix.node_version }}
- run: npm ci --no-fund --no-audit
- name: Run tests
run: npm run test
check:
name: Code quality and coverage report
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
cache: 'npm'
node-version: 20
- run: npm ci --no-fund --no-audit
- name: Run checks
run: npm run check:ci
- name: Collect coverage
run: npm run coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release:
name: Release
needs:
- check
permissions:
contents: write
id-token: write
pull-requests: write
runs-on: ubuntu-latest
if: github.repository_owner == 'friedemannsommer' && github.ref_name == 'main'
concurrency: '${{ github.workflow }}-${{ github.ref }}'
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
cache: 'npm'
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm ci --no-fund --no-audit
- name: Create release PR or publish
uses: changesets/[email protected]
with:
title: 'ci(changesets): package release'
commit: 'ci(changesets): version package'
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}