compiler/rustc_codegen_cranelift/.github/workflows/main.yml YAML 281 lines View on github.com → Search inside
1name: CI23on:4  - push5  - pull_request67defaults:8  run:9    shell: bash1011permissions: {}1213env:14  # Disabling incr comp reduces cache size and incr comp doesn't save as much15  # on CI anyway.16  CARGO_BUILD_INCREMENTAL: false17  # Rust's CI denies warnings. Deny them here too to ensure subtree syncs don't18  # fail because of warnings.19  RUSTFLAGS: "-Dwarnings"2021jobs:22  todo_check:23    runs-on: ubuntu-latest24    timeout-minutes: 102526    steps:27    - uses: actions/checkout@v62829    - name: Check todo30      run: ./y.sh check-todo3132  rustfmt:33    runs-on: ubuntu-latest34    timeout-minutes: 103536    steps:37    - uses: actions/checkout@v63839    - name: Avoid installing rustc-dev40      run: |41        sed -i 's/components.*/components = ["rustfmt"]/' rust-toolchain.toml42        rustfmt -v4344    - name: Rustfmt45      run: |46        cargo fmt --check47        rustfmt --check --edition 2024 build_system/main.rs48        rustfmt --check --edition 2024 example/*49        rustfmt --check --edition 2024 scripts/*.rs505152  test:53    runs-on: ${{ matrix.os }}54    timeout-minutes: 605556    env:57      CG_CLIF_EXPENSIVE_CHECKS: 15859    strategy:60      fail-fast: false61      matrix:62        include:63          - os: ubuntu-latest64            env:65              TARGET_TRIPLE: x86_64-unknown-linux-gnu66          - os: ubuntu-24.04-arm67            env:68              TARGET_TRIPLE: aarch64-unknown-linux-gnu69          - os: macos-15-intel70            env:71              TARGET_TRIPLE: x86_64-apple-darwin72          - os: macos-latest73            env:74              TARGET_TRIPLE: aarch64-apple-darwin75          - os: ubuntu-latest76            env:77              TARGET_TRIPLE: s390x-unknown-linux-gnu78            apt_deps: gcc-s390x-linux-gnu qemu-user79          - os: ubuntu-latest80            env:81              TARGET_TRIPLE: riscv64gc-unknown-linux-gnu82            apt_deps: gcc-riscv64-linux-gnu qemu-user83          - os: windows-latest84            env:85              TARGET_TRIPLE: x86_64-pc-windows-msvc86          - os: windows-latest87            env:88              TARGET_TRIPLE: x86_64-pc-windows-gnu8990    steps:91    - uses: actions/checkout@v69293    - name: CPU features94      if: matrix.os == 'ubuntu-latest'95      run: cat /proc/cpuinfo9697    - name: Cache cargo target dir98      uses: actions/cache@v599      with:100        path: build/cg_clif101        key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-build-target-${{ hashFiles('rust-toolchain.toml', '**/Cargo.lock') }}102103    - name: Set MinGW as the default toolchain104      if: matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'105      run: rustup set default-host x86_64-pc-windows-gnu106107    - name: Install toolchain and emulator108      if: matrix.apt_deps != null109      run: |110        sudo apt-get update111        sudo apt-get install -y ${{ matrix.apt_deps }}112113    - name: Prepare dependencies114      run: ./y.sh prepare115116    - name: Build117      run: ./y.sh build --sysroot none118119    - name: Test120      env:121        TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}122      run: ./y.sh test123124    - name: Install LLVM standard library125      run: rustup target add ${{ matrix.env.TARGET_TRIPLE }}126127    # This is roughly config rust-lang/rust uses for testing128    - name: Test with LLVM sysroot129      env:130        TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}131      run: ./y.sh test --sysroot llvm --no-unstable-features132133134  # This job doesn't use cg_clif in any way. It checks that all cg_clif tests work with cg_llvm too.135  test_llvm:136    runs-on: ubuntu-latest137    timeout-minutes: 60138139    steps:140    - uses: actions/checkout@v6141142    - name: CPU features143      run: cat /proc/cpuinfo144145    - name: Prepare dependencies146      run: ./y.sh prepare147148    - name: Disable JIT tests149      run: |150        sed -i 's/jit./#jit./' config.txt151152    - name: Test153      env:154        TARGET_TRIPLE: x86_64-unknown-linux-gnu155      run: ./y.sh test --use-backend llvm156157  bench:158    runs-on: ubuntu-latest159    timeout-minutes: 60160161    steps:162    - uses: actions/checkout@v6163164    - name: CPU features165      run: cat /proc/cpuinfo166167    - name: Cache cargo target dir168      uses: actions/cache@v5169      with:170        path: build/cg_clif171        key: ${{ runner.os }}-x86_64-unknown-linux-gnu-cargo-build-target-${{ hashFiles('rust-toolchain.toml', '**/Cargo.lock') }}172173    - name: Install hyperfine174      run: |175        sudo apt update176        sudo apt install -y hyperfine177178    - name: Build179      run: ./y.sh build --sysroot none180181    - name: Benchmark182      run: ./y.sh bench183184185  dist:186    runs-on: ${{ matrix.os }}187    timeout-minutes: 60188189    strategy:190      fail-fast: false191      matrix:192        include:193          # Intentionally using an older ubuntu version to lower the glibc requirements of the distributed cg_clif194          - os: ubuntu-22.04195            env:196              TARGET_TRIPLE: x86_64-unknown-linux-gnu197          - os: ubuntu-24.04-arm198            env:199              TARGET_TRIPLE: aarch64-unknown-linux-gnu200          - os: macos-15-intel201            env:202              TARGET_TRIPLE: x86_64-apple-darwin203          - os: macos-latest204            env:205              TARGET_TRIPLE: aarch64-apple-darwin206          - os: windows-latest207            env:208              TARGET_TRIPLE: x86_64-pc-windows-msvc209          - os: windows-latest210            env:211              TARGET_TRIPLE: x86_64-pc-windows-gnu212213    steps:214    - uses: actions/checkout@v6215216    - name: Cache cargo target dir217      uses: actions/cache@v5218      with:219        path: build/cg_clif220        key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-dist-cargo-build-target-${{ hashFiles('rust-toolchain.toml', '**/Cargo.lock') }}221222    - name: Set MinGW as the default toolchain223      if: matrix.os == 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'224      run: rustup set default-host x86_64-pc-windows-gnu225226    - name: Build backend227      run: ./y.sh build --sysroot none228229    - name: Build sysroot230      run: ./y.sh build231232    - name: Package prebuilt cg_clif233      run: tar cvfJ cg_clif.tar.xz dist234235    - name: Upload prebuilt cg_clif236      uses: actions/upload-artifact@v6237      with:238        name: cg_clif-${{ matrix.env.TARGET_TRIPLE }}239        path: cg_clif.tar.xz240241  release:242    runs-on: ubuntu-latest243    timeout-minutes: 10244    if: ${{ github.ref == 'refs/heads/main' }}245    # FIXME add bench back once rust-lang/cargo#16925 has been fixed246    needs: [todo_check, rustfmt, test, dist]247248    permissions:249      contents: write # for creating the dev tag and release250251    concurrency:252      group: release-dev253      cancel-in-progress: true254255    steps:256      - uses: actions/checkout@v6257258      - name: Download all built artifacts259        uses: actions/download-artifact@v4260        with:261          path: artifacts/262263      - run: |264          ls -R artifacts/265          mkdir release/266          pushd artifacts/267          for dir in *; do268            mv $dir/cg_clif.tar.xz ../release/$dir.tar.xz269            rmdir $dir/ # verify $dir is empty270          done271          popd272          rmdir artifacts/ # verify all artifacts are represented in release/273          ls -R release/274275      - name: Publish release276        env:277          GH_TOKEN: ${{ github.token }}278        run: |279          gh release delete --cleanup-tag -y dev || true280          gh release create --target $GITHUB_SHA --prerelease dev release/*

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.