11 # Enable backtraces for easier debugging
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" }
28 # FIXME: re-enable asm tests when GCC can emit in the right syntax.
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",
40 - uses: actions/checkout@v3
42 - uses: actions/checkout@v3
44 repository: llvm/llvm-project
47 - name: Install packages
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
51 - name: Install libgccjit12
52 if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
53 run: sudo apt-get install libgccjit-12-dev
55 - name: Download artifact
56 if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
57 uses: dawidd6/action-download-artifact@v2
60 name: ${{ matrix.libgccjit_version.gcc }}
63 branch: ${{ matrix.libgccjit_version.artifacts_branch }}
65 search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
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
71 - name: Setup path to libgccjit
72 if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
74 echo $(readlink -f gcc-build) > gcc_path
75 # NOTE: the filename is still libgccjit.so even when the artifact name is different.
76 ln gcc-build/libgccjit.so gcc-build/libgccjit.so.0
80 echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
81 echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
82 echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
84 - name: Set RUST_COMPILER_RT_ROOT
85 run: echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV
87 - name: Cache cargo installed crates
88 uses: actions/cache@v3
91 key: cargo-installed-crates2-ubuntu-latest
93 - name: Cache cargo registry
94 uses: actions/cache@v3
96 path: ~/.cargo/registry
97 key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
99 - name: Cache cargo index
100 uses: actions/cache@v3
103 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
105 - name: Cache cargo target dir
106 uses: actions/cache@v3
109 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
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
118 #key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}
123 ${{ matrix.libgccjit_version.env_extra }} ./build.sh ${{ matrix.libgccjit_version.extra }}
124 ${{ matrix.libgccjit_version.env_extra }} cargo test ${{ matrix.libgccjit_version.extra }}
127 - name: Prepare dependencies
129 git config --global user.email "user@example.com"
130 git config --global user.name "User"
133 # Compile is a separate step, as the actions-rs/cargo action supports error annotations
135 uses: actions-rs/cargo@v1.0.3
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
146 ${{ matrix.libgccjit_version.env_extra }} ./test.sh --release --clean --build-sysroot ${{ matrix.commands }} ${{ matrix.libgccjit_version.extra }}
149 runs-on: ubuntu-latest
151 - uses: actions/checkout@v3
152 - run: python tools/check_intrinsics_duplicates.py