Skip to content

Commit c975019

Browse files
committed
Split CI script
1 parent 6bd4acc commit c975019

File tree

3 files changed

+138
-20
lines changed

3 files changed

+138
-20
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
libgccjit_version:
22-
- { gcc: "libgccjit.so", extra: "", env_extra: "", artifacts_branch: "master" }
23-
- { gcc: "libgccjit_without_int128.so", extra: "", env_extra: "", artifacts_branch: "master-without-128bit-integers" }
24-
- { gcc: "libgccjit12.so", extra: "--no-default-features", env_extra: "TEST_FLAGS='-Cpanic=abort -Zpanic-abort-tests'", artifacts_branch: "gcc12" }
22+
- { gcc: "libgccjit.so", artifacts_branch: "master" }
23+
- { gcc: "libgccjit_without_int128.so", artifacts_branch: "master-without-128bit-integers" }
2524
commands: [
2625
"--mini-tests",
2726
"--std-tests",
@@ -48,12 +47,7 @@ jobs:
4847
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
4948
run: sudo apt-get install ninja-build ripgrep llvm-14-tools
5049

51-
- name: Install libgccjit12
52-
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
53-
run: sudo apt-get install libgccjit-12-dev
54-
5550
- name: Download artifact
56-
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
5751
uses: dawidd6/action-download-artifact@v2
5852
with:
5953
workflow: main.yml
@@ -65,11 +59,6 @@ jobs:
6559
search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
6660

6761
- name: Setup path to libgccjit
68-
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
69-
run: echo /usr/lib/gcc/x86_64-linux-gnu/12 > gcc_path
70-
71-
- name: Setup path to libgccjit
72-
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
7362
run: |
7463
echo $(readlink -f gcc-build) > gcc_path
7564
# NOTE: the filename is still libgccjit.so even when the artifact name is different.
@@ -120,8 +109,8 @@ jobs:
120109
- name: Build
121110
run: |
122111
./prepare_build.sh
123-
${{ matrix.libgccjit_version.env_extra }} ./build.sh ${{ matrix.libgccjit_version.extra }}
124-
${{ matrix.libgccjit_version.env_extra }} cargo test ${{ matrix.libgccjit_version.extra }}
112+
./build.sh
113+
cargo test
125114
./clean_all.sh
126115
127116
- name: Prepare dependencies
@@ -137,13 +126,9 @@ jobs:
137126
command: build
138127
args: --release
139128

140-
- name: Add more failing tests for GCC 12
141-
if: ${{ matrix.libgccjit_version.gcc == 'libgccjit12.so' }}
142-
run: cat failing-ui-tests12.txt >> failing-ui-tests.txt
143-
144129
- name: Run tests
145130
run: |
146-
${{ matrix.libgccjit_version.env_extra }} ./test.sh --release --clean --build-sysroot ${{ matrix.commands }} ${{ matrix.libgccjit_version.extra }}
131+
./test.sh --release --clean --build-sysroot ${{ matrix.commands }}
147132
148133
duplicates:
149134
runs-on: ubuntu-latest

.github/workflows/gcc12.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: CI
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
permissions:
8+
contents: read
9+
10+
env:
11+
# Enable backtraces for easier debugging
12+
RUST_BACKTRACE: 1
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-22.04
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
commands: [
22+
"--mini-tests",
23+
"--std-tests",
24+
# FIXME: re-enable asm tests when GCC can emit in the right syntax.
25+
# "--asm-tests",
26+
"--test-libcore",
27+
"--extended-rand-tests",
28+
"--extended-regex-example-tests",
29+
"--extended-regex-tests",
30+
"--test-successful-rustc --nb-parts 2 --current-part 0",
31+
"--test-successful-rustc --nb-parts 2 --current-part 1",
32+
"--test-failing-rustc",
33+
]
34+
35+
steps:
36+
- uses: actions/checkout@v3
37+
38+
- uses: actions/checkout@v3
39+
with:
40+
repository: llvm/llvm-project
41+
path: llvm
42+
43+
- name: Install packages
44+
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
45+
run: sudo apt-get install ninja-build ripgrep llvm-14-tools
46+
47+
- name: Install libgccjit12
48+
run: sudo apt-get install libgccjit-12-dev
49+
50+
- name: Setup path to libgccjit
51+
run: echo /usr/lib/gcc/x86_64-linux-gnu/12 > gcc_path
52+
53+
- name: Set env
54+
run: |
55+
echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
56+
echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
57+
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
58+
59+
- name: Set RUST_COMPILER_RT_ROOT
60+
run: echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV
61+
62+
- name: Cache cargo installed crates
63+
uses: actions/cache@v3
64+
with:
65+
path: ~/.cargo/bin
66+
key: cargo-installed-crates2-ubuntu-latest
67+
68+
- name: Cache cargo registry
69+
uses: actions/cache@v3
70+
with:
71+
path: ~/.cargo/registry
72+
key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
73+
74+
- name: Cache cargo index
75+
uses: actions/cache@v3
76+
with:
77+
path: ~/.cargo/git
78+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
79+
80+
- name: Cache cargo target dir
81+
uses: actions/cache@v3
82+
with:
83+
path: target
84+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
85+
86+
#- name: Cache rust repository
87+
## We only clone the rust repository for rustc tests
88+
#if: ${{ contains(matrix.commands, 'rustc') }}
89+
#uses: actions/cache@v3
90+
#id: cache-rust-repository
91+
#with:
92+
#path: rust
93+
#key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}
94+
95+
- name: Build
96+
run: |
97+
./prepare_build.sh
98+
./build.sh --no-default-features
99+
cargo test --no-default-features
100+
./clean_all.sh
101+
102+
- name: Prepare dependencies
103+
run: |
104+
git config --global user.email "[email protected]"
105+
git config --global user.name "User"
106+
./prepare.sh
107+
108+
# Compile is a separate step, as the actions-rs/cargo action supports error annotations
109+
- name: Compile
110+
uses: actions-rs/[email protected]
111+
with:
112+
command: build
113+
args: --release
114+
115+
- name: Add more failing tests for GCC 12
116+
run: cat failing-ui-tests12.txt >> failing-ui-tests.txt
117+
118+
- name: Run tests
119+
run: |
120+
./test.sh --release --clean --build-sysroot ${{ matrix.commands }} --no-default-features
121+
122+
duplicates:
123+
runs-on: ubuntu-latest
124+
steps:
125+
- uses: actions/checkout@v3
126+
- run: python tools/check_intrinsics_duplicates.py

.ignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!/build_sysroot/sysroot_src
2+
!/simple-raytracer
3+
!/regex
4+
!/rand
5+
!/test-backend
6+
!/gcc_path
7+
!/benchmarks

0 commit comments

Comments
 (0)