Repository navigation
73 lines (69 loc) · 3.3 KB
/
Copy pathci.yml
File metadata and controls
73 lines (69 loc) · 3.3 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
name: Galaxy checks
on:
push:
pull_request:
permissions:
contents: read
concurrency:
group: galaxy-checks-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Check Rust sampler
run: cargo test --manifest-path rust/Cargo.toml --locked --offline
- name: Verify shared retro deterministic vectors
run: |
node tests/retro-math.mjs
cargo test --manifest-path retro/Cargo.toml --locked --offline
cargo run --manifest-path retro/Cargo.toml --example retro_vectors --locked --offline
- name: Rebuild the pinned Rust WebAssembly
run: bash scripts/build-wasm.sh
- name: Verify the shipped module matches its source
run: git diff --exit-code -- wasm/ data/uff-demo.js rust/src/uff_data.rs
- name: Check sampling, motion, settings and application integration
run: |
node tests/smoke.mjs
node tests/physics.mjs
node tests/app.mjs
- name: Check Barnes-Hut self-gravity reference
run: |
node tests/barnes-hut.mjs
node tests/nbody-view.mjs
cargo test --manifest-path nbody/Cargo.toml --locked --offline
cargo run --manifest-path nbody/Cargo.toml --locked --offline -- verify
cargo run --manifest-path nbody/Cargo.toml --locked --offline -- verify-flat
flat_root="$RUNNER_TEMP/galaxy-bh-flat/nested"
rm -rf "$RUNNER_TEMP/galaxy-bh-flat"
cargo run --manifest-path nbody/Cargo.toml --locked --offline -- \
flat-probe --preset disc --particles 512 --theta 0.5 --seed 303 \
--receipt "$flat_root/receipt.json" \
> "$RUNNER_TEMP/galaxy-bh-flat-stdout.json"
test -s "$flat_root/receipt.json"
node - <<'NODE' "$flat_root/receipt.json"
const fs = require("fs");
const path = process.argv[2];
const receipt = JSON.parse(fs.readFileSync(path, "utf8"));
if (receipt.schema !== "galaxy.barnes-hut-flat-receipt.v1") throw new Error("wrong flat receipt schema");
if (receipt.backend !== "cpu-flat-reference") throw new Error("wrong flat backend");
if (receipt.morton_axis_bits !== 16) throw new Error("wrong Morton width");
if (!(receipt.tree_cells > 0 && receipt.tree_leaves > 0)) throw new Error("missing flat tree evidence");
if (!(receipt.build_seconds >= 0 && receipt.traversal_seconds >= 0)) throw new Error("missing split timings");
NODE
artifact_root="$RUNNER_TEMP/galaxy-bh/nested"
rm -rf "$RUNNER_TEMP/galaxy-bh"
cargo run --manifest-path nbody/Cargo.toml --locked --offline -- \
run --preset disc --particles 32 --steps 2 --theta 0.5 \
--receipt "$artifact_root/receipt.json" \
--snapshot "$artifact_root/final.csv" \
> "$RUNNER_TEMP/galaxy-bh-stdout.json"
test -s "$artifact_root/receipt.json"
test -s "$artifact_root/final.csv"
node -e 'JSON.parse(require("fs").readFileSync(process.argv[1], "utf8"))' "$artifact_root/receipt.json"
- name: Verify static distribution
run: node scripts/build-site.mjs