Repository navigation
280 lines (235 loc) · 11.2 KB
/
Copy pathci.yml
File metadata and controls
280 lines (235 loc) · 11.2 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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# Multi-platform build & test workflow.
# Ensures BCSV compiles with zero warnings and all tests pass on:
# Linux (GCC + Clang), Windows (MSVC), macOS (Apple Clang)
# Also covers the Python bindings and the cross-package version stamps.
#
# ON-DEMAND ONLY: this workflow runs on manual dispatch and on a weekly
# schedule — never on push or pull_request. Routine commit/push/sync cycles
# between machines must not burn runners. Trigger it manually whenever a
# second opinion is wanted (e.g. confirm the Windows and macOS builds from a
# Linux development kit: Actions → CI → Run workflow); the weekly schedule
# keeps master honest. Release correctness does NOT depend on any trigger
# here: the Release Ship hub (release-publish.yml) refuses to publish unless
# every packager tag run — which builds and tests Linux, Windows and macOS
# on its own — has concluded green first.
name: CI
on:
schedule:
- cron: '0 3 * * 1' # Weekly Monday 3 AM UTC — Release builds
workflow_dispatch:
permissions:
contents: read
jobs:
# Cheap guard that runs on every CI run: the committed manifests are
# patched from VERSION.txt only at pack time, so nothing else notices when
# they drift. unity/package.json sat at 1.5.3 for nine releases before this.
# On a tag the Release hub re-checks this before publishing anything.
version-consistency:
name: Version consistency
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
- name: Check every version stamp against VERSION.txt
run: python3 scripts/check_versions.py
# The NuGet and Unity C# bindings are the same code in two namespaces and
# cannot be merged into one source: NuGet publishes `namespace Bcsv;` and
# Unity's asmdef publishes `namespace BCSV`, so unifying them would break
# every consumer of the published package. This notices when the two copies
# stop agreeing — which they had, in five places, before the check existed.
csharp-binding-parity:
name: C# binding parity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Compare the NuGet and Unity bindings
run: python3 scripts/check_csharp_parity.py --verbose
# ────────────────────────────────────────────────────────────────
# pybcsv — every CI run
#
# python/tests/ is NOT registered with ctest (only tests/integration/*.py
# is), so without this job the entire Python suite -- including the Parquet
# transcoders -- ran only in the tag-driven publish workflow. A regression
# then landed on master and surfaced mid-release. See VERSIONING.md on
# lock step: the channel that changes most often needs a per-PR gate.
# ────────────────────────────────────────────────────────────────
pybcsv:
name: pybcsv (Python bindings + tests)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
# setuptools-scm derives the wheel version from tags; a shallow
# clone hides them (see VERSIONING.md, Troubleshooting).
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.12'
- name: Install build and test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pandas numpy pyarrow polars
- name: Build and install pybcsv
run: python -m pip install ./python -v
- name: Run the pybcsv test suite
run: python -m pytest python/tests/ -v --tb=short
# ────────────────────────────────────────────────────────────────
# Debug builds — every CI run (manual dispatch / weekly schedule)
# ────────────────────────────────────────────────────────────────
build:
strategy:
fail-fast: false
matrix:
include:
- name: Linux GCC
os: ubuntu-latest
compiler: gcc
configure-preset: ninja-debug
build-preset: ninja-debug-build
build-dir: build/ninja-debug
- name: Linux Clang
os: ubuntu-latest
compiler: clang
configure-preset: clang-debug
build-preset: clang-debug-build
build-dir: build/clang-debug
# Ninja rather than the "Visual Studio 17 2022" generator presets:
# windows-latest no longer ships VS 2022, so those presets fail at
# configure with "could not find any instance of Visual Studio".
# setup-msvc-dev (below) puts cl.exe on PATH, which is all Ninja needs,
# and this stops CI depending on a specific VS major version.
# These presets are single-config, so no cmake-config is required.
- name: Windows MSVC
os: windows-latest
compiler: msvc
configure-preset: ninja-msvc-debug
build-preset: ninja-msvc-debug-build
build-dir: build/ninja-msvc-debug
- name: macOS Apple Clang
os: macos-latest
compiler: apple-clang
configure-preset: ninja-debug
build-preset: ninja-debug-build
build-dir: build/ninja-debug
runs-on: ${{ matrix.os }}
timeout-minutes: 30
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Install Ninja (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update -q && sudo apt-get install -y -q ninja-build
- name: Install Clang (Linux)
if: matrix.compiler == 'clang'
run: sudo apt-get install -y -q clang
- name: Install Ninja (macOS)
if: runner.os == 'macOS'
run: brew install ninja
# The Windows matrix entries use the Ninja MSVC presets (see the note
# there). Ninja ships with some runner images and not others, so install
# it rather than depend on the image.
- name: Install Ninja (Windows)
if: runner.os == 'Windows'
run: choco install ninja -y --no-progress
- name: Setup MSVC
if: matrix.compiler == 'msvc'
uses: TheMrMilchmann/setup-msvc-dev@368ef7d1ee4d1171b31d4a7f67f4d954f903f5a9 # v4
with:
arch: x64
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.12'
- name: Cache CMake dependencies
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ${{ matrix.build-dir }}/_deps
key: deps-${{ matrix.os }}-${{ matrix.compiler }}-${{ hashFiles('**/**/CMakeLists.txt') }}
- name: Configure
run: cmake --preset ${{ matrix.configure-preset }} -DPython3_ROOT_DIR="${{ env.pythonLocation }}"
- name: Build
run: cmake --build --preset ${{ matrix.build-preset }} --parallel
- name: Install pytest
run: python -m pip install pytest
# Every matrix entry is a single-config Ninja preset, so no -C.
- name: Test
run: ctest --test-dir ${{ matrix.build-dir }} --output-on-failure
# ────────────────────────────────────────────────────────────────
# Release builds — weekly schedule + manual dispatch
# ────────────────────────────────────────────────────────────────
release-build:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
include:
- name: Linux GCC (Release)
os: ubuntu-latest
compiler: gcc
configure-preset: ninja-release
build-preset: ninja-release-build
build-dir: build/ninja-release
- name: Linux Clang (Release)
os: ubuntu-latest
compiler: clang
configure-preset: clang-release
build-preset: clang-release-build
build-dir: build/clang-release
# See the Windows MSVC note in the debug matrix above.
- name: Windows MSVC (Release)
os: windows-latest
compiler: msvc
configure-preset: ninja-msvc-release
build-preset: ninja-msvc-release-build
build-dir: build/ninja-msvc-release
- name: macOS Apple Clang (Release)
os: macos-latest
compiler: apple-clang
configure-preset: ninja-release
build-preset: ninja-release-build
build-dir: build/ninja-release
runs-on: ${{ matrix.os }}
timeout-minutes: 30
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Install Ninja (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update -q && sudo apt-get install -y -q ninja-build
- name: Install Clang (Linux)
if: matrix.compiler == 'clang'
run: sudo apt-get install -y -q clang
- name: Install Ninja (macOS)
if: runner.os == 'macOS'
run: brew install ninja
# The Windows matrix entries use the Ninja MSVC presets (see the note
# there). Ninja ships with some runner images and not others, so install
# it rather than depend on the image.
- name: Install Ninja (Windows)
if: runner.os == 'Windows'
run: choco install ninja -y --no-progress
- name: Setup MSVC
if: matrix.compiler == 'msvc'
uses: TheMrMilchmann/setup-msvc-dev@368ef7d1ee4d1171b31d4a7f67f4d954f903f5a9 # v4
with:
arch: x64
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.12'
- name: Cache CMake dependencies
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ${{ matrix.build-dir }}/_deps
key: deps-${{ matrix.os }}-${{ matrix.compiler }}-release-${{ hashFiles('**/**/CMakeLists.txt') }}
- name: Configure
run: cmake --preset ${{ matrix.configure-preset }} -DPython3_ROOT_DIR="${{ env.pythonLocation }}"
- name: Build
run: cmake --build --preset ${{ matrix.build-preset }} --parallel
- name: Install pytest
run: python -m pip install pytest
# Every matrix entry is a single-config Ninja preset, so no -C.
- name: Test
run: ctest --test-dir ${{ matrix.build-dir }} --output-on-failure