-
-
Notifications
You must be signed in to change notification settings - Fork 1
138 lines (133 loc) · 4.23 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
pull-requests: write # for comments in PRs
jobs:
unitTest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Get bun cache dir and hash
id: bunCache
run: |
echo "dir=$(bun pm cache)" >> $GITHUB_OUTPUT
echo "hash=$(bun pm hash)" >> $GITHUB_OUTPUT
- name: Cache node modules
uses: actions/cache@v4
with:
path: ${{ steps.bunCache.outputs.dir }}
key: ${{ runner.os }}-build-cache-bun-${{ steps.bunCache.outputs.hash }}
- name: Install dependencies
run: bun install
- name: Show the bun lock diff
if: github.event_name == 'pull_request'
uses: RobinTail/[email protected]
- name: Testing
run: |
bun run lint
bun run test
- name: Coveralls
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
github-token: ${{ secrets.github_token }}
- name: Benchmark
run: bunx vitest bench --run --outputJson bench.json
- name: Benchmark processing
id: bench
if: github.event_name == 'pull_request'
run: |
echo 'comment<<EOF' >> $GITHUB_OUTPUT
echo "# Performance benchmark" >> $GITHUB_OUTPUT
echo ${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT
echo '```' >> $GITHUB_OUTPUT
bun run tools/benchmark.processor.ts >> $GITHUB_OUTPUT
echo '```' >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Find Benchmark Comment
id: fc
if: github.event_name == 'pull_request'
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: benchmark
- name: Maintain Benchmark Comment
if: github.event_name == 'pull_request'
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: ${{ steps.fc.outputs.comment-id == '' && 'append' || 'replace' }}
reactions: ${{ steps.fc.outputs.comment-id == '' && 'rocket' || 'hooray' }}
body: ${{ steps.bench.outputs.comment }}
integrationTest:
needs: unitTest
runs-on: ubuntu-latest
strategy:
matrix:
mui-version:
- 5.1.0
- 5.3.0
- 5.5.0
- 5.7.0
- 5.9.0
- 5.11.0
- 5.13.0
- 5.15.0
- ^5
- 6.0.0
- latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Get bun cache dir and hash
id: bunCache
run: |
echo "dir=$(bun pm cache)" >> $GITHUB_OUTPUT
echo "hash=$(bun pm hash)" >> $GITHUB_OUTPUT
- name: Cache node modules
uses: actions/cache@v4
with:
path: ${{ steps.bunCache.outputs.dir }}
key: ${{ runner.os }}-build-cache-bun-${{ steps.bunCache.outputs.hash }}
- name: Install dependencies
run: bun install
- name: Build
run: bun run build
- name: Test
env:
MUI_VERSION: ${{ matrix.mui-version }}
run: |
cat >packages/integration-test/package.json <<EOF
{
"name": "integration-test",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"merge-sx": "workspace:*",
"@mui/material": "${MUI_VERSION}",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
EOF
cat packages/integration-test/package.json
bun install --filter integration-test
bun run intTest