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
name: Rust CI
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
# ── Build & Lint ────────────────────────────────────────────────
build-lint:
name: Build & Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
rustflags: ""
- name: Build
run: cargo build --verbose
- name: Lint
run: |
cargo fmt -- --check
cargo clippy --all-targets --all-features
# ── Test ─────────────────────────────────────────────────────────
test:
name: Test
needs: build-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Unit tests
run: cargo test --verbose -- --test-threads=1
- name: Install ephemeris and Earth-orientation data packages
run: |
pip install --timeout 600 --retries 5 \
naif-de440 \
jpl-small-bodies-de441-n16 \
mpc-obscodes \
naif-eop-high-prec \
naif-eop-historical \
naif-eop-predict
- name: Resolve data paths
run: |
echo "ASSIST_PLANETS_PATH=$(python3 -c 'import naif_de440; print(naif_de440.de440)')" >> $GITHUB_ENV
echo "ASSIST_ASTEROIDS_PATH=$(python3 -c 'import jpl_small_bodies_de441_n16 as sb; print(sb.de441_n16)')" >> $GITHUB_ENV
echo "MPC_OBSCODES_PATH=$(python3 -c 'from mpc_obscodes import mpc_obscodes; print(mpc_obscodes)')" >> $GITHUB_ENV
echo "ASSIST_EOP_HIGH_PREC=$(python3 -c 'import naif_eop_high_prec; print(naif_eop_high_prec.eop_high_prec)')" >> $GITHUB_ENV
echo "ASSIST_EOP_HISTORICAL=$(python3 -c 'import naif_eop_historical; print(naif_eop_historical.eop_historical)')" >> $GITHUB_ENV
echo "ASSIST_EOP_PREDICT=$(python3 -c 'import naif_eop_predict; print(naif_eop_predict.eop_predict)')" >> $GITHUB_ENV
- name: Integration tests
# CC=clang matches the benchmark/recommended build flag set
# (see build.rs comment on `-flto=thin`). GitHub's Ubuntu runners
# ship clang by default; no extra install step needed.
run: CC=clang cargo test --release --verbose -- --test-threads=1
timeout-minutes: 15
# ── Benchmark: Criterion with baseline comparison ───────────────
benchmark:
name: Benchmark
needs: build-lint
runs-on: ubuntu-latest
permissions:
contents: write
deployments: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Install ephemeris data packages
run: pip install --timeout 600 --retries 5 naif-de440 jpl-small-bodies-de441-n16
- name: Resolve ephemeris paths
run: |
echo "ASSIST_PLANETS_PATH=$(python3 -c 'import naif_de440; print(naif_de440.de440)')" >> $GITHUB_ENV
echo "ASSIST_ASTEROIDS_PATH=$(python3 -c 'import jpl_small_bodies_de441_n16 as sb; print(sb.de441_n16)')" >> $GITHUB_ENV
- name: Run benchmarks
# CC=clang enables LLVM ThinLTO in the vendored REBOUND+ASSIST C
# static libs (see build.rs), which yields ~6-7% faster integration
# than the default GCC build. Run the canonical benchmark numbers
# (gh-pages history) against the optimized build.
run: CC=clang cargo bench --bench propagation -- --output-format bencher 2>&1 | tee benchmark-output.txt
env:
CARGO_TERM_COLOR: never
timeout-minutes: 30
- name: Compare benchmarks
uses: benchmark-action/github-action-benchmark@v1
with:
name: assist-rs Benchmarks
tool: cargo
output-file-path: benchmark-output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: ${{ github.ref == 'refs/heads/main' }}
comment-on-alert: true
summary-always: true
comment-always: true
alert-threshold: "200%"
fail-on-alert: false