-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (87 loc) · 2.84 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
name: CI
on:
pull_request:
branches: [main]
merge_group:
branches: [main]
concurrency:
group: '${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}'
cancel-in-progress: true
permissions:
contents: read
packages: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm turbo run build
test_plan:
name: Test [plan]
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.plan.outputs.packages }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: fuxingloh/turbo-plan@4bd6ef3cdb543fbf5fca55b6b5b74892acecdfa5 # v2
id: plan
with:
task: test
test_run:
name: Test [run]
needs: test_plan
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: ${{ fromJSON(needs.test_plan.outputs.packages) }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile
# Install kubernetes-in-docker (kind) for @chainfile/cdk8s
- run: go install sigs.k8s.io/kind@latest
if: ${{ matrix.package == '@chainfile/cdk8s' }}
- run: pnpm turbo run test --filter=${{ matrix.package }}
test_completed:
name: Test [completed]
runs-on: ubuntu-latest
if: always()
needs:
- test_run
steps:
- run: |
if ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled') }} ; then
exit 1
fi
lint_prettier:
name: Lint [prettier]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm prettier --check .
lint_eslint:
name: Lint [eslint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version-file: '.nvmrc'
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm turbo run lint