diff options
author | tottoto <tottotodev@gmail.com> | 2023-04-16 00:02:47 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-15 17:02:47 +0200 |
commit | de7dc69eeb938c03a823b1f53b5ec9f68567cf24 (patch) | |
tree | abb970fa3afc0f84efd08da94c2ae9cbc54a90d5 /.github | |
parent | 7219fd8df520d295faa42b59f77e25ca2818b6b1 (diff) |
Resolve ci warnings (#1938)
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/CI.yml | 155 |
1 files changed, 63 insertions, 92 deletions
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 31a98324..4424f90e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,31 +14,23 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v3 + - uses: taiki-e/install-action@protoc - uses: dtolnay/rust-toolchain@beta with: components: clippy, rustfmt - uses: Swatinem/rust-cache@v2 - name: Check - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --workspace --all-targets --all-features -- -D warnings + run: cargo clippy --workspace --all-targets --all-features -- -D warnings - name: rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check + run: cargo fmt --all --check check-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: cargo doc env: RUSTDOCFLAGS: "-D rustdoc::all -A rustdoc::private-doc-tests" @@ -47,10 +39,10 @@ jobs: cargo-hack: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: arduino/setup-protoc@v1 + - uses: actions/checkout@v3 + - uses: taiki-e/install-action@protoc - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Install cargo-hack run: | curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin @@ -63,9 +55,9 @@ jobs: matrix: crate: [axum, axum-core, axum-extra, axum-macros] steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@nightly - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Install cargo-public-api-crates run: | cargo install --git https://github.com/davidpdrsn/cargo-public-api-crates @@ -79,33 +71,29 @@ jobs: matrix: rust: [stable, beta] steps: - - uses: actions/checkout@master - - uses: arduino/setup-protoc@v1 + - uses: actions/checkout@v3 + - uses: taiki-e/install-action@protoc - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --all --all-features --all-targets + run: cargo test --workspace --all-features --all-targets # some examples doesn't support our MSRV so we only test axum itself on our MSRV test-nightly: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: # same as `axum-macros/rust-toolchain` toolchain: nightly-2022-11-18 - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Run nightly tests working-directory: axum-macros - run: | - cargo test + run: cargo test # some examples doesn't support our MSRV (such as async-graphql) # so we only test axum itself on our MSRV @@ -113,63 +101,48 @@ jobs: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.MSRV }} - name: "install Rust nightly" uses: dtolnay/rust-toolchain@nightly - - uses: Swatinem/rust-cache@v1 - - name: Select minimal versions - uses: actions-rs/cargo@v1 - with: - command: update - args: -Z minimal-versions - toolchain: nightly + - uses: Swatinem/rust-cache@v2 + - name: Select minimal version + run: cargo +nightly update -Z minimal-versions - name: Fix up Cargo.lock - uses: actions-rs/cargo@v1 - with: - command: update - args: -p crc32fast --precise 1.1.1 - toolchain: nightly + run: cargo +nightly update -p crc32fast --precise 1.1.1 - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: > - -p axum - -p axum-extra - -p axum-core - --all-features - --all-targets - --locked - toolchain: ${{ env.MSRV }} + run: > + cargo +${{ env.MSRV }} + test + -p axum + -p axum-extra + -p axum-core + --all-features + --all-targets + --locked # the compiler errors are different on our MSRV which makes # the trybuild tests in axum-macros fail, so just run the doc # tests - name: Run axum-macros doc tests - uses: actions-rs/cargo@v1 - with: - command: test - args: > - -p axum-macros - --doc - --all-features - --locked - toolchain: ${{ env.MSRV }} + run: > + cargo +${{ env.MSRV }} + test + -p axum-macros + --doc + --all-features + --locked test-docs: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Run doc tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --doc + run: cargo test --all-features --doc deny-check: name: cargo-deny check @@ -181,7 +154,7 @@ jobs: - advisories - bans licenses sources steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: EmbarkStudios/cargo-deny-action@v1 with: command: check ${{ matrix.checks }} @@ -191,48 +164,46 @@ jobs: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable with: target: armv5te-unknown-linux-musleabi - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Check - uses: actions-rs/cargo@v1 env: # Clang has native cross-compilation support CC: clang - with: - command: check - args: > - --all-targets - --all-features - -p axum - -p axum-core - -p axum-extra - -p axum-macros - --target armv5te-unknown-linux-musleabi + run: > + cargo + check + --all-targets + --all-features + -p axum + -p axum-core + -p axum-extra + -p axum-macros + --target armv5te-unknown-linux-musleabi wasm32-unknown-unknown: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable with: target: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Check - uses: actions-rs/cargo@v1 - with: - command: check - args: > - --manifest-path ./examples/simple-router-wasm/Cargo.toml - --target wasm32-unknown-unknown + run: > + cargo + check + --manifest-path ./examples/simple-router-wasm/Cargo.toml + --target wasm32-unknown-unknown dependencies-are-sorted: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@beta - uses: Swatinem/rust-cache@v2 - name: Install cargo-sort |