|
75 | 75 | id: rust-tests |
76 | 76 | continue-on-error: true |
77 | 77 | run: | |
| 78 | + set -o pipefail |
78 | 79 | cargo test --workspace 2>&1 | tee rust-test-output.txt |
79 | 80 | # Sum all "X passed" counts from "test result:" lines |
80 | 81 | RUST_TESTS=$(grep -oE '[0-9]+ passed' rust-test-output.txt | grep -oE '^[0-9]+' | awk '{sum+=$1} END {print sum+0}') |
|
86 | 87 | id: ori-tests |
87 | 88 | continue-on-error: true |
88 | 89 | run: | |
| 90 | + set -o pipefail |
89 | 91 | cargo run -p oric --bin ori -- test tests/ 2>&1 | tee ori-test-output.txt |
90 | 92 | # Extract from "1677 passed, 0 failed" format |
91 | 93 | ORI_TESTS=$(grep -oE '[0-9]+ passed' ori-test-output.txt | grep -oE '^[0-9]+' | tail -1 || echo "0") |
|
97 | 99 | id: rt-tests |
98 | 100 | continue-on-error: true |
99 | 101 | run: | |
| 102 | + set -o pipefail |
100 | 103 | cargo test --manifest-path compiler/ori_rt/Cargo.toml 2>&1 | tee rt-test-output.txt |
101 | 104 | RT_TESTS=$(grep -oE '[0-9]+ passed' rt-test-output.txt | grep -oE '^[0-9]+' | awk '{sum+=$1} END {print sum+0}') |
102 | 105 | RT_FAILED=$(grep -oE '[0-9]+ failed' rt-test-output.txt | grep -oE '^[0-9]+' | awk '{sum+=$1} END {print sum+0}') |
@@ -182,42 +185,52 @@ jobs: |
182 | 185 | - name: Ori language tests |
183 | 186 | run: cargo run -p oric --bin ori -- test tests/ |
184 | 187 |
|
185 | | - # LLVM backend - runs in Docker, non-blocking for now |
186 | | - # TODO: Make this blocking once LLVM backend is stable |
| 188 | + # LLVM backend - not in ci-success `needs`, so failures show red but don't block merges |
187 | 189 | llvm: |
188 | 190 | name: LLVM Backend |
189 | 191 | if: "!startsWith(github.event.head_commit.message, 'chore: release v')" |
190 | 192 | runs-on: ubuntu-latest |
191 | | - timeout-minutes: 60 |
192 | | - continue-on-error: true # Non-blocking during pre-alpha |
| 193 | + timeout-minutes: 30 |
193 | 194 | steps: |
194 | 195 | - uses: actions/checkout@v4 |
195 | 196 |
|
196 | | - - name: Set up Docker Buildx |
197 | | - uses: docker/setup-buildx-action@v3 |
| 197 | + - name: Install LLVM 17 |
| 198 | + run: | |
| 199 | + curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg |
| 200 | + 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 |
| 201 | + sudo apt-get update |
| 202 | + sudo apt-get install -y --no-install-recommends llvm-17 llvm-17-dev libpolly-17-dev clang-17 lld-17 |
| 203 | + env: |
| 204 | + DEBIAN_FRONTEND: noninteractive |
198 | 205 |
|
199 | | - - name: Build LLVM Docker image |
200 | | - uses: docker/build-push-action@v6 |
| 206 | + - uses: dtolnay/rust-toolchain@stable |
201 | 207 | with: |
202 | | - context: docker/llvm |
203 | | - load: true |
204 | | - tags: ori-llvm:latest |
205 | | - cache-from: type=gha |
206 | | - cache-to: type=gha,mode=max |
| 208 | + components: clippy |
| 209 | + |
| 210 | + - uses: Swatinem/rust-cache@v2 |
| 211 | + with: |
| 212 | + key: llvm |
207 | 213 |
|
208 | 214 | - name: LLVM clippy |
209 | | - run: ./llvm-clippy.sh |
| 215 | + run: cargo clippy --manifest-path compiler/ori_llvm/Cargo.toml --all-targets -- -D warnings |
| 216 | + env: |
| 217 | + LLVM_SYS_170_PREFIX: /usr/lib/llvm-17 |
210 | 218 |
|
211 | 219 | - name: LLVM tests |
212 | 220 | id: llvm-tests |
213 | 221 | continue-on-error: true |
214 | 222 | run: | |
215 | | - ./llvm-test.sh 2>&1 | tee llvm-test-output.txt |
| 223 | + set -o pipefail |
| 224 | + cargo build -p oric -p ori_rt --features llvm -q |
| 225 | + cargo test --manifest-path compiler/ori_rt/Cargo.toml 2>&1 | tee rt-llvm-output.txt |
| 226 | + cargo test --manifest-path compiler/ori_llvm/Cargo.toml 2>&1 | tee llvm-test-output.txt |
216 | 227 | # Sum all "X passed" counts from test output |
217 | | - LLVM_TESTS=$(grep -oE '[0-9]+ passed' llvm-test-output.txt | grep -oE '^[0-9]+' | awk '{sum+=$1} END {print sum+0}') |
218 | | - LLVM_FAILED=$(grep -oE '[0-9]+ failed' llvm-test-output.txt | grep -oE '^[0-9]+' | awk '{sum+=$1} END {print sum+0}') |
| 228 | + 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}') |
| 229 | + 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}') |
219 | 230 | echo "LLVM_TESTS=$LLVM_TESTS" >> $GITHUB_ENV |
220 | 231 | echo "LLVM_FAILED=$LLVM_FAILED" >> $GITHUB_ENV |
| 232 | + env: |
| 233 | + LLVM_SYS_170_PREFIX: /usr/lib/llvm-17 |
221 | 234 |
|
222 | 235 | - name: Save LLVM test results |
223 | 236 | if: always() |
@@ -246,6 +259,10 @@ jobs: |
246 | 259 | path: llvm-test-results.json |
247 | 260 | retention-days: 90 |
248 | 261 |
|
| 262 | + - name: Fail if LLVM tests failed |
| 263 | + if: steps.llvm-tests.outcome == 'failure' |
| 264 | + run: exit 1 |
| 265 | + |
249 | 266 | # Single status check for branch protection |
250 | 267 | ci-success: |
251 | 268 | name: CI Success |
|
0 commit comments