From d895678bd70ae894f2001d30a3499995eab874ce Mon Sep 17 00:00:00 2001 From: tottoto Date: Thu, 22 Jun 2023 21:10:08 +0900 Subject: [PATCH] Update ci config (#378) * Replace actions-rs/toolchain with dtolnay/rust-toolchain * Replace actions-rs/cargo with run * Update Swatinem/rust-cache to v2 * Fix yaml indent style * Use stable version of actions/checkout * Use taiki-e/install-action to install cargo-hack --- .github/workflows/CI.yml | 95 ++++++++++++---------------------------- 1 file changed, 27 insertions(+), 68 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7e8e75d6..a689ef4a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,26 +10,15 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - name: Check - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace --all-features --all-targets + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --workspace --all-features --all-targets check-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable - name: cargo doc working-directory: ${{ matrix.subcrate }} env: @@ -39,14 +28,9 @@ jobs: cargo-hack: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - 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 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - uses: taiki-e/install-action@cargo-hack - name: cargo hack check working-directory: ${{ matrix.subcrate }} env: @@ -61,50 +45,29 @@ jobs: matrix: rust: [stable, beta, nightly] steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - profile: minimal - override: true - - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --all-features + - run: cargo test --workspace --all-features test-msrv: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - profile: minimal - override: true - - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: -p tower-http --all-features - toolchain: 1.60.0 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@1.60.0 + - run: cargo test -p tower-http --all-features style: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable with: - toolchain: stable components: rustfmt - profile: minimal - - name: rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - run: cargo fmt --all --check deny-check: name: cargo-deny check @@ -113,25 +76,21 @@ jobs: strategy: matrix: checks: - - advisories - - bans licenses sources + - advisories + - bans licenses sources steps: - - uses: actions/checkout@v2 - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - command: check ${{ matrix.checks }} - arguments: --all-features --manifest-path tower-http/Cargo.toml + - uses: actions/checkout@v3 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check ${{ matrix.checks }} + arguments: --all-features --manifest-path tower-http/Cargo.toml cargo-public-api-crates: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: nightly - override: true - profile: minimal - - uses: Swatinem/rust-cache@v1 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 - name: Install cargo-public-api-crates run: | cargo install --git https://github.com/davidpdrsn/cargo-public-api-crates