chore: release #6215
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| paths: | |
| # When we change pyproject.toml, we want to ensure that the maturin builds still work | |
| - test-data/** | |
| - crates/** | |
| - Cargo.* | |
| # And when we change this workflow itself... | |
| - .github/workflows/rust-compile.yml | |
| name: Rust | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| RUST_LOG: info | |
| RUST_BACKTRACE: 1 | |
| RUSTFLAGS: "-D warnings" | |
| CARGO_TERM_COLOR: always | |
| DEFAULT_FEATURES: indicatif,tokio,serde,reqwest,sparse,gateway,resolvo,libsolv_c,s3,edit,rattler_config | |
| jobs: | |
| check-rustdoc-links: | |
| name: Check intra-doc links | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| submodules: recursive | |
| - name: Set up pixi | |
| uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3 | |
| - run: pixi r doc | |
| build: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # TODO: We are using 22.04 because for some reason we have a SIGSEV on the libsolv tests on newer versions of Ubuntu. | |
| - {name: "Linux-x86_64", target: x86_64-unknown-linux-musl, os: ubuntu-22.04} | |
| - { | |
| name: "Linux-aarch64", | |
| target: aarch64-unknown-linux-musl, | |
| os: ubuntu-latest, | |
| skip-tests: true, | |
| } | |
| - { | |
| name: "Linux-arm", | |
| target: arm-unknown-linux-musleabi, | |
| os: ubuntu-latest, | |
| use-cross: true, | |
| skip-tests: true, | |
| } | |
| # - { name: "Linux-mips", target: mips-unknown-linux-musl, os: ubuntu-latest, use-cross: true, skip-tests: true } | |
| # - { name: "Linux-mipsel", target: mipsel-unknown-linux-musl, os: ubuntu-latest, use-cross: true, skip-tests: true } | |
| # - { name: "Linux-mips64", target: mips64-unknown-linux-muslabi64, os: ubuntu-latest, use-cross: true, skip-tests: true } | |
| # - { name: "Linux-mips64el", target: mips64el-unknown-linux-muslabi64, os: ubuntu-latest, use-cross: true, skip-tests: true } | |
| # - { name: "Linux-powerpc", target: powerpc-unknown-linux-gnu, os: ubuntu-latest, use-cross: true, skip-tests: true } | |
| - { | |
| name: "Linux-powerpc64", | |
| target: powerpc64-unknown-linux-gnu, | |
| os: ubuntu-latest, | |
| use-cross: true, | |
| skip-tests: true, | |
| } | |
| - { | |
| name: "Linux-powerpc64le", | |
| target: powerpc64le-unknown-linux-gnu, | |
| os: ubuntu-latest, | |
| use-cross: true, | |
| skip-tests: true, | |
| } | |
| - { | |
| name: "Linux-s390x", | |
| target: s390x-unknown-linux-gnu, | |
| os: ubuntu-latest, | |
| use-cross: true, | |
| skip-tests: true, | |
| } | |
| - {name: "macOS-x86_64", target: x86_64-apple-darwin, os: macOS-latest} | |
| - {name: "macOS-aarch64", target: aarch64-apple-darwin, os: macOS-latest} | |
| - {name: "Windows-x86_64", target: x86_64-pc-windows-msvc, os: windows-latest} | |
| - { | |
| name: "Windows-aarch64", | |
| target: aarch64-pc-windows-msvc, | |
| os: windows-latest, | |
| skip-tests: true, | |
| } | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust toolchain | |
| run: | | |
| rustup component add rustfmt | |
| rustup target add ${{ matrix.target }} | |
| rustup component add rust-src --target ${{ matrix.target }} | |
| - uses: taiki-e/setup-cross-toolchain-action@0123528f956f923e7a476f4cc04882bc005e7c89 # v1.29.1 | |
| if: matrix.target != 'x86_64-unknown-linux-musl' | |
| with: | |
| target: ${{ matrix.target }} | |
| - if: matrix.target == 'x86_64-unknown-linux-musl' | |
| run: | | |
| sudo apt install musl-tools gcc g++ | |
| sudo ln -s /usr/bin/musl-gcc /usr/bin/musl-g++ | |
| - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| - name: Show version information (Rust, cargo, GCC) | |
| shell: bash | |
| run: | | |
| gcc --version || true | |
| rustup -V | |
| rustup toolchain list | |
| cargo -V | |
| rustc -V | |
| - name: Use rustls on musl targets. | |
| id: build-options | |
| if: contains(matrix.target, '-musl') || startsWith(matrix.target, 'powerpc') || startsWith(matrix.target, 's390x') | |
| run: | | |
| echo "CARGO_BUILD_OPTIONS=${CARGO_BUILD_OPTIONS} --no-default-features --features rustls-tls" >> $GITHUB_OUTPUT | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 | |
| if: startsWith(matrix.os, 'ubuntu') | |
| with: | |
| # this might remove tools that are actually needed, | |
| # if set to "true" but frees about 6 GB | |
| tool-cache: false | |
| # all of these default to true, but feel free to set to | |
| # "false" if necessary for your workflow | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: false # Takes a lot of time so lets leave it | |
| docker-images: true | |
| swap-storage: true | |
| - name: Build | |
| run: > | |
| cargo build | |
| --all-targets | |
| --features ${{ env.DEFAULT_FEATURES }} | |
| --target ${{ matrix.target }} | |
| ${{ steps.build-options.outputs.CARGO_BUILD_OPTIONS }} | |
| - name: Disable testing the tools crate if cross compiling | |
| id: test-options | |
| if: ${{ !matrix.skip-tests }} | |
| run: | | |
| echo "CARGO_TEST_OPTIONS=${CARGO_TEST_OPTIONS} --exclude tools" >> $GITHUB_OUTPUT | |
| - name: Install cargo nextest | |
| if: ${{ !matrix.skip-tests }} | |
| uses: taiki-e/install-action@9ba3ac3fd006a70c6e186a683577abc1ccf0ff3a # v2.54.0 | |
| with: | |
| tool: cargo-nextest | |
| - name: Run tests | |
| if: ${{ !matrix.skip-tests }} | |
| env: | |
| GOOGLE_CLOUD_TEST_KEY_JSON: ${{ secrets.GOOGLE_CLOUD_TEST_KEY_JSON }} | |
| RATTLER_TEST_R2_READONLY_ACCESS_KEY_ID: ${{ secrets.RATTLER_TEST_R2_READONLY_ACCESS_KEY_ID }} | |
| RATTLER_TEST_R2_READONLY_SECRET_ACCESS_KEY: ${{ secrets.RATTLER_TEST_R2_READONLY_SECRET_ACCESS_KEY }} | |
| run: > | |
| cargo nextest run | |
| --workspace | |
| --features ${{ env.DEFAULT_FEATURES }} | |
| --target ${{ matrix.target }} | |
| ${{ steps.build-options.outputs.CARGO_BUILD_OPTIONS }} | |
| ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS }} | |
| - name: Run doctests | |
| if: ${{ !matrix.skip-tests }} | |
| run: > | |
| cargo test --doc |