fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1name: stdarch tests with sysroot compiled in release mode 2 3on: 4 - push 5 - pull_request 6 7permissions: 8 contents: read 9 10env: 11 # Enable backtraces for easier debugging 12 RUST_BACKTRACE: 1 13 14jobs: 15 build: 16 runs-on: ubuntu-latest 17 18 strategy: 19 fail-fast: false 20 matrix: 21 libgccjit_version: 22 - { gcc: "libgccjit.so", artifacts_branch: "master" } 23 cargo_runner: [ 24 "sde -future -rtm_mode full --", 25 "", 26 ] 27 28 steps: 29 - uses: actions/checkout@v3 30 31 - uses: actions/checkout@v3 32 with: 33 repository: llvm/llvm-project 34 path: llvm 35 36 - name: Install packages 37 run: sudo apt-get install ninja-build ripgrep 38 39 - name: Install Intel Software Development Emulator 40 if: ${{ matrix.cargo_runner }} 41 run: | 42 mkdir intel-sde 43 cd intel-sde 44 dir=sde-external-9.14.0-2022-10-25-lin 45 file=$dir.tar.xz 46 wget https://downloadmirror.intel.com/751535/$file 47 tar xvf $file 48 sudo mkdir /usr/share/intel-sde 49 sudo cp -r $dir/* /usr/share/intel-sde 50 sudo ln -s /usr/share/intel-sde/sde /usr/bin/sde 51 sudo ln -s /usr/share/intel-sde/sde64 /usr/bin/sde64 52 53 - name: Download artifact 54 uses: dawidd6/action-download-artifact@v2 55 with: 56 workflow: main.yml 57 name: ${{ matrix.libgccjit_version.gcc }} 58 path: gcc-build 59 repo: antoyo/gcc 60 branch: ${{ matrix.libgccjit_version.artifacts_branch }} 61 event: push 62 search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts. 63 64 - name: Setup path to libgccjit 65 run: | 66 echo $(readlink -f gcc-build) > gcc_path 67 # NOTE: the filename is still libgccjit.so even when the artifact name is different. 68 ln gcc-build/libgccjit.so gcc-build/libgccjit.so.0 69 70 - name: Set env 71 run: | 72 echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV 73 echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV 74 echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV 75 76 - name: Set RUST_COMPILER_RT_ROOT 77 run: echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV 78 79 - name: Cache cargo installed crates 80 uses: actions/cache@v3 81 with: 82 path: ~/.cargo/bin 83 key: cargo-installed-crates2-ubuntu-latest 84 85 - name: Cache cargo registry 86 uses: actions/cache@v3 87 with: 88 path: ~/.cargo/registry 89 key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }} 90 91 - name: Cache cargo index 92 uses: actions/cache@v3 93 with: 94 path: ~/.cargo/git 95 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} 96 97 - name: Cache cargo target dir 98 uses: actions/cache@v3 99 with: 100 path: target 101 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }} 102 103 - name: Build 104 run: | 105 ./prepare_build.sh 106 ./build.sh --release --release-sysroot 107 cargo test 108 109 - name: Clean 110 if: ${{ !matrix.cargo_runner }} 111 run: | 112 ./clean_all.sh 113 114 - name: Prepare dependencies 115 run: | 116 git config --global user.email "user@example.com" 117 git config --global user.name "User" 118 ./prepare.sh 119 120 # Compile is a separate step, as the actions-rs/cargo action supports error annotations 121 - name: Compile 122 uses: actions-rs/cargo@v1.0.3 123 with: 124 command: build 125 args: --release 126 127 - name: Run tests 128 if: ${{ !matrix.cargo_runner }} 129 run: | 130 ./test.sh --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests --test-libcore 131 132 - name: Run stdarch tests 133 if: ${{ !matrix.cargo_runner }} 134 run: | 135 cd build_sysroot/sysroot_src/library/stdarch/ 136 CHANNEL=release TARGET=x86_64-unknown-linux-gnu ../../../../cargo.sh test 137 138 - name: Run stdarch tests 139 if: ${{ matrix.cargo_runner }} 140 run: | 141 cd build_sysroot/sysroot_src/library/stdarch/ 142 STDARCH_TEST_EVERYTHING=1 CHANNEL=release CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="${{ matrix.cargo_runner }}" TARGET=x86_64-unknown-linux-gnu ../../../../cargo.sh test -- --skip rtm --skip tbm --skip sse4a