44 - push
55 - pull_request
66
7+ permissions :
8+ contents : read
9+
10+ env :
11+ # Enable backtraces for easier debugging
12+ RUST_BACKTRACE : 1
13+
714jobs :
815 build :
9- runs-on : ubuntu-latest
16+ runs-on : ubuntu-22.04
1017
1118 strategy :
1219 fail-fast : false
1320 matrix :
14- libgccjit_version : ["libgccjit.so", "libgccjit_without_int128.so", "libgccjit12.so"]
21+ 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" }
25+ commands : [
26+ " --mini-tests" ,
27+ " --std-tests" ,
28+ # FIXME: re-enable asm tests when GCC can emit in the right syntax.
29+ # "--asm-tests",
30+ " --test-libcore" ,
31+ " --extended-rand-tests" ,
32+ " --extended-regex-example-tests" ,
33+ " --extended-regex-tests" ,
34+ " --test-successful-rustc --nb-parts 2 --current-part 0" ,
35+ " --test-successful-rustc --nb-parts 2 --current-part 1" ,
36+ " --test-failing-rustc" ,
37+ ]
1538
1639 steps :
17- - uses : actions/checkout@v2
40+ - uses : actions/checkout@v3
1841
19- - uses : actions/checkout@v2
42+ - uses : actions/checkout@v3
2043 with :
2144 repository : llvm/llvm-project
2245 path : llvm
2346
2447 - name : Install packages
25- run : sudo apt-get install ninja-build ripgrep
48+ # `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
49+ run : sudo apt-get install ninja-build ripgrep llvm-14-tools
50+
51+ - name : Install libgccjit12
52+ if : matrix.libgccjit_version.gcc == 'libgccjit12.so'
53+ run : sudo apt-get install libgccjit-12-dev
2654
2755 - name : Download artifact
56+ if : matrix.libgccjit_version.gcc != 'libgccjit12.so'
2857 uses : dawidd6/action-download-artifact@v2
2958 with :
3059 workflow : main.yml
31- name : ${{ matrix.libgccjit_version }}
60+ name : ${{ matrix.libgccjit_version.gcc }}
3261 path : gcc-build
3362 repo : antoyo/gcc
63+ branch : ${{ matrix.libgccjit_version.artifacts_branch }}
64+ event : push
3465 search_artifacts : true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
3566
3667 - 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'
3773 run : |
3874 echo $(readlink -f gcc-build) > gcc_path
3975 # NOTE: the filename is still libgccjit.so even when the artifact name is different.
@@ -48,49 +84,44 @@ jobs:
4884 - name : Set RUST_COMPILER_RT_ROOT
4985 run : echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV
5086
51- # https://github.com/actions/cache/issues/133
52- - name : Fixup owner of ~/.cargo/
53- # Don't remove the trailing /. It is necessary to follow the symlink.
54- run : sudo chown -R $(whoami):$(id -ng) ~/.cargo/
55-
5687 - name : Cache cargo installed crates
57- uses : actions/cache@v1.1.2
88+ uses : actions/cache@v3
5889 with :
5990 path : ~/.cargo/bin
6091 key : cargo-installed-crates2-ubuntu-latest
6192
6293 - name : Cache cargo registry
63- uses : actions/cache@v1
94+ uses : actions/cache@v3
6495 with :
6596 path : ~/.cargo/registry
6697 key : ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
6798
6899 - name : Cache cargo index
69- uses : actions/cache@v1
100+ uses : actions/cache@v3
70101 with :
71102 path : ~/.cargo/git
72103 key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
73104
74105 - name : Cache cargo target dir
75- uses : actions/cache@v1.1.2
106+ uses : actions/cache@v3
76107 with :
77108 path : target
78109 key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
79110
80- - name : Build
81- if : matrix.libgccjit_version != 'libgccjit12.so'
82- run : |
83- ./prepare_build.sh
84- ./build.sh
85- cargo test
86- ./clean_all.sh
111+ # - name: Cache rust repository
112+ # # We only clone the rust repository for rustc tests
113+ # if: ${{ contains(matrix.commands, 'rustc') }}
114+ # uses: actions/cache@v3
115+ # id: cache-rust-repository
116+ # with:
117+ # path: rust
118+ # key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}
87119
88120 - name : Build
89- if : matrix.libgccjit_version == 'libgccjit12.so'
90121 run : |
91122 ./prepare_build.sh
92- . /build.sh --no-default-features
93- cargo test --no-default-features
123+ ${{ matrix.libgccjit_version.env_extra }} . /build.sh ${{ matrix.libgccjit_version.extra }}
124+ ${{ matrix.libgccjit_version.env_extra }} cargo test ${{ matrix.libgccjit_version.extra }}
94125 ./clean_all.sh
95126
96127 - name : Prepare dependencies
@@ -106,26 +137,16 @@ jobs:
106137 command : build
107138 args : --release
108139
109- - name : Test
110- if : matrix.libgccjit_version != 'libgccjit12.so'
111- run : |
112- # Enable backtraces for easier debugging
113- export RUST_BACKTRACE=1
114-
115- # Reduce amount of benchmark runs as they are slow
116- export COMPILE_RUNS=2
117- export RUN_RUNS=2
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
118143
119- ./test.sh --release
120-
121- - name : Test
122- if : matrix.libgccjit_version == 'libgccjit12.so'
144+ - name : Run tests
123145 run : |
124- # Enable backtraces for easier debugging
125- export RUST_BACKTRACE=1
126-
127- # Reduce amount of benchmark runs as they are slow
128- export COMPILE_RUNS=2
129- export RUN_RUNS=2
146+ ${{ matrix.libgccjit_version.env_extra }} ./test.sh --release --clean --build-sysroot ${{ matrix.commands }} ${{ matrix.libgccjit_version.extra }}
130147
131- ./test.sh --release --no-default-features
148+ duplicates :
149+ runs-on : ubuntu-latest
150+ steps :
151+ - uses : actions/checkout@v3
152+ - run : python tools/check_intrinsics_duplicates.py
0 commit comments