Skip to content

Commit

Permalink
chore: update GitHub Actions CI
Browse files Browse the repository at this point in the history
The following updates are performed:
* update actions/checkout to v4
* replace unmaintained actions-rs/toolchain by dtolnay/rust-toolchain
* replace unmaintained actions-rs/cargo by direct invocation of cargo
  • Loading branch information
striezel committed Jul 23, 2024
1 parent 74e925d commit 501f0cd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 64 deletions.
74 changes: 21 additions & 53 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
profile: minimal
override: true
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --all-features --all-targets
run: cargo check --workspace --all-features --all-targets

check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
profile: minimal
- name: cargo doc
working-directory: ${{ matrix.subcrate }}
env:
Expand All @@ -45,36 +39,27 @@ jobs:
steps:
- uses: actions/checkout@master
- name: "install Rust ${{ env.MSRV }}"
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
profile: minimal
- name: "install Rust nightly"
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
profile: minimal
- name: Select minimal versions
uses: actions-rs/cargo@v1
with:
command: update
args: -Z minimal-versions
toolchain: nightly
run: cargo update -Z minimal-versions
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --all --all-targets --all-features --locked
toolchain: ${{ env.MSRV }}
run: |
rustup default ${{ env.MSRV }}
cargo check --all --all-targets --all-features --locked
cargo-hack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
profile: minimal
- name: install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo hack check
Expand All @@ -95,66 +80,49 @@ jobs:
steps:
- uses: actions/checkout@master
- name: "install Rust ${{ matrix.rust }}"
uses: actions-rs/toolchain@v1
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-msrv
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: "install Rust ${{ env.MSRV }}"
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
profile: minimal
- name: "install Rust nightly"
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
profile: minimal
- name: Select minimal versions
uses: actions-rs/cargo@v1
with:
command: update
args: -Z minimal-versions
toolchain: nightly
run: cargo update -Z minimal-versions
- name: test
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace --all-features --locked
toolchain: ${{ env.MSRV }}
run: |
rustup default ${{ env.MSRV }}
cargo check --workspace --all-features --locked
style:
needs: check-stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
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
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
13 changes: 3 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Install nightly Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
profile: minimal
- name: Generate documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace --no-deps --all-features
# Tower uses nightly-only RustDoc features
toolchain: nightly
run: cargo doc --workspace --no-deps --all-features
env:
# Enable the RustDoc `#[doc(cfg(...))]` attribute.
RUSTDOCFLAGS: --cfg docsrs
Expand All @@ -36,4 +30,3 @@ jobs:
build_dir: target/doc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: github.repository_owner == 'tower-rs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: taiki-e/[email protected]
with:
prefix: "(tower)|(tower-[a-z]+)"
Expand Down

0 comments on commit 501f0cd

Please sign in to comment.