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