Merge pull request #1158 from miles170/ci-update-actions
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Peter · committed by GitHub · parents ce4e867, fdab5da · Browse files · 1 file·+45 added−47 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- CI: update actions to run on Node 16
Diff stats
1 file+45 added−47 removed
- other:+45 added−47 removed
Provenance
- Commit
45cb15d- Tree
2637f32- Author
David Peter <sharkdp@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent 1
ce4e867- Parent 2
fdab5da
1 file changed+45 added−47 removed
modified:.github/workflows/CICD.yml+45 added-47 removed
17 unmodified lines18 name: Code quality19 runs-on: ubuntu-20.0420 steps:21 - name: Checkout source code22- uses: actions/checkout@v222+ uses: actions/checkout@v323 - name: Install rust toolchain24- uses: actions-rs/toolchain@v125- with:26- toolchain: stable27- default: true28- profile: minimal # minimal component installation (ie, no documentation)29- components: clippy, rustfmt24+ run: |25+ rm -f "${HOME}/.cargo/bin/"{rustfmt,cargo-fmt}26+ rustup set profile minimal27+ rustup toolchain install stable -c "clippy,rustfmt"28+ rustup default stable29+ - name: Rust cache30+ uses: Swatinem/rust-cache@v231 - name: Ensure `cargo fmt` has been run31- uses: actions-rs/cargo@v132- with:33- command: fmt34- args: -- --check32+ run: cargo fmt --check33 - name: Ensure MSRV is set in `clippy.toml`34 run: grep "^msrv = \"${{ env.MIN_SUPPORTED_RUST_VERSION }}\"\$" clippy.toml35 - name: Run clippy38- uses: actions-rs/cargo@v139- with:40- command: clippy41- args: --locked --all-targets --all-features36+ run: cargo clippy --locked --all-targets --all-features37 38 min_version:39 name: Minimum supported rust version40 runs-on: ubuntu-20.0441 steps:42 - name: Checkout source code48- uses: actions/checkout@v243+ uses: actions/checkout@v344 45 - name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }})51- uses: actions-rs/toolchain@v152- with:53- toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}54- default: true55- components: clippy56- profile: minimal46+ run: |47+ rustup set profile minimal48+ rustup toolchain install ${{ env.MIN_SUPPORTED_RUST_VERSION }} -c clippy49+ rustup default ${{ env.MIN_SUPPORTED_RUST_VERSION }}50+ - name: Rust cache51+ uses: Swatinem/rust-cache@v252 - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)58- uses: actions-rs/cargo@v159- with:60- command: clippy61- args: --locked --all-targets --all-features53+ run: cargo clippy --locked --all-targets --all-features54 - name: Run tests63- uses: actions-rs/cargo@v164- with:65- command: test66- args: --locked55+ run: cargo test --locked56 57 build:58 name: ${{ matrix.job.os }} (${{ matrix.job.target }})59 runs-on: ${{ matrix.job.os }}14 unmodified lines74 - { os: windows-2019, target: x86_64-pc-windows-gnu }75 - { os: windows-2019, target: x86_64-pc-windows-msvc }76 steps:77 - name: Checkout source code89- uses: actions/checkout@v278+ uses: actions/checkout@v379 80 - name: Install prerequisites81 shell: bash82 run: |10 unmodified lines93 echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV94 echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV95 96 - name: Install Rust toolchain108- uses: actions-rs/toolchain@v1109- with:110- toolchain: stable111- target: ${{ matrix.job.target }}112- override: true113- profile: minimal # minimal component installation (ie, no documentation)97+ run: |98+ rustup set profile minimal99+ rustup toolchain install stable100+ rustup override set stable101+ rustup target add ${{ matrix.job.target }}102 103 - name: Show version information (Rust, cargo, GCC)104 shell: bash105 run: |3 unmodified lines109 rustup default110 cargo -V111 rustc -V112 125- - name: Build126- uses: actions-rs/cargo@v1113+ - name: Set cargo cmd114+ shell: bash115+ run: echo "CARGO_CMD=cargo" >> $GITHUB_ENV116+117+ - name: Set cargo cmd to cross118+ shell: bash119+ if: ${{ matrix.job.use-cross == true }}120+ run: echo "CARGO_CMD=cross" >> $GITHUB_ENV121+122+ - name: Rust cache123+ uses: Swatinem/rust-cache@v2124 with:128- use-cross: ${{ matrix.job.use-cross }}129- command: build130- args: --locked --release --target=${{ matrix.job.target }}125+ key: ${{ matrix.job.os }}-${{ matrix.job.target }}126 127+ - name: Install cross128+ if: ${{ matrix.job.use-cross == true }}129+ run: cargo install cross130+131+ - name: Build132+ run: ${{ env.CARGO_CMD }} build --locked --release --target=${{ matrix.job.target }}133+134 - name: Strip debug information from executable135 id: strip136 shell: bash137 run: |38 unmodified lines176 unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--bin ${PROJECT_NAME}" ;; esac;177 echo "CARGO_TEST_OPTIONS=${CARGO_TEST_OPTIONS}" >> $GITHUB_OUTPUT178 179 - name: Run tests178- uses: actions-rs/cargo@v1179- with:180- use-cross: ${{ matrix.job.use-cross }}181- command: test182- args: --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}180+ run: ${{ env.CARGO_CMD }} test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}181 182 - name: Generate completions183 id: completions184 shell: bash179 unmodified lines