From 10650435281bd98027b3b60a2b26bb8a243f0b02 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 25 Nov 2022 17:00:59 +0000 Subject: [PATCH] ci: use dtolnay's rust-toolchain action --- .github/workflows/ci-post-merge.yml | 33 ++++++------------------ .github/workflows/ci.yml | 23 ++++------------- .github/workflows/clippy-fmt.yml | 39 ++++++++--------------------- .github/workflows/upload-doc.yml | 14 +++-------- 4 files changed, 28 insertions(+), 81 deletions(-) diff --git a/.github/workflows/ci-post-merge.yml b/.github/workflows/ci-post-merge.yml index 6d76301d..7ac6388d 100644 --- a/.github/workflows/ci-post-merge.yml +++ b/.github/workflows/ci-post-merge.yml @@ -95,29 +95,21 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable-x86_64-unknown-linux-gnu - profile: minimal - override: true + - uses: dtolnay/rust-toolchain@stable - name: Install cargo-hack uses: taiki-e/install-action@cargo-hack - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: { command: generate-lockfile } + run: cargo generate-lockfile - name: Cache Dependencies uses: Swatinem/rust-cache@v1.2.0 - name: check feature combinations - uses: actions-rs/cargo@v1 - with: { command: ci-check-all-feature-powerset } - + run: cargo ci-check-all-feature-powerset + - name: check feature combinations - uses: actions-rs/cargo@v1 - with: { command: ci-check-all-feature-powerset-linux } + run: cargo ci-check-all-feature-powerset-linux nextest: name: nextest @@ -130,24 +122,15 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true + - uses: dtolnay/rust-toolchain@stable - name: Install nextest uses: taiki-e/install-action@nextest - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: { command: generate-lockfile } + run: cargo generate-lockfile - name: Cache Dependencies uses: Swatinem/rust-cache@v1.3.0 - name: Test with cargo-nextest - uses: actions-rs/cargo@v1 - with: - command: nextest - args: run + run: cargo nextest run diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07e21ef4..b45f5469 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,16 +99,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable-x86_64-unknown-linux-gnu - profile: minimal - override: true + - uses: dtolnay/rust-toolchain@stable - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: { command: generate-lockfile } + run: cargo generate-lockfile - name: Cache Dependencies uses: Swatinem/rust-cache@v1.3.0 @@ -126,20 +120,13 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install Rust (nightly) - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly-x86_64-unknown-linux-gnu - profile: minimal - override: true + - uses: dtolnay/rust-toolchain@nightly - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: { command: generate-lockfile } + run: cargo generate-lockfile - name: Cache Dependencies uses: Swatinem/rust-cache@v1.3.0 - name: doc tests - uses: actions-rs/cargo@v1 + run: cargo ci-doctest timeout-minutes: 60 - with: { command: ci-doctest } diff --git a/.github/workflows/clippy-fmt.yml b/.github/workflows/clippy-fmt.yml index bc2cec14..1587a0b1 100644 --- a/.github/workflows/clippy-fmt.yml +++ b/.github/workflows/clippy-fmt.yml @@ -9,54 +9,37 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rustfmt - - name: Check with rustfmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - uses: dtolnay/rust-toolchain@nightly + - run: cargo fmt --all -- --check clippy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: clippy - override: true + - uses: dtolnay/rust-toolchain@stable + with: { components: clippy } - name: Generate Cargo.lock uses: actions-rs/cargo@v1 - with: { command: generate-lockfile } + run: cargo generate-lockfile - name: Cache Dependencies uses: Swatinem/rust-cache@v1.2.0 - + - name: Check with Clippy uses: actions-rs/clippy-check@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} args: --workspace --tests --examples --all-features + token: ${{ secrets.GITHUB_TOKEN }} lint-docs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - components: rust-docs + + - uses: dtolnay/rust-toolchain@stable + with: { components: rust-docs } + - name: Check for broken intra-doc links uses: actions-rs/cargo@v1 env: diff --git a/.github/workflows/upload-doc.yml b/.github/workflows/upload-doc.yml index ac181b3f..9aadafaf 100644 --- a/.github/workflows/upload-doc.yml +++ b/.github/workflows/upload-doc.yml @@ -15,18 +15,12 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly-x86_64-unknown-linux-gnu - profile: minimal - override: true + - uses: dtolnay/rust-toolchain@nightly - name: Build Docs - uses: actions-rs/cargo@v1 - with: - command: doc - args: --workspace --all-features --no-deps + run: cargo +nightly doc --no-deps --workspace --all-features + env: + RUSTDOCFLAGS: --cfg=docsrs - name: Tweak HTML run: echo '' > target/doc/index.html