@@ -43,16 +43,28 @@ jobs:
4343 name : Clippy
4444 if : " !startsWith(github.event.head_commit.message, 'chore: release v')"
4545 runs-on : ubuntu-latest
46- timeout-minutes : 15
46+ timeout-minutes : 20
4747 steps :
4848 - uses : actions/checkout@v4
49+
50+ - name : Install LLVM 17
51+ run : |
52+ curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
53+ echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-17 main" | sudo tee /etc/apt/sources.list.d/llvm.list
54+ sudo apt-get update
55+ sudo apt-get install -y --no-install-recommends llvm-17 llvm-17-dev libpolly-17-dev clang-17 lld-17
56+ env :
57+ DEBIAN_FRONTEND : noninteractive
58+
4959 - uses : dtolnay/rust-toolchain@stable
5060 with :
5161 components : clippy
5262 - uses : Swatinem/rust-cache@v2
5363 with :
5464 key : clippy
55- - run : cargo clippy --workspace --exclude ori_llvm --all-targets -- -D warnings
65+ - run : cargo clippy --workspace --all-targets -- -D warnings
66+ env :
67+ LLVM_SYS_170_PREFIX : /usr/lib/llvm-17
5668
5769 # Main test suite
5870 test :
@@ -62,25 +74,39 @@ jobs:
6274 timeout-minutes : 30
6375 steps :
6476 - uses : actions/checkout@v4
77+
78+ - name : Install LLVM 17
79+ run : |
80+ curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
81+ echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-17 main" | sudo tee /etc/apt/sources.list.d/llvm.list
82+ sudo apt-get update
83+ sudo apt-get install -y --no-install-recommends llvm-17 llvm-17-dev libpolly-17-dev clang-17 lld-17
84+ env :
85+ DEBIAN_FRONTEND : noninteractive
86+
6587 - uses : dtolnay/rust-toolchain@stable
6688 - uses : Swatinem/rust-cache@v2
6789 with :
6890 key : test
6991
7092 - name : Build
71- run : cargo build --workspace --exclude ori_llvm
93+ run : cargo build --workspace
94+ env :
95+ LLVM_SYS_170_PREFIX : /usr/lib/llvm-17
7296
7397 - name : Rust unit tests
7498 id : rust-tests
7599 continue-on-error : true
76100 run : |
77101 set -o pipefail
78- cargo test --workspace --exclude ori_llvm 2>&1 | tee rust-test-output.txt
102+ cargo test --workspace 2>&1 | tee rust-test-output.txt
79103 # Sum all "X passed" counts from "test result:" lines
80104 RUST_TESTS=$(grep -oE '[0-9]+ passed' rust-test-output.txt | grep -oE '^[0-9]+' | awk '{sum+=$1} END {print sum+0}')
81105 RUST_FAILED=$(grep -oE '[0-9]+ failed' rust-test-output.txt | grep -oE '^[0-9]+' | awk '{sum+=$1} END {print sum+0}')
82106 echo "RUST_TESTS=$RUST_TESTS" >> $GITHUB_ENV
83107 echo "RUST_FAILED=$RUST_FAILED" >> $GITHUB_ENV
108+ env :
109+ LLVM_SYS_170_PREFIX : /usr/lib/llvm-17
84110
85111 - name : Ori language tests
86112 id : ori-tests
93119 ORI_FAILED=$(grep -oE '[0-9]+ failed' ori-test-output.txt | grep -oE '^[0-9]+' | tail -1 || echo "0")
94120 echo "ORI_TESTS=$ORI_TESTS" >> $GITHUB_ENV
95121 echo "ORI_FAILED=$ORI_FAILED" >> $GITHUB_ENV
122+ env :
123+ LLVM_SYS_170_PREFIX : /usr/lib/llvm-17
96124
97125 - name : Ori runtime tests
98126 id : rt-tests
@@ -163,104 +191,48 @@ jobs:
163191 name : ${{ matrix.os }}
164192 needs : [format, clippy] # Don't waste CI time if basics fail
165193 runs-on : ${{ matrix.os }}
166- timeout-minutes : 20
194+ timeout-minutes : 7
167195 strategy :
168196 fail-fast : false
169197 matrix :
170198 os : [macos-latest, windows-latest]
171199 steps :
172200 - uses : actions/checkout@v4
173- - uses : dtolnay/rust-toolchain@stable
174- - uses : Swatinem/rust-cache@v2
175- with :
176- key : ${{ matrix.os }}
177-
178- - name : Build
179- run : cargo build --workspace --exclude ori_llvm
180-
181- - name : Rust unit tests
182- run : cargo test --workspace --exclude ori_llvm
183201
184- - name : Ori language tests
185- run : cargo run -p oric --bin ori -- test tests/
186-
187- # LLVM backend - not in ci-success `needs`, so failures show red but don't block merges
188- llvm :
189- name : LLVM Backend
190- if : " !startsWith(github.event.head_commit.message, 'chore: release v')"
191- runs-on : ubuntu-latest
192- timeout-minutes : 30
193- steps :
194- - uses : actions/checkout@v4
202+ - name : Install LLVM 17 (macOS)
203+ if : runner.os == 'macOS'
204+ run : |
205+ brew install llvm@17
206+ echo "LLVM_SYS_170_PREFIX=$(brew --prefix llvm@17)" >> $GITHUB_ENV
195207
196- - name : Install LLVM 17
208+ - name : Install LLVM 17 (Windows)
209+ if : runner.os == 'Windows'
197210 run : |
198- curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
199- echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-17 main" | sudo tee /etc/apt/sources.list.d/llvm.list
200- sudo apt-get update
201- sudo apt-get install -y --no-install-recommends llvm-17 llvm-17-dev libpolly-17-dev clang-17 lld-17
202- env :
203- DEBIAN_FRONTEND : noninteractive
211+ $LLVM_URL = "https://github.com/upstat-io/llvm-package-windows/releases/download/v17.0.6/LLVM-17.0.6-win64.7z"
212+ Write-Host "Downloading LLVM from $LLVM_URL"
213+ curl.exe -fLO $LLVM_URL
214+ Write-Host "Extracting LLVM to C:\LLVM..."
215+ 7z x LLVM-17.0.6-win64.7z -oC:\LLVM
216+ echo "LLVM_SYS_170_PREFIX=C:\LLVM" >> $env:GITHUB_ENV
217+ echo "C:\LLVM\bin" >> $env:GITHUB_PATH
218+
219+ - name : Set up MSVC environment (Windows)
220+ if : runner.os == 'Windows'
221+ uses : ilammy/msvc-dev-cmd@v1
204222
205223 - uses : dtolnay/rust-toolchain@stable
206- with :
207- components : clippy
208-
209224 - uses : Swatinem/rust-cache@v2
210225 with :
211- key : llvm
212-
213- - name : LLVM clippy
214- run : cargo clippy -p ori_llvm --all-targets -- -D warnings
215- env :
216- LLVM_SYS_170_PREFIX : /usr/lib/llvm-17
217-
218- - name : LLVM tests
219- id : llvm-tests
220- continue-on-error : true
221- run : |
222- set -o pipefail
223- cargo build -p oric -p ori_rt --features llvm -q
224- cargo test -p ori_rt 2>&1 | tee rt-llvm-output.txt
225- cargo test -p ori_llvm 2>&1 | tee llvm-test-output.txt
226- # Sum all "X passed" counts from test output
227- LLVM_TESTS=$(cat rt-llvm-output.txt llvm-test-output.txt | grep -oE '[0-9]+ passed' | grep -oE '^[0-9]+' | awk '{sum+=$1} END {print sum+0}')
228- LLVM_FAILED=$(cat rt-llvm-output.txt llvm-test-output.txt | grep -oE '[0-9]+ failed' | grep -oE '^[0-9]+' | awk '{sum+=$1} END {print sum+0}')
229- echo "LLVM_TESTS=$LLVM_TESTS" >> $GITHUB_ENV
230- echo "LLVM_FAILED=$LLVM_FAILED" >> $GITHUB_ENV
231- env :
232- LLVM_SYS_170_PREFIX : /usr/lib/llvm-17
226+ key : ${{ matrix.os }}
233227
234- - name : Save LLVM test results
235- if : always()
236- run : |
237- LLVM_P=${LLVM_TESTS:-0}
238- LLVM_F=${LLVM_FAILED:-0}
239- OVERALL="passed"
240- if [ "$LLVM_F" -gt 0 ]; then OVERALL="failed"; fi
241- cat > llvm-test-results.json << EOF
242- {
243- "timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
244- "overall": "$OVERALL",
245- "suites": [
246- { "name": "Rust unit tests (ori_llvm)", "passed": $LLVM_P, "failed": $LLVM_F, "skipped": 0, "lcfail": null }
247- ],
248- "totals": { "passed": $LLVM_P, "failed": $LLVM_F, "skipped": 0, "lcfail": 0 }
249- }
250- EOF
251- cat llvm-test-results.json
228+ - name : Build (all crates incl. LLVM)
229+ run : cargo build --workspace
252230
253- - name : Upload LLVM test results
254- if : always()
255- uses : actions/upload-artifact@v4
256- with :
257- name : llvm-test-results
258- path : llvm-test-results.json
259- retention-days : 90
231+ - name : Rust unit tests (excl. LLVM AOT — tested on Linux)
232+ run : cargo test --workspace --exclude ori_llvm
260233
261- - name : Fail if LLVM tests failed
262- if : steps.llvm-tests.outcome == 'failure'
263- run : exit 1
234+ - name : Ori language tests
235+ run : cargo run -p oric --bin ori -- test tests/
264236
265237 # Single status check for branch protection
266238 ci-success :
0 commit comments