-
Notifications
You must be signed in to change notification settings - Fork 1
143 lines (123 loc) · 4.25 KB
/
ci.yml
File metadata and controls
143 lines (123 loc) · 4.25 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
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
139
140
141
142
143
name: CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "*.md"
- "packages/docs/**"
- "LICENSE"
merge_group:
push:
branches:
- main
paths-ignore:
- "*.md"
- "packages/docs/**"
- "LICENSE"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Job dependency graph:
#
# check ─────────────────────────────────────────────┐
# │
# ┌── test (Ubuntu 22) ──────────────────────┤
# ├── test (macOS 22) ───────────────────────┤
# build ──┼── test (Windows 22) ─────────────────────┼── status
# └── test (Ubuntu 24) ──────────────────────┤
# │
# (release-any-commit runs independently) ──────────┘
jobs:
build:
name: Build
if: ${{ github.event.pull_request.draft != true }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/setup
- name: Build
run: nadle build
- name: Typecheck
run: pnpm exec tsc -b --noEmit
- name: Verify API surface
working-directory: packages/nadle
run: |
pnpm exec api-extractor run
if grep -qE "Warning:|undocumented" index.api.md; then
echo "::error::API documentation contains warnings or undocumented items"
exit 1
fi
- name: Upload build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: build-output
path: |
packages/kernel/lib
packages/project-resolver/lib
packages/nadle/lib
packages/eslint-plugin/lib
packages/create-nadle/lib
retention-days: 1
check:
name: Lint
if: ${{ github.event.pull_request.draft != true }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/setup
- name: Check
run: nadle check
test:
name: Test Node ${{ matrix.node-version }} on ${{ matrix.os }}
if: ${{ github.event.pull_request.draft != true }}
needs: [build]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node-version: ["22"]
include:
- os: ubuntu-latest
node-version: "24"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}
- name: Download build artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: build-output
path: packages
- name: Test kernel
run: pnpm -F @nadle/kernel exec vitest run
- name: Test project
run: pnpm -F @nadle/project-resolver exec vitest run
- name: Test nadle
run: pnpm -F nadle exec vitest run
- name: Test eslint-plugin
run: pnpm -F eslint-plugin-nadle exec vitest run
- name: Test create-nadle
run: pnpm -F create-nadle exec vitest run
status:
name: CI Status
needs: [check, build, test]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check results
if: |
(needs.check.result == 'failure' || needs.check.result == 'cancelled') ||
(needs.build.result == 'failure' || needs.build.result == 'cancelled') ||
(needs.test.result == 'failure' || needs.test.result == 'cancelled')
run: exit 1