fork/cargo
git clone https://git.julia.blue/fork/cargo
b646f8393
0.90.0
1name : CI 2on : 3merge_group : 4pull_request : 5branches : 6- "**" 7 8defaults : 9run : 10shell : bash 11 12permissions : 13contents : read 14 15concurrency : 16group : "${{ github.workflow }}-${{ github.ref }}" 17cancel-in-progress : true 18 19jobs : 20conclusion : 21needs : 22- build_std 23- clippy 24- msrv 25- docs 26- lint-docs 27- lockfile 28- resolver 29- rustfmt 30- schema 31- test 32- test_gitoxide 33permissions : 34contents : none 35# We need to ensure this job does *not* get skipped if its dependencies fail, 36# because a skipped job is considered a success by GitHub. So we have to 37# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run 38# when the workflow is canceled manually. 39# 40# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! 41if : ${{ !cancelled() }} 42runs-on : ubuntu-latest 43steps : 44# Manually check the status of all dependencies. `if: failure()` does not work. 45- name : Conclusion 46run : | 47# Print the dependent jobs to see them in the CI log 48jq -C <<< '${{ toJson(needs) }}' 49# Check if all jobs that we depend on (in the needs array) were successful. 50jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' 51 52# Check Code style quickly by running `rustfmt` over all code 53rustfmt : 54runs-on : ubuntu-latest 55steps : 56- uses : actions/checkout@v4 57- run : rustup update stable && rustup default stable 58- run : rustup component add rustfmt 59- run : cargo fmt --all --check 60 61# Ensure there are no clippy warnings 62clippy : 63runs-on : ubuntu-latest 64steps : 65- uses : actions/checkout@v4 66- run : rustup update stable && rustup default stable 67- run : rustup component add clippy 68- run : cargo clippy --workspace --all-targets --no-deps -- -D warnings 69 70stale-label : 71runs-on : ubuntu-latest 72steps : 73- uses : actions/checkout@v4 74- run : rustup update stable && rustup default stable 75- run : cargo stale-label 76 77lint-docs : 78runs-on : ubuntu-latest 79steps : 80- uses : actions/checkout@v4 81- run : rustup update stable && rustup default stable 82- run : cargo lint-docs --check 83 84# Ensure Cargo.lock is up-to-date 85lockfile : 86runs-on : ubuntu-latest 87steps : 88- uses : actions/checkout@v4 89- run : rustup update stable && rustup default stable 90- run : cargo update -p cargo --locked 91 92check-version-bump : 93runs-on : ubuntu-latest 94env : 95BASE_SHA : ${{ github.event.pull_request.base.sha }} 96HEAD_SHA : ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }} 97steps : 98- uses : actions/checkout@v4 99with : 100fetch-depth : 0 101- run : rustup update stable && rustup default stable 102- name : Install cargo-semver-checks 103run : | 104mkdir installed-bins 105curl -Lf https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.41.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz \ 106| tar -xz --directory=./installed-bins 107echo `pwd`/installed-bins >> $GITHUB_PATH 108- run : ci/validate-version-bump.sh 109 110test : 111runs-on : ${{ matrix.os }} 112env : 113CARGO_PROFILE_DEV_DEBUG : 1 114CARGO_PROFILE_TEST_DEBUG : 1 115CARGO_INCREMENTAL : 0 116CARGO_PUBLIC_NETWORK_TESTS : 1 117# Workaround for https://github.com/rust-lang/rustup/issues/3036 118RUSTUP_WINDOWS_PATH_ADD_BIN : 0 119strategy : 120matrix : 121include : 122- name : Linux x86_64 stable 123os : ubuntu-latest 124rust : stable 125other : i686-unknown-linux-gnu 126- name : Linux x86_64 beta 127os : ubuntu-latest 128rust : beta 129other : i686-unknown-linux-gnu 130- name : Linux x86_64 nightly 131os : ubuntu-latest 132rust : nightly 133other : i686-unknown-linux-gnu 134- name : Linux aarch64 stable 135os : ubuntu-24.04-arm 136rust : stable 137other : TODO # cross-compile tests are disabled, this shouldn't matter. 138- name : Linux aarch64 nightly 139os : ubuntu-24.04-arm 140rust : nightly 141other : TODO # cross-compile tests are disabled, this shouldn't matter. 142- name : macOS aarch64 stable 143os : macos-14 144rust : stable 145other : x86_64-apple-darwin 146- name : macOS x86_64 nightly 147os : macos-13 148rust : nightly 149other : x86_64-apple-ios 150- name : macOS aarch64 nightly 151os : macos-14 152rust : nightly 153other : x86_64-apple-darwin 154- name : Windows x86_64 MSVC stable 155os : windows-latest 156rust : stable-msvc 157other : i686-pc-windows-msvc 158- name : Windows x86_64 MSVC nightly 159os : windows-latest 160rust : nightly-msvc 161other : i686-pc-windows-msvc 162- name : Windows x86_64 gnu nightly # runs out of space while trying to link the test suite 163os : windows-latest 164rust : nightly-gnu 165other : i686-pc-windows-gnu 166name : Tests ${{ matrix.name }} 167steps : 168- uses : actions/checkout@v4 169- name : Dump Environment 170run : ci/dump-environment.sh 171# Some tests require stable. Make sure it is set to the most recent stable 172# so that we can predictably handle updates if necessary (and not randomly 173# when GitHub updates its image). 174- run : rustup update --no-self-update stable 175- run : rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} 176- run : rustup target add ${{ matrix.other }} 177if : matrix.os != 'ubuntu-24.04-arm' # cross-compile tests are disabled on ARM machines 178- run : rustup target add wasm32-unknown-unknown 179- run : rustup target add aarch64-unknown-none # need this for build-std mock tests 180if : startsWith(matrix.rust, 'nightly') 181- run : rustup component add rustc-dev llvm-tools-preview rust-docs 182if : startsWith(matrix.rust, 'nightly') 183- run : sudo apt update -y && sudo apt install lldb gcc-multilib libsecret-1-0 libsecret-1-dev -y 184if : matrix.os == 'ubuntu-latest' 185- run : rustup component add rustfmt || echo "rustfmt not available" 186- name : Add Windows debuggers bin to PATH 187shell : pwsh 188run : Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64" 189if : matrix.os == 'windows-latest' 190- name : Configure extra test environment 191run : echo CARGO_CONTAINER_TESTS=1 >> $GITHUB_ENV 192if : matrix.os == 'ubuntu-latest' 193- run : cargo test -p cargo 194- name : Clear intermediate test output 195run : ci/clean-test-output.sh 196 197- name : gitoxide tests (all git-related tests) 198run : cargo test -p cargo git 199env : 200__CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1 201# The testsuite generates a huge amount of data, and fetch-smoke-test was 202# running out of disk space. 203- name : Clear test output 204run : ci/clean-test-output.sh 205 206# This only tests `cargo fix` because fix-proxy-mode is one of the most 207# complicated subprocess management in Cargo. 208- name : Check operability of rustc invocation with argfile 209run : 'cargo test -p cargo --test testsuite -- fix::' 210env : 211__CARGO_TEST_FORCE_ARGFILE : 1 212- run : cargo test --workspace --exclude cargo --exclude benchsuite --exclude resolver-tests 213- name : Check benchmarks 214run : | 215# This only tests one benchmark since it can take over 10 minutes to 216# download all workspaces. 217cargo test -p benchsuite --all-targets -- cargo 218cargo check -p capture 219# The testsuite generates a huge amount of data, and fetch-smoke-test was 220# running out of disk space. 221- name : Clear benchmark output 222run : ci/clean-test-output.sh 223 224- name : Fetch smoke test 225run : ci/fetch-smoke-test.sh 226 227schema : 228runs-on : ubuntu-latest 229steps : 230- uses : actions/checkout@v4 231- run : rustup update stable && rustup default stable 232- run : cargo test -p cargo-util-schemas -F unstable-schema 233 234resolver : 235runs-on : ubuntu-latest 236steps : 237- uses : actions/checkout@v4 238- run : rustup update stable && rustup default stable 239- run : cargo test -p resolver-tests 240 241test_gitoxide : 242runs-on : ubuntu-latest 243steps : 244- uses : actions/checkout@v4 245- run : rustup update --no-self-update stable && rustup default stable 246- run : rustup target add i686-unknown-linux-gnu 247- run : rustup target add wasm32-unknown-unknown 248- run : sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y 249- run : rustup component add rustfmt || echo "rustfmt not available" 250- run : cargo test -p cargo 251env : 252__CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1 253 254build_std : 255runs-on : ubuntu-latest 256steps : 257- uses : actions/checkout@v4 258- run : rustup update nightly && rustup default nightly 259- run : rustup component add rust-src 260- run : cargo build 261- run : cargo test -p cargo --test build-std 262env : 263CARGO_RUN_BUILD_STD_TESTS : 1 264docs : 265runs-on : ubuntu-latest 266steps : 267- uses : actions/checkout@v4 268- run : rustup update nightly && rustup default nightly 269- run : rustup update stable 270- run : rustup component add rust-docs 271- run : ci/validate-man.sh 272# This requires rustfmt, use stable. 273- name : Run semver-check 274run : cargo +stable run -p semver-check 275- name : Ensure intradoc links are valid 276run : cargo doc --workspace --document-private-items --no-deps 277env : 278RUSTDOCFLAGS : -D warnings 279- name : Install mdbook 280run : | 281mkdir mdbook 282curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.44/mdbook-v0.4.44-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook 283echo `pwd`/mdbook >> $GITHUB_PATH 284- run : cd src/doc && mdbook build --dest-dir ../../target/doc 285- name : Run linkchecker.sh 286run : | 287cd target 288curl -sSLO https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh 289sh linkcheck.sh --all --path ../src/doc cargo 290 291msrv : 292runs-on : ubuntu-latest 293steps : 294- uses : actions/checkout@v4 295- uses : taiki-e/install-action@cargo-hack 296- run : cargo hack check --all-targets --rust-version --workspace --ignore-private --locked