-
Notifications
You must be signed in to change notification settings - Fork 2
223 lines (200 loc) · 7.34 KB
/
Copy pathci.yml
File metadata and controls
223 lines (200 loc) · 7.34 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: CI
on:
push:
branches: [master, main, 'release/*']
pull_request:
branches: [master, main, 'release/*']
jobs:
# Single source of truth for Nim / Nimble versions used by every job and
# every reusable workflow below. Values live in versions.env at the repo
# root so they're greppable and editable in one place, next to ffi.nimble.
# The job exposes them as outputs because the `with:` of a reusable-workflow
# call only accepts the `needs`, `inputs`, `vars`, and `github` contexts —
# `env` is not allowed there, which rules out plain workflow-level env vars.
versions:
runs-on: ubuntu-latest
outputs:
nim-versions: ${{ steps.load.outputs.NIM_VERSIONS }}
nimble: ${{ steps.load.outputs.NIMBLE_VERSION }}
steps:
- uses: actions/checkout@v4
- id: load
run: cat versions.env >> "$GITHUB_OUTPUT"
alloc:
name: Alloc
needs: versions
uses: ./.github/workflows/test.yml
with:
test: test_alloc
nim-versions: ${{ needs.versions.outputs.nim-versions }}
nimble-version: ${{ needs.versions.outputs.nimble }}
ffi-context:
name: FFI Context
needs: versions
uses: ./.github/workflows/test.yml
with:
test: test_ffi_context
nim-versions: ${{ needs.versions.outputs.nim-versions }}
nimble-version: ${{ needs.versions.outputs.nimble }}
gc-compat:
name: GC Compatibility
needs: versions
uses: ./.github/workflows/test.yml
with:
test: test_gc_compat
nim-versions: ${{ needs.versions.outputs.nim-versions }}
nimble-version: ${{ needs.versions.outputs.nimble }}
serial:
name: Serial
needs: versions
uses: ./.github/workflows/test.yml
with:
test: test_serial
nim-versions: ${{ needs.versions.outputs.nim-versions }}
nimble-version: ${{ needs.versions.outputs.nimble }}
ctx-validation:
name: Context Validation
needs: versions
uses: ./.github/workflows/test.yml
with:
test: test_ctx_validation
nim-versions: ${{ needs.versions.outputs.nim-versions }}
nimble-version: ${{ needs.versions.outputs.nimble }}
cpp-e2e:
# Codegen output doesn't vary with mm, so we matrix over OS and Nim only.
# Windows runs MSVC by default and may surface codegen tweaks needed in
# the generated CMake (e.g. /EHsc, dllexport) — track follow-ups as bugs
# if they appear. `fail-fast: false` keeps Linux/macOS results visible.
needs: versions
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-15, windows-latest]
nim-version: ${{ fromJSON(needs.versions.outputs.nim-versions) }}
include:
- os: ubuntu-22.04
label: Linux
- os: macos-15
label: macOS
- os: windows-latest
label: Windows
runs-on: ${{ matrix.os }}
name: C++ E2E · ${{ matrix.label }} · Nim ${{ matrix.nim-version }}
env:
NIMBLE_VERSION: ${{ needs.versions.outputs.nimble }}
steps:
- uses: actions/checkout@v4
- name: Setup Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: ${{ matrix.nim-version }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Nimble ${{ env.NIMBLE_VERSION }}
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
export PATH="$GITHUB_WORKSPACE/.nim_runtime/bin:$PATH"
fi
cd /tmp && nimble install "nimble@${{ env.NIMBLE_VERSION }}" -y
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
- name: Cache nimble deps
id: cache-nimbledeps
uses: actions/cache@v4
with:
path: |
nimbledeps/
nimble.paths
key: ${{ runner.os }}-nimbledeps-${{ matrix.nim-version }}-${{ hashFiles('*.nimble') }}
restore-keys: |
${{ runner.os }}-nimbledeps-${{ matrix.nim-version }}-
${{ runner.os }}-nimbledeps-
- name: Install nimble deps
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
export PATH="$GITHUB_WORKSPACE/.nim_runtime/bin:$HOME/.nimble/bin:$PATH"
fi
nimble setup --localdeps -y
- name: Cache CMake FetchContent (GoogleTest)
uses: actions/cache@v4
with:
path: tests/e2e/cpp/build/_deps
key: ${{ runner.os }}-cpp-e2e-deps-${{ hashFiles('tests/e2e/cpp/CMakeLists.txt') }}
- name: Run C++ e2e tests
shell: bash
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
export PATH="$GITHUB_WORKSPACE/.nim_runtime/bin:$HOME/.nimble/bin:$PATH"
fi
nimble test_cpp_e2e -y
check-bindings:
name: Check generated bindings
needs: versions
# Codegen output is platform-independent — single OS is enough. Matrix
# over Nim versions to catch any version-sensitive output. Catches the
# class of drift surfaced in PR #39 (C++ regen committed, Rust
# overlooked); see `nimble check_bindings` in ffi.nimble.
strategy:
fail-fast: false
matrix:
nim-version: ${{ fromJSON(needs.versions.outputs.nim-versions) }}
runs-on: ubuntu-22.04
env:
NIMBLE_VERSION: ${{ needs.versions.outputs.nimble }}
steps:
- uses: actions/checkout@v4
- name: Setup Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: ${{ matrix.nim-version }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Nimble ${{ env.NIMBLE_VERSION }}
run: |
cd /tmp && nimble install "nimble@${{ env.NIMBLE_VERSION }}" -y
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
- name: Cache nimble deps
id: cache-nimbledeps
uses: actions/cache@v4
with:
path: |
nimbledeps/
nimble.paths
key: ${{ runner.os }}-nimbledeps-${{ matrix.nim-version }}-${{ hashFiles('*.nimble') }}
restore-keys: |
${{ runner.os }}-nimbledeps-${{ matrix.nim-version }}-
${{ runner.os }}-nimbledeps-
- name: Install nimble deps
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
run: nimble setup --localdeps -y
- name: Verify checked-in bindings match generator output
run: nimble check_bindings -y
tests-asan-ubsan:
name: Tests · ASan+UBSan+LSan
needs: versions
uses: ./.github/workflows/tests-sanitized.yml
with:
sanitizer: asan-ubsan
nim-versions: ${{ needs.versions.outputs.nim-versions }}
nimble-version: ${{ needs.versions.outputs.nimble }}
tests-tsan:
name: Tests · TSan
needs: versions
uses: ./.github/workflows/tests-sanitized.yml
with:
sanitizer: tsan
nim-versions: ${{ needs.versions.outputs.nim-versions }}
nimble-version: ${{ needs.versions.outputs.nimble }}
auto-assign:
name: Auto-assign PR author
if: github.event_name == 'pull_request' && github.event.action == 'opened'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- run: gh pr edit "$PR" --repo "$REPO" --add-assignee "$AUTHOR"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
PR: ${{ github.event.pull_request.number }}
AUTHOR: ${{ github.event.pull_request.user.login }}