|
| 1 | +# TODO: refactor to avoid duplication with the ci.yml file. |
| 2 | +name: Failures |
| 3 | + |
| 4 | +on: |
| 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 | + libgccjit_version: |
| 22 | + - gcc: "libgccjit.so" |
| 23 | + artifacts_branch: "master" |
| 24 | + - gcc: "libgccjit_without_int128.so" |
| 25 | + artifacts_branch: "master-without-128bit-integers" |
| 26 | + - gcc: "libgccjit12.so" |
| 27 | + artifacts_branch: "gcc12" |
| 28 | + extra: "--no-default-features" |
| 29 | + # FIXME(antoyo): we need to set GCC_EXEC_PREFIX so that the linker can find the linker plugin. |
| 30 | + # Not sure why it's not found otherwise. |
| 31 | + env_extra: "TEST_FLAGS='-Cpanic=abort -Zpanic-abort-tests' GCC_EXEC_PREFIX=/usr/lib/gcc/" |
| 32 | + |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v3 |
| 35 | + |
| 36 | + - name: Install packages |
| 37 | + run: sudo apt-get install ninja-build ripgrep |
| 38 | + |
| 39 | + - name: Install libgccjit12 |
| 40 | + if: matrix.libgccjit_version.gcc == 'libgccjit12.so' |
| 41 | + run: sudo apt-get install libgccjit-12-dev |
| 42 | + |
| 43 | + - name: Setup path to libgccjit |
| 44 | + if: matrix.libgccjit_version.gcc == 'libgccjit12.so' |
| 45 | + run: echo /usr/lib/gcc/x86_64-linux-gnu/12 > gcc_path |
| 46 | + |
| 47 | + - name: Download artifact |
| 48 | + if: matrix.libgccjit_version.gcc != 'libgccjit12.so' |
| 49 | + uses: dawidd6/action-download-artifact@v2 |
| 50 | + with: |
| 51 | + workflow: main.yml |
| 52 | + name: gcc-13 |
| 53 | + path: gcc-13 |
| 54 | + repo: antoyo/gcc |
| 55 | + branch: ${{ matrix.libgccjit_version.artifacts_branch }} |
| 56 | + event: push |
| 57 | + search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts. |
| 58 | + |
| 59 | + - name: Setup path to libgccjit |
| 60 | + if: matrix.libgccjit_version.gcc != 'libgccjit12.so' |
| 61 | + run: | |
| 62 | + sudo dpkg --force-overwrite -i gcc-13/gcc-13.deb |
| 63 | + echo /usr/lib/ > gcc_path |
| 64 | +
|
| 65 | + - name: Set env |
| 66 | + run: | |
| 67 | + echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV |
| 68 | + echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV |
| 69 | + echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV |
| 70 | +
|
| 71 | + - name: Cache cargo installed crates |
| 72 | + uses: actions/cache@v3 |
| 73 | + with: |
| 74 | + path: ~/.cargo/bin |
| 75 | + key: cargo-installed-crates2-ubuntu-latest |
| 76 | + |
| 77 | + - name: Cache cargo registry |
| 78 | + uses: actions/cache@v3 |
| 79 | + with: |
| 80 | + path: ~/.cargo/registry |
| 81 | + key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }} |
| 82 | + |
| 83 | + - name: Cache cargo index |
| 84 | + uses: actions/cache@v3 |
| 85 | + with: |
| 86 | + path: ~/.cargo/git |
| 87 | + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} |
| 88 | + |
| 89 | + - name: Cache cargo target dir |
| 90 | + uses: actions/cache@v3 |
| 91 | + with: |
| 92 | + path: target |
| 93 | + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }} |
| 94 | + |
| 95 | + #- name: Cache rust repository |
| 96 | + #uses: actions/cache@v3 |
| 97 | + #id: cache-rust-repository |
| 98 | + #with: |
| 99 | + #path: rust |
| 100 | + #key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }} |
| 101 | + |
| 102 | + - name: Git config |
| 103 | + run: | |
| 104 | + git config --global user.email "user@example.com" |
| 105 | + git config --global user.name "User" |
| 106 | +
|
| 107 | + - name: Prepare dependencies |
| 108 | + if: matrix.libgccjit_version.gcc == 'libgccjit12.so' |
| 109 | + run: ./y.sh prepare --libgccjit12-patches |
| 110 | + |
| 111 | + - name: Prepare dependencies |
| 112 | + if: matrix.libgccjit_version.gcc != 'libgccjit12.so' |
| 113 | + run: ./y.sh prepare |
| 114 | + |
| 115 | + # Compile is a separate step, as the actions-rs/cargo action supports error annotations |
| 116 | + - name: Compile |
| 117 | + uses: actions-rs/cargo@v1.0.3 |
| 118 | + with: |
| 119 | + command: build |
| 120 | + args: --release |
| 121 | + |
| 122 | + - name: Add more failing tests because the sysroot is not compiled with LTO |
| 123 | + run: cat failing-non-lto-tests.txt >> failing-ui-tests.txt |
| 124 | + |
| 125 | + - name: Run tests |
| 126 | + id: tests |
| 127 | + run: | |
| 128 | + ${{ matrix.libgccjit_version.env_extra }} ./test.sh --release --clean --build-sysroot --test-failing-rustc ${{ matrix.libgccjit_version.extra }} | tee output_log |
| 129 | + rg --text "test result" output_log >> $GITHUB_STEP_SUMMARY |
0 commit comments