fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.1 KiB111 linesraw
1name: CI 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        commands: [
24          "--test-successful-rustc --nb-parts 2 --current-part 0",
25          "--test-successful-rustc --nb-parts 2 --current-part 1",
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: Download artifact
40      uses: dawidd6/action-download-artifact@v2
41      with:
42          workflow: main.yml
43          name: ${{ matrix.libgccjit_version.gcc }}
44          path: gcc-build
45          repo: antoyo/gcc
46          branch: ${{ matrix.libgccjit_version.artifacts_branch }}
47          event: push
48          search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
49
50    - name: Setup path to libgccjit
51      run: |
52          echo $(readlink -f gcc-build) > gcc_path
53          # NOTE: the filename is still libgccjit.so even when the artifact name is different.
54          ln gcc-build/libgccjit.so gcc-build/libgccjit.so.0
55
56    - name: Set env
57      run: |
58        echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
59        echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
60        echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
61
62    - name: Set RUST_COMPILER_RT_ROOT
63      run: echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV
64
65    - name: Cache cargo installed crates
66      uses: actions/cache@v3
67      with:
68        path: ~/.cargo/bin
69        key: cargo-installed-crates2-ubuntu-latest
70
71    - name: Cache cargo registry
72      uses: actions/cache@v3
73      with:
74        path: ~/.cargo/registry
75        key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
76
77    - name: Cache cargo index
78      uses: actions/cache@v3
79      with:
80        path: ~/.cargo/git
81        key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
82
83    - name: Cache cargo target dir
84      uses: actions/cache@v3
85      with:
86        path: target
87        key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
88
89    - name: Build
90      run: |
91        ./prepare_build.sh
92        ./build.sh --release --release-sysroot
93        cargo test
94        ./clean_all.sh
95
96    - name: Prepare dependencies
97      run: |
98        git config --global user.email "user@example.com"
99        git config --global user.name "User"
100        ./prepare.sh
101
102    # Compile is a separate step, as the actions-rs/cargo action supports error annotations
103    - name: Compile
104      uses: actions-rs/cargo@v1.0.3
105      with:
106        command: build
107        args: --release
108
109    - name: Run tests
110      run: |
111        ./test.sh --release --clean --release-sysroot --build-sysroot ${{ matrix.commands }}