-
Notifications
You must be signed in to change notification settings - Fork 130
53 lines (43 loc) · 1.44 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
name: Continuous Integration
on: [push]
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
node: [20, 22]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Lint code
run: npm run lint:ci
- name: Lint styles
run: npm run lint:css
- name: Run unit tests
# For some reason, the global script doesn't run tests in packages/eslint-plugin-circuit-ui
# I suspect it's because it's not an ES module.
run: npm run test:ci && cd packages/eslint-plugin-circuit-ui && npm run test:ci
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Create release PR or publish to npm
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/canary') && matrix.node == 20
uses: changesets/action@v1
with:
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}