fork/cargo
git clone https://git.julia.blue/fork/cargo
5b48cf2aa
home-0.5.12
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@v5 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@v5 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@v5 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@v5 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@v5 89- run : rustup update stable && rustup default stable 90- run : cargo update -p cargo --locked 91 92check-version-bump : 93runs-on : ubuntu-latest 94if : github.repository_owner == 'rust-lang' 95env : 96BASE_SHA : ${{ github.event.pull_request.base.sha }} 97HEAD_SHA : ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }} 98steps : 99- uses : actions/checkout@v5 100with : 101fetch-depth : 0 102- run : rustup update stable && rustup default stable 103- name : Install cargo-semver-checks 104run : | 105mkdir installed-bins 106curl -Lf https://github.com/obi1kenobi/cargo-semver-checks/releases/download/v0.44.0/cargo-semver-checks-x86_64-unknown-linux-gnu.tar.gz \ 107| tar -xz --directory=./installed-bins 108echo `pwd`/installed-bins >> $GITHUB_PATH 109- run : ci/validate-version-bump.sh 110 111test : 112runs-on : ${{ matrix.os }} 113env : 114CARGO_PROFILE_DEV_DEBUG : 1 115CARGO_PROFILE_TEST_DEBUG : 1 116CARGO_INCREMENTAL : 0 117CARGO_PUBLIC_NETWORK_TESTS : 1 118# Workaround for https://github.com/rust-lang/rustup/issues/3036 119RUSTUP_WINDOWS_PATH_ADD_BIN : 0 120strategy : 121matrix : 122include : 123- name : Linux x86_64 stable 124os : ubuntu-latest 125rust : stable 126other : i686-unknown-linux-gnu 127- name : Linux x86_64 beta 128os : ubuntu-latest 129rust : beta 130other : i686-unknown-linux-gnu 131- name : Linux x86_64 nightly 132os : ubuntu-latest 133rust : nightly 134other : i686-unknown-linux-gnu 135- name : Linux aarch64 stable 136os : ubuntu-24.04-arm 137rust : stable 138other : TODO # cross-compile tests are disabled, this shouldn't matter. 139- name : Linux aarch64 nightly 140os : ubuntu-24.04-arm 141rust : nightly 142other : TODO # cross-compile tests are disabled, this shouldn't matter. 143- name : macOS aarch64 stable 144os : macos-14 145rust : stable 146other : x86_64-apple-darwin 147- name : macOS aarch64 nightly 148os : macos-14 149rust : nightly 150other : x86_64-apple-darwin 151- name : Windows x86_64 MSVC stable 152os : windows-latest 153rust : stable-msvc 154other : i686-pc-windows-msvc 155- name : Windows x86_64 MSVC nightly 156os : windows-latest 157rust : nightly-msvc 158other : i686-pc-windows-msvc 159- name : Windows aarch64 MSVC stable 160os : windows-11-arm 161rust : stable-msvc 162other : i686-pc-windows-msvc 163- name : Windows aarch64 MSVC nightly 164os : windows-11-arm 165rust : nightly-msvc 166other : i686-pc-windows-msvc 167- name : Windows x86_64 gnu nightly # runs out of space while trying to link the test suite 168os : windows-latest 169rust : nightly-gnu 170other : i686-pc-windows-gnu 171name : Tests ${{ matrix.name }} 172steps : 173- uses : actions/checkout@v5 174- name : Dump Environment 175run : ci/dump-environment.sh 176# Some tests require stable. Make sure it is set to the most recent stable 177# so that we can predictably handle updates if necessary (and not randomly 178# when GitHub updates its image). 179- run : rustup update --no-self-update stable 180- run : rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} 181- run : rustup target add ${{ matrix.other }} 182if : matrix.os != 'ubuntu-24.04-arm' # cross-compile tests are disabled on ARM machines 183- run : rustup target add wasm32-unknown-unknown 184- run : rustup target add aarch64-unknown-none # need this for build-std mock tests 185if : startsWith(matrix.rust, 'nightly') 186- run : rustup component add rustc-dev llvm-tools-preview rust-docs 187if : startsWith(matrix.rust, 'nightly') 188- run : sudo apt update -y && sudo apt install lldb gcc-multilib libsecret-1-0 libsecret-1-dev -y 189if : matrix.os == 'ubuntu-latest' 190- run : rustup component add rustfmt || echo "rustfmt not available" 191- name : Add Windows debuggers bin to PATH 192shell : pwsh 193run : Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64" 194if : matrix.os == 'windows-latest' 195- name : Add Windows debuggers bin to PATH 196shell : pwsh 197run : Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64" 198if : matrix.os == 'windows-11-arm' 199- name : Configure extra test environment 200run : echo CARGO_CONTAINER_TESTS=1 >> $GITHUB_ENV 201if : matrix.os == 'ubuntu-latest' 202- run : cargo test -p cargo 203- name : Clear intermediate test output 204run : ci/clean-test-output.sh 205 206- name : gitoxide tests (all git-related tests) 207run : cargo test -p cargo git 208env : 209__CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1 210# The testsuite generates a huge amount of data, and fetch-smoke-test was 211# running out of disk space. 212- name : Clear test output 213run : ci/clean-test-output.sh 214 215# This only tests `cargo fix` because fix-proxy-mode is one of the most 216# complicated subprocess management in Cargo. 217- name : Check operability of rustc invocation with argfile 218run : 'cargo test -p cargo --test testsuite -- fix::' 219env : 220__CARGO_TEST_FORCE_ARGFILE : 1 221- run : cargo test --workspace --exclude cargo --exclude benchsuite --exclude resolver-tests 222- name : Check benchmarks 223run : | 224# This only tests one benchmark since it can take over 10 minutes to 225# download all workspaces. 226cargo test -p benchsuite --all-targets -- cargo 227cargo check -p capture 228# The testsuite generates a huge amount of data, and fetch-smoke-test was 229# running out of disk space. 230- name : Clear benchmark output 231run : ci/clean-test-output.sh 232 233- name : Fetch smoke test 234run : ci/fetch-smoke-test.sh 235 236schema : 237runs-on : ubuntu-latest 238steps : 239- uses : actions/checkout@v5 240- run : rustup update stable && rustup default stable 241- run : cargo test -p cargo-util-schemas -F unstable-schema 242 243resolver : 244runs-on : ubuntu-latest 245steps : 246- uses : actions/checkout@v5 247- run : rustup update stable && rustup default stable 248- run : cargo test -p resolver-tests 249 250test_gitoxide : 251runs-on : ubuntu-latest 252steps : 253- uses : actions/checkout@v5 254- run : rustup update --no-self-update stable && rustup default stable 255- run : rustup target add i686-unknown-linux-gnu 256- run : rustup target add wasm32-unknown-unknown 257- run : sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y 258- run : rustup component add rustfmt || echo "rustfmt not available" 259- run : cargo test -p cargo 260env : 261__CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1 262 263build_std : 264runs-on : ubuntu-latest 265steps : 266- uses : actions/checkout@v5 267- run : rustup update nightly && rustup default nightly 268- run : rustup component add rust-src 269- run : cargo build 270- run : cargo test -p cargo --test build-std 271env : 272CARGO_RUN_BUILD_STD_TESTS : 1 273docs : 274runs-on : ubuntu-latest 275steps : 276- uses : actions/checkout@v5 277- run : rustup update nightly && rustup default nightly 278- run : rustup update stable 279- run : rustup component add rust-docs 280- run : rustup component add rustfmt --toolchain stable 281- run : ci/validate-man.sh 282# This requires rustfmt, use stable. 283- name : Run semver-check 284run : cargo +stable run -p semver-check 285- name : Ensure intradoc links are valid 286run : cargo doc --workspace --document-private-items --no-deps 287env : 288RUSTDOCFLAGS : -D warnings 289- name : Install mdbook 290run : | 291mkdir mdbook 292curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.52/mdbook-v0.4.52-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook 293echo `pwd`/mdbook >> $GITHUB_PATH 294- run : cd src/doc && mdbook build --dest-dir ../../target/doc 295- name : Run linkchecker.sh 296run : | 297cd target 298curl -sSLO https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh 299sh linkcheck.sh --all --path ../src/doc cargo 300 301msrv : 302runs-on : ubuntu-latest 303steps : 304- uses : actions/checkout@v5 305- uses : taiki-e/install-action@cargo-hack 306- run : cargo hack check --all-targets --rust-version --workspace --ignore-private --locked