-
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (89 loc) · 2.56 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
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
pull-requests: write
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: Show the bun lock diff
if: github.event_name == 'pull_request'
uses: RobinTail/[email protected]
- 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: 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 }}
integrationTest:
needs: unitTest
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 18.18.0
- 18.x
- 20.9.0
- 20.x
- 22.0.0
- 22.x
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: Install Node.js ${{ matrix.node-version }}
id: setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install the test dependencies
working-directory: integration-test
run: yarn
- name: Test
working-directory: integration-test
run: yarn eslint src/sample.ts --debug