CI: Replace most unmaintained `actions-rs/*` actions

The actions-rs/* actions are unmaintained. See actions-rs/toolchain#216
for more information.

- actions-rs/toolchain is replaced by rust-toolchain.toml.
- actions-rs/cargo is replaced by direct cargo usage.
- actions-rs/tarpaulin is replaced by the cargo-tarpaulin container.

We currently retain a few usages due to a current lack of alternatives:

- actions-rs/toolchain to enable beta (for Clippy warnings) and nightly
  (for building the book).
- actions-rs/clippy-check so Clippy results are published as annotations
  on PRs.

We also now require via rust-toolchain.toml that people building from
the repo have the clippy and rustfmt components installed. This is fine
because they will need to ensure these pass when making PRs.
This commit is contained in:
Jack Grigg 2023-02-01 17:18:24 +00:00
parent 847c187beb
commit a4d7254406
3 changed files with 16 additions and 85 deletions

View File

@ -16,10 +16,7 @@ jobs:
override: true override: true
- name: Build latest rustdocs - name: Build latest rustdocs
uses: actions-rs/cargo@v1 run: cargo doc --no-deps --workspace --all-features
with:
command: doc
args: --no-deps --workspace --all-features
env: env:
RUSTDOCFLAGS: -Z unstable-options --enable-index-page --cfg docsrs RUSTDOCFLAGS: -Z unstable-options --enable-index-page --cfg docsrs

View File

@ -12,11 +12,6 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
override: true
- name: Fetch path to Zcash parameters - name: Fetch path to Zcash parameters
working-directory: ./zcash_proofs working-directory: ./zcash_proofs
shell: bash shell: bash
@ -33,16 +28,9 @@ jobs:
run: cargo run --release --example download-params --features download-params run: cargo run --release --example download-params --features download-params
- name: Run tests - name: Run tests
uses: actions-rs/cargo@v1 run: cargo test --all-features --verbose --release --all
with:
command: test
args: --all-features --verbose --release --all
- name: Run slow tests - name: Run slow tests
uses: actions-rs/cargo@v1 run: cargo test --all-features --verbose --release --all -- --ignored
with:
command: test
args: --all-features --verbose --release --all -- --ignored
- name: Verify working directory is clean - name: Verify working directory is clean
run: git diff --exit-code run: git diff --exit-code
@ -56,16 +44,9 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
override: true
- name: Add target - name: Add target
run: rustup target add ${{ matrix.target }} run: rustup target add ${{ matrix.target }}
- name: cargo fetch - run: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
- name: Build zcash_proofs for target - name: Build zcash_proofs for target
working-directory: ./zcash_proofs working-directory: ./zcash_proofs
run: cargo build --verbose --no-default-features --target ${{ matrix.target }} run: cargo build --verbose --no-default-features --target ${{ matrix.target }}
@ -76,35 +57,22 @@ jobs:
bitrot: bitrot:
name: Bitrot check name: Bitrot check
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
override: true
# Build benchmarks to prevent bitrot # Build benchmarks to prevent bitrot
- name: Build benchmarks - name: Build benchmarks
uses: actions-rs/cargo@v1 run: cargo build --all --benches
with:
command: build
args: --all --benches
clippy: clippy:
name: Clippy (1.60.0) name: Clippy (MSRV)
timeout-minutes: 30 timeout-minutes: 30
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
components: clippy
override: true
- name: Run clippy - name: Run clippy
uses: actions-rs/clippy-check@v1 uses: actions-rs/clippy-check@v1
with: with:
name: Clippy (1.60.0) name: Clippy (MSRV)
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings args: --all-features --all-targets -- -D warnings
@ -131,21 +99,12 @@ jobs:
codecov: codecov:
name: Code coverage name: Code coverage
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
# Use stable for this to ensure that cargo-tarpaulin can be built and has the source
# coverage features released in 1.60.0.
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-tarpaulin
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-tarpaulin
- name: Fetch path to Zcash parameters - name: Fetch path to Zcash parameters
working-directory: ./zcash_proofs working-directory: ./zcash_proofs
shell: bash shell: bash
@ -162,35 +121,19 @@ jobs:
run: cargo run --release --example download-params --features download-params run: cargo run --release --example download-params --features download-params
- name: Generate coverage report - name: Generate coverage report
uses: actions-rs/cargo@v1 run: cargo tarpaulin --engine llvm --all-features --release --timeout 600 --out Xml
with:
command: tarpaulin
args: --engine llvm --all-features --release --timeout 600 --out Xml
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.1 uses: codecov/codecov-action@v3.1.1
doc-links: doc-links:
name: Intra-doc links name: Intra-doc links
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1 - run: cargo fetch
with: # Requires #![deny(rustdoc::broken_intra_doc_links)] in crates.
toolchain: 1.60.0
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch
# Ensure intra-documentation links all resolve correctly
# Requires #![deny(intra_doc_link_resolution_failure)] in crates.
- name: Check intra-doc links - name: Check intra-doc links
uses: actions-rs/cargo@v1 run: cargo doc --all --document-private-items
with:
command: doc
args: --all --document-private-items
fmt: fmt:
name: Rustfmt name: Rustfmt
@ -198,15 +141,5 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.60.0
override: true
# Ensure all code has been formatted with rustfmt
- run: rustup component add rustfmt
- name: Check formatting - name: Check formatting
uses: actions-rs/cargo@v1 run: cargo fmt --all -- --check
with:
command: fmt
args: --all -- --check

View File

@ -1,2 +1,3 @@
[toolchain] [toolchain]
channel = "1.60.0" channel = "1.60.0"
components = [ "clippy", "rustfmt" ]