Skip to content

Commit fac66c9

Browse files
committed
add a simple contract test for codes in GHA
Just a minimal build for now without all the various dependencies. We can add a full build in the future.
1 parent a7f15a7 commit fac66c9

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CODES contract test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
10+
# Builds CODES against a freshly-installed ROSS and runs CODES's test suite.
11+
# Catches consumer-API regressions (header layout, pkg-config, library name)
12+
# that ROSS's own test suite can't see by construction. Minimal CODES build —
13+
# SWM, UNION, DUMPI, TORCH are all left off so we don't drag in argobots /
14+
# conceptual / python2 / etc.
15+
#
16+
# CODES is pinned to a specific master SHA so external repo churn doesn't
17+
# break ROSS CI. Bump CODES_REF when CODES advances and we want to validate
18+
# against the newer ref — that's a separate, explicit ROSS-side change.
19+
20+
jobs:
21+
codes-contract:
22+
runs-on: ubuntu-24.04
23+
env:
24+
# codes-org/codes@master as of 2026-05-26
25+
CODES_REF: 4a055c23be3dd400c7f77c08ca2702b766b763bf
26+
steps:
27+
- name: Checkout ROSS
28+
uses: actions/checkout@v4
29+
with:
30+
path: ross
31+
32+
- name: Checkout CODES (pinned)
33+
uses: actions/checkout@v4
34+
with:
35+
repository: codes-org/codes
36+
ref: ${{ env.CODES_REF }}
37+
path: codes
38+
39+
- name: Install MPICH
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install -y mpich libmpich-dev pkg-config
43+
44+
- name: Configure ROSS
45+
run: cmake -S ross -B ross/build -DROSS_BUILD_MODELS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/ross-install
46+
47+
- name: Build ROSS
48+
run: cmake --build ross/build -j
49+
50+
- name: Install ROSS
51+
run: cmake --install ross/build
52+
53+
- name: Configure CODES against installed ROSS
54+
run: cmake -S codes -B codes/build -DROSS_PKG_CONFIG_PATH=$PWD/ross-install/lib/pkgconfig -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DUSE_TORCH=false
55+
56+
- name: Build CODES
57+
run: cmake --build codes/build -j
58+
59+
- name: Run CODES tests
60+
run: ctest --test-dir codes/build --output-on-failure
61+
62+
- name: Upload logs on failure
63+
if: failure()
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: codes-contract-logs
67+
path: |
68+
codes/build/Testing/Temporary/LastTest.log
69+
codes/build/Testing/Temporary/LastTestsFailed.log
70+
codes/build/CMakeFiles/CMakeError.log
71+
codes/build/CMakeFiles/CMakeOutput.log
72+
codes/build/CMakeCache.txt
73+
ross/build/CMakeFiles/CMakeError.log
74+
ross/build/CMakeFiles/CMakeOutput.log
75+
ross/build/CMakeCache.txt
76+
if-no-files-found: ignore
77+
retention-days: 14

0 commit comments

Comments
 (0)