4
4
- push
5
5
- pull_request
6
6
7
+ permissions :
8
+ contents : read
9
+
10
+ env :
11
+ # Enable backtraces for easier debugging
12
+ RUST_BACKTRACE : 1
13
+
7
14
jobs :
8
15
build :
9
- runs-on : ubuntu-latest
16
+ runs-on : ubuntu-22.04
10
17
11
18
strategy :
12
19
fail-fast : false
13
20
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
+ ]
15
38
16
39
steps :
17
- - uses : actions/checkout@v2
40
+ - uses : actions/checkout@v3
18
41
19
- - uses : actions/checkout@v2
42
+ - uses : actions/checkout@v3
20
43
with :
21
44
repository : llvm/llvm-project
22
45
path : llvm
23
46
24
47
- 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
26
54
27
55
- name : Download artifact
56
+ if : matrix.libgccjit_version.gcc != 'libgccjit12.so'
28
57
uses : dawidd6/action-download-artifact@v2
29
58
with :
30
59
workflow : main.yml
31
- name : ${{ matrix.libgccjit_version }}
60
+ name : ${{ matrix.libgccjit_version.gcc }}
32
61
path : gcc-build
33
62
repo : antoyo/gcc
63
+ branch : ${{ matrix.libgccjit_version.artifacts_branch }}
64
+ event : push
34
65
search_artifacts : true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
35
66
36
67
- 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'
37
73
run : |
38
74
echo $(readlink -f gcc-build) > gcc_path
39
75
# NOTE: the filename is still libgccjit.so even when the artifact name is different.
@@ -48,49 +84,44 @@ jobs:
48
84
- name : Set RUST_COMPILER_RT_ROOT
49
85
run : echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV
50
86
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
-
56
87
- name : Cache cargo installed crates
57
- uses : actions/cache@v1.1.2
88
+ uses : actions/cache@v3
58
89
with :
59
90
path : ~/.cargo/bin
60
91
key : cargo-installed-crates2-ubuntu-latest
61
92
62
93
- name : Cache cargo registry
63
- uses : actions/cache@v1
94
+ uses : actions/cache@v3
64
95
with :
65
96
path : ~/.cargo/registry
66
97
key : ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
67
98
68
99
- name : Cache cargo index
69
- uses : actions/cache@v1
100
+ uses : actions/cache@v3
70
101
with :
71
102
path : ~/.cargo/git
72
103
key : ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
73
104
74
105
- name : Cache cargo target dir
75
- uses : actions/cache@v1.1.2
106
+ uses : actions/cache@v3
76
107
with :
77
108
path : target
78
109
key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
79
110
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') }}
87
119
88
120
- name : Build
89
- if : matrix.libgccjit_version == 'libgccjit12.so'
90
121
run : |
91
122
./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 }}
94
125
./clean_all.sh
95
126
96
127
- name : Prepare dependencies
@@ -106,26 +137,16 @@ jobs:
106
137
command : build
107
138
args : --release
108
139
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
118
143
119
- ./test.sh --release
120
-
121
- - name : Test
122
- if : matrix.libgccjit_version == 'libgccjit12.so'
144
+ - name : Run tests
123
145
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 }}
130
147
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