-
Notifications
You must be signed in to change notification settings - Fork 1
201 lines (172 loc) · 6 KB
/
Copy pathci.yml
File metadata and controls
201 lines (172 loc) · 6 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
#
# ISC License
#
# Copyright (c) 2026, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
name: CI
on:
pull_request:
push:
branches: [master, develop]
workflow_dispatch:
inputs:
bsk_version:
description: "Override BSK version (e.g. 2.10.2rc1). Defaults to _bsk_version.txt."
required: false
default: ""
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build (${{ matrix.os }}, ${{ matrix.python_label }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.9", "3.14"]
include:
- python: "3.9"
python_label: "MIN Python"
- python: "3.14"
python_label: "MAX Python"
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Resolve BSK version
id: bsk
shell: bash
run: |
OVERRIDE="${{ inputs.bsk_version }}"
if [[ -n "$OVERRIDE" ]]; then
echo "version=${OVERRIDE}" >> "$GITHUB_OUTPUT"
else
echo "version=$(tr -d '[:space:]' < src/bsk_sdk/_bsk_version.txt)" >> "$GITHUB_OUTPUT"
fi
- uses: ./.github/actions/setup-bsk
with:
version: ${{ steps.bsk.outputs.version }}
clone-source: "true"
install-package: "false"
- name: Report environment
shell: bash
run: |
python --version
echo "BSK source: $(git -C external/basilisk log -1 --oneline)"
- name: Sync artifacts
run: python tools/sync_all.py
- name: Build wheel
shell: bash
run: |
pip install build
python -m build --wheel -o dist
env:
BSK_SDK_AUTO_SYNC: "0"
- uses: actions/upload-artifact@v6
with:
name: wheel-${{ matrix.os }}-py${{ matrix.python }}
path: dist/*.whl
retention-days: 1
test:
name: Test wheel (${{ matrix.os }}, ${{ matrix.python_label }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.9", "3.14"]
include:
- python: "3.9"
python_label: "MIN Python"
- python: "3.14"
python_label: "MAX Python"
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: tests
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v7
with:
name: wheel-${{ matrix.os }}-py${{ matrix.python }}
path: dist
- name: Install wheel and test dependencies
shell: bash
run: pip install dist/*.whl pytest
- name: Run smoke tests
run: pytest tests/test_smoke.py -v
examples:
name: Build example plugin (${{ matrix.os }}, ${{ matrix.python_label }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.9", "3.14"]
include:
- python: "3.9"
python_label: "MIN Python"
- python: "3.14"
python_label: "MAX Python"
steps:
- uses: actions/checkout@v5
with:
sparse-checkout: |
.github/actions
examples
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v7
with:
name: wheel-${{ matrix.os }}-py${{ matrix.python }}
path: dist
- name: Install SDK wheel and read BSK version
id: bsk
shell: bash
run: |
pip install dist/*.whl --force-reinstall
echo "version=$(python -c "import bsk_sdk; print(bsk_sdk.bsk_version(), end='')")" >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/setup-bsk
with:
version: ${{ steps.bsk.outputs.version }}
clone-source: "false"
install-package: "true"
- name: Report environment
shell: bash
run: pip show bsk swig | grep -E "^(Name|Version):" && python -c "import bsk_sdk; print('bsk-sdk:', bsk_sdk.__version__, '| synced from BSK:', bsk_sdk.bsk_version())"
- name: Build example plugin wheel
# --no-isolation so the build inherits the locally installed bsk-sdk wheel,
# guaranteeing CI always tests the current branch rather than a stale PyPI version.
shell: bash
run: |
pip install build scikit-build-core
python -m build --wheel --no-isolation -o plugin-dist examples/custom-atm-plugin
- uses: actions/upload-artifact@v6
with:
name: plugin-wheel-${{ matrix.os }}-py${{ matrix.python }}
path: plugin-dist/*.whl
retention-days: 7
- name: Install plugin wheel and test dependencies
shell: bash
run: pip install plugin-dist/*.whl pytest
- name: Run example plugin tests
run: pytest examples/custom-atm-plugin/customExponentialAtmosphere/_UnitTest/test_customExponentialAtmosphere.py -v