fork/cargo
git clone https://git.julia.blue/fork/cargo
0865ee859
0.89.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.41.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 : Linux aarch64 stable 134os : ubuntu-24.04-arm 135rust : stable 136other : TODO # cross-compile tests are disabled, this shouldn't matter. 137- name : Linux aarch64 nightly 138os : ubuntu-24.04-arm 139rust : nightly 140other : TODO # cross-compile tests are disabled, this shouldn't matter. 141- name : macOS aarch64 stable 142os : macos-14 143rust : stable 144other : x86_64-apple-darwin 145- name : macOS x86_64 nightly 146os : macos-13 147rust : nightly 148other : x86_64-apple-ios 149- name : macOS aarch64 nightly 150os : macos-14 151rust : nightly 152other : x86_64-apple-darwin 153- name : Windows x86_64 MSVC stable 154os : windows-latest 155rust : stable-msvc 156other : i686-pc-windows-msvc 157- name : Windows x86_64 gnu nightly # runs out of space while trying to link the test suite 158os : windows-latest 159rust : nightly-gnu 160other : i686-pc-windows-gnu 161name : Tests ${{ matrix.name }} 162steps : 163- uses : actions/checkout@v4 164- name : Dump Environment 165run : ci/dump-environment.sh 166# Some tests require stable. Make sure it is set to the most recent stable 167# so that we can predictably handle updates if necessary (and not randomly 168# when GitHub updates its image). 169- run : rustup update --no-self-update stable 170- run : rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} 171- run : rustup target add ${{ matrix.other }} 172if : matrix.os != 'ubuntu-24.04-arm' # cross-compile tests are disabled on ARM machines 173- run : rustup target add wasm32-unknown-unknown 174- run : rustup target add aarch64-unknown-none # need this for build-std mock tests 175if : startsWith(matrix.rust, 'nightly') 176- run : rustup component add rustc-dev llvm-tools-preview rust-docs 177if : startsWith(matrix.rust, 'nightly') 178- run : sudo apt update -y && sudo apt install lldb gcc-multilib libsecret-1-0 libsecret-1-dev -y 179if : matrix.os == 'ubuntu-latest' 180- run : rustup component add rustfmt || echo "rustfmt not available" 181- name : Configure extra test environment 182run : echo CARGO_CONTAINER_TESTS=1 >> $GITHUB_ENV 183if : matrix.os == 'ubuntu-latest' 184- run : cargo test -p cargo 185- name : Clear intermediate test output 186run : ci/clean-test-output.sh 187 188- name : gitoxide tests (all git-related tests) 189run : cargo test -p cargo git 190env : 191__CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1 192# The testsuite generates a huge amount of data, and fetch-smoke-test was 193# running out of disk space. 194- name : Clear test output 195run : ci/clean-test-output.sh 196 197# This only tests `cargo fix` because fix-proxy-mode is one of the most 198# complicated subprocess management in Cargo. 199- name : Check operability of rustc invocation with argfile 200run : 'cargo test -p cargo --test testsuite -- fix::' 201env : 202__CARGO_TEST_FORCE_ARGFILE : 1 203- run : cargo test --workspace --exclude cargo --exclude benchsuite --exclude resolver-tests 204- name : Check benchmarks 205run : | 206# This only tests one benchmark since it can take over 10 minutes to 207# download all workspaces. 208cargo test -p benchsuite --all-targets -- cargo 209cargo check -p capture 210# The testsuite generates a huge amount of data, and fetch-smoke-test was 211# running out of disk space. 212- name : Clear benchmark output 213run : ci/clean-test-output.sh 214 215- name : Fetch smoke test 216run : ci/fetch-smoke-test.sh 217 218schema : 219runs-on : ubuntu-latest 220steps : 221- uses : actions/checkout@v4 222- run : rustup update stable && rustup default stable 223- run : cargo test -p cargo-util-schemas -F unstable-schema 224 225resolver : 226runs-on : ubuntu-latest 227steps : 228- uses : actions/checkout@v4 229- run : rustup update stable && rustup default stable 230- run : cargo test -p resolver-tests 231 232test_gitoxide : 233runs-on : ubuntu-latest 234steps : 235- uses : actions/checkout@v4 236- run : rustup update --no-self-update stable && rustup default stable 237- run : rustup target add i686-unknown-linux-gnu 238- run : rustup target add wasm32-unknown-unknown 239- run : sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y 240- run : rustup component add rustfmt || echo "rustfmt not available" 241- run : cargo test -p cargo 242env : 243__CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2 : 1 244 245build_std : 246runs-on : ubuntu-latest 247steps : 248- uses : actions/checkout@v4 249- run : rustup update nightly && rustup default nightly 250- run : rustup component add rust-src 251- run : cargo build 252- run : cargo test -p cargo --test build-std 253env : 254CARGO_RUN_BUILD_STD_TESTS : 1 255docs : 256runs-on : ubuntu-latest 257steps : 258- uses : actions/checkout@v4 259- run : rustup update nightly && rustup default nightly 260- run : rustup update stable 261- run : rustup component add rust-docs 262- run : ci/validate-man.sh 263# This requires rustfmt, use stable. 264- name : Run semver-check 265run : cargo +stable run -p semver-check 266- name : Ensure intradoc links are valid 267run : cargo doc --workspace --document-private-items --no-deps 268env : 269RUSTDOCFLAGS : -D warnings 270- name : Install mdbook 271run : | 272mkdir mdbook 273curl -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 274echo `pwd`/mdbook >> $GITHUB_PATH 275- run : cd src/doc && mdbook build --dest-dir ../../target/doc 276- name : Run linkchecker.sh 277run : | 278cd target 279curl -sSLO https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh 280sh linkcheck.sh --all --path ../src/doc cargo 281 282msrv : 283runs-on : ubuntu-latest 284steps : 285- uses : actions/checkout@v4 286- uses : taiki-e/install-action@cargo-hack 287- run : cargo hack check --all-targets --rust-version --workspace --ignore-private --locked