-
Notifications
You must be signed in to change notification settings - Fork 307
82 lines (77 loc) · 2.36 KB
/
ci.yml
File metadata and controls
82 lines (77 loc) · 2.36 KB
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
name: ci
on:
push:
branches: [main]
jobs:
what-changed:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.set-packages.outputs.packages }}
permissions:
contents: 'read'
actions: 'read'
pull-requests: 'read'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v5
id: setSHAs
- uses: actions/setup-node@v6
with:
node-version-file: .tool-versions
- run: yarn workspaces focus what-changed
- uses: ./.github/actions/what-changed
id: set-packages
with:
since: ${{ steps.setSHAs.outputs.base }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/cache@v5
with:
path: |
.turbo
packages/*/.cache
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: actions/setup-node@v6
with:
node-version-file: .tool-versions
- run: yarn
- run: yarn typecheck
- run: yarn lint --cache-strategy content
- run: yarn format
test:
runs-on: ubuntu-latest
needs: [what-changed]
if: ${{ needs.what-changed.outputs.packages != '[]' }}
strategy:
matrix:
package: ${{ fromJSON(needs.what-changed.outputs.packages) }}
steps:
- uses: actions/checkout@v6
- uses: actions/cache@v5
with:
path: |
.turbo
packages/*/.cache
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: actions/setup-node@v6
with:
node-version-file: .tool-versions
- run: yarn workspaces focus hono-middleware @hono/${{ matrix.package }}
- run: yarn turbo --filter @hono/${{ matrix.package }} build
- run: yarn test --coverage --project @hono/${{ matrix.package }}
id: test
if: ${{ matrix.package != 'eslint-config' && matrix.package != 'qwik-city' && matrix.package != 'react-compat' }}
- uses: codecov/codecov-action@v5
if: ${{ matrix.package != 'eslint-config' && matrix.package != 'qwik-city' && matrix.package != 'react-compat' }}
with:
fail_ci_if_error: true
directory: ./coverage
flags: ${{ matrix.package }}