Repository navigation
236 lines (227 loc) · 9.64 KB
/
Copy pathpull-request.yml
File metadata and controls
236 lines (227 loc) · 9.64 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
name: "Pull Request"
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# One full job per platform publishes Conan dependencies. Other jobs restore only.
pre-commit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/pre-commit
clang-format:
name: C/C++ formatting
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Select formatting scope
id: formatting-scope
env:
EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
shell: bash
run: |
if [[ "$EVENT_NAME" == "pull_request" ]] && git diff --quiet "$BASE_SHA...$HEAD_SHA" -- \
.clang-format .pre-commit-config.yaml ':(glob)**/.clang-format'; then
echo "args=--from-ref $BASE_SHA --to-ref $HEAD_SHA" >> "$GITHUB_OUTPUT"
else
echo "args=--all-files" >> "$GITHUB_OUTPUT"
fi
- uses: pre-commit/action@v3.0.1
with:
extra_args: clang-format ${{ steps.formatting-scope.outputs.args }} --show-diff-on-failure
build-linux:
runs-on: ubuntu-24.04
timeout-minutes: 90
needs: [pre-commit, clang-format]
name: Linux (MAX Python)
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/data-cache
- name: Set up current stable Rust
run: |
rustup toolchain install stable --profile minimal --component clippy
rustup default stable
rustc --version
cargo --version
# Pull-request CI exercises Rust modules through Corrosion on Linux,
# Windows, and macOS.
- uses: ./.github/actions/build
with:
python-version: 3.14
conan-args: --opNav True --mujoco True --rustModules True
save-conan-cache: true
- name: Verify Corrosion configuration
shell: bash
run: |
grep -F "BUILD_RUST_MODULES:BOOL=ON" dist3/CMakeCache.txt
python -c "from Basilisk import getBuildInfo; assert getBuildInfo()['diagnostics']['tools']['corrosion']"
- name: Test incremental build dependencies
run: python .github/scripts/test_incremental_build.py --build-dir dist3
- name: Test Rust workspace
run: |
cargo test --workspace --all-features --locked --manifest-path src/Cargo.toml
cargo test -p bsk-build --no-default-features --locked --manifest-path src/Cargo.toml
- name: Test minimum supported Rust version
run: |
rustup toolchain install 1.89.0 --profile minimal
cargo +1.89.0 test --workspace --all-features --locked --manifest-path src/Cargo.toml
- name: Lint Rust workspace
run: cargo clippy --workspace --all-targets --all-features --locked --manifest-path src/Cargo.toml -- -D warnings
- name: Check Rust unwind policy
run: python3 .github/scripts/check_rust_unwind_policy.py
- name: Check committed Rust utility bindings are up to date
run: |
sudo apt-get update && sudo apt-get install -y libclang-dev
cargo install bindgen-cli --version '=0.72.1' --locked
python3 src/architecture/rust/gen_rust_utilities.py
if ! git diff --exit-code -- src/architecture/rust/bsk_utilities/src/raw.rs; then
echo "::error::src/architecture/rust/bsk_utilities/src/raw.rs is stale (it does not match the utility headers in this PR). Regenerate it locally and commit the result."
exit 1
fi
- name: Check committed Rust third-party licenses are up to date
run: |
cargo fetch --locked --manifest-path src/Cargo.toml
cargo install cargo-about --version '=0.9.1' --locked --features cli
python3 src/architecture/rust/generate_rust_licenses.py --check --require-tool
- name: Pytest
working-directory: src
run: |
pip install pytest-error-for-skips pytest-timeout
pytest -n auto -m "not ciSkip" -rs --error-for-skips --timeout=300 --timeout-method=thread --durations=25 -v
- name: Build integration tests
working-directory: src
run: >-
pytest -n 2 -m buildIntegration --error-for-skips --timeout=300 --timeout-method=thread --durations=10 -v
tests/test_fswBindingLayout.py tests/test_incremental_build_checks.py tests/test_cmake_message_cleanup.py
- name: CTest
if: ${{ always() && hashFiles('dist3/CTestTestfile.cmake') != '' }}
working-directory: dist3
run: ctest --output-on-failure
build-windows:
runs-on: windows-2025-vs2026
timeout-minutes: 105
needs: [pre-commit, clang-format]
name: Windows (MAX Python)
env:
MPLBACKEND: agg
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/data-cache
- uses: ./.github/actions/build
with:
python-version: 3.14
conan-args: --opNav True --mujoco True --rustModules True
save-conan-cache: true
- name: Verify Corrosion configuration
shell: bash
run: |
grep -F "BUILD_RUST_MODULES:BOOL=ON" dist3/CMakeCache.txt
python -c "from Basilisk import getBuildInfo; assert getBuildInfo()['diagnostics']['tools']['corrosion']"
- name: Pytest
shell: pwsh
working-directory: src
run: |
pip install pytest-error-for-skips pytest-timeout
pytest -n auto -m "not ciSkip" -rs --error-for-skips --timeout=300 --timeout-method=thread --durations=25 -v
if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) {exit 1}
- name: Build integration tests
shell: pwsh
working-directory: src
run: |
pytest -n 2 -m buildIntegration --error-for-skips --timeout=300 --timeout-method=thread --durations=10 -v tests/test_fswBindingLayout.py tests/test_incremental_build_checks.py tests/test_cmake_message_cleanup.py
if ($LastExitCode -ne 0) { exit $LastExitCode }
- name: CTest
if: ${{ always() && hashFiles('dist3/CTestTestfile.cmake') != '' }}
shell: pwsh
working-directory: dist3
run: |
ctest --output-on-failure
if(($LastExitCode -ne 0) -and ($LastExitCode -ne 5)) { exit 1 }
- name: Test Rust workspace
shell: pwsh
run: |
if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) {
Invoke-WebRequest https://win.rustup.rs/x86_64 -OutFile rustup-init.exe
.\rustup-init.exe -y --profile minimal --default-toolchain stable
$env:Path = "$env:USERPROFILE\.cargo\bin;$env:Path"
}
cargo test --workspace --all-features --locked --manifest-path src/Cargo.toml
if ($LastExitCode -ne 0) { exit $LastExitCode }
cargo test -p bsk-build --no-default-features --locked --manifest-path src/Cargo.toml
if ($LastExitCode -ne 0) { exit $LastExitCode }
build-macos:
runs-on: macos-26
timeout-minutes: 90
needs: [pre-commit, clang-format]
strategy:
fail-fast: false
matrix:
job_suffix: [""]
python_label: ["MIN Python"]
python: ["3.9"]
pytest_flags:
[
'-n auto -m "not ciSkip" -rs --error-for-skips --timeout=300 --timeout-method=thread --durations=25 -v',
]
conan_args:
[
"--opNav True --mujoco True --rustModules True",
]
include:
# An extra plain Basilisk build without optional opNav, MuJoCo, or visualization support
- python: "3.14"
python_label: "MAX Python"
pytest_flags: -n auto -m "not ciSkip" -rs --timeout=300 --timeout-method=thread --durations=25 -v
conan_args: --opNav False --mujoco False --vizInterface False
job_suffix: "--vizInterface False"
name: macOS (${{ matrix.python_label }}) ${{ matrix.job_suffix }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/data-cache
- uses: ./.github/actions/build
with:
python-version: ${{ matrix.python }}
conan-args: ${{ matrix.conan_args }}
- name: Verify Corrosion configuration
if: ${{ contains(matrix.conan_args, '--rustModules True') }}
shell: bash
run: |
grep -F "BUILD_RUST_MODULES:BOOL=ON" dist3/CMakeCache.txt
python -c "from Basilisk import getBuildInfo; assert getBuildInfo()['diagnostics']['tools']['corrosion']"
- name: Pytest
working-directory: src
run: |
pip install pytest-error-for-skips pytest-timeout
pytest ${{ matrix.pytest_flags }}
- name: Build integration tests
working-directory: src
run: >-
pytest -n 2 -m buildIntegration --error-for-skips --timeout=300 --timeout-method=thread --durations=10 -v
tests/test_fswBindingLayout.py tests/test_incremental_build_checks.py tests/test_cmake_message_cleanup.py
- name: CTest
if: ${{ always() && hashFiles('dist3/CTestTestfile.cmake') != '' }}
working-directory: dist3
run: ctest -C Release --output-on-failure
docs:
runs-on: macos-26
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/data-cache
- name: Build Basilisk
uses: ./.github/actions/build
with:
python-version: 3.14
conan-args: --opNav True --mujoco True --rustModules True
save-conan-cache: true
- name: Build docs
uses: ./.github/actions/docs