-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (86 loc) · 2.4 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Ecosystem
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.github/actions/prepareEnvironment
- name: Run lint
run: pnpm lint
build:
runs-on: ubuntu-latest
name: Build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.github/actions/prepareEnvironment
- name: Run build
run: pnpm build
test:
needs: build
name: Test Node-${{matrix.node}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ["18", "20", "current", "latest"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.github/actions/prepareEnvironment
with:
node-version: ${{ matrix.node }}
- name: Run build
run: pnpm build
- name: Run tests
run: pnpm test
- name: Upload coverage
if: ${{matrix.node == 'current'}}
uses: actions/upload-artifact@v4
with:
name: Coverage
path: packages/*/coverage/coverage-summary.json
retention-days: 1
coverage:
name: Coverage
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.github/actions/prepareEnvironment
- name: Download coverage
uses: actions/download-artifact@v4
with:
name: Coverage
- name: Build badges package
run: pnpm build && pnpm i
- name: Check badges
run: pnpm badges:ci
changesets:
name: Publish
needs: [coverage, test, build, lint]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare environment
uses: ./.github/actions/prepareEnvironment
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
commit: 'chore: release package(s)'
title: 'chore: release package(s)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}