Skip to content

Merge pull request #643 from zcash/wallet-db-hardening #1549

Merge pull request #643 from zcash/wallet-db-hardening

Merge pull request #643 from zcash/wallet-db-hardening #1549

Workflow file for this run

name: Lints
on:
pull_request:
push:
branches: main
merge_group:
permissions: {}
jobs:
clippy:
name: Clippy (MSRV)
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
# Each chain backend lives in its own workspace (zcash/zallet#540), so each is
# linted separately alongside the shared zallet-core workspace.
- name: Run clippy (zallet-core)
uses: auguwu/clippy-action@94a9ff2f6920180b89e5c03d121d0af04a9d3e03 # 1.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
check-args: >
--workspace
--features zcashd-import,rpc-cli,tokio-console
--all-targets
args: >
-D warnings
- name: Run clippy (zaino backend)
uses: auguwu/clippy-action@94a9ff2f6920180b89e5c03d121d0af04a9d3e03 # 1.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
check-args: >
--manifest-path backends/zaino/Cargo.toml
--features zcashd-import,rpc-cli,tokio-console
--all-targets
args: >
-D warnings
- name: Run clippy (zebra-state backend)
uses: auguwu/clippy-action@94a9ff2f6920180b89e5c03d121d0af04a9d3e03 # 1.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
check-args: >
--manifest-path backends/zebra/Cargo.toml
--features zcashd-import,rpc-cli,tokio-console
--all-targets
args: >
-D warnings
clippy-beta:
name: Clippy (beta)
runs-on: ubuntu-latest
permissions:
checks: write
continue-on-error: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@beta
id: toolchain
with:
components: clippy
- run: rustup override set "${TOOLCHAIN}"
shell: sh
env:
TOOLCHAIN: ${{steps.toolchain.outputs.name}}
- name: Run Clippy (beta, zallet-core)
uses: auguwu/clippy-action@94a9ff2f6920180b89e5c03d121d0af04a9d3e03 # 1.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
check-args: >
--workspace
--features zcashd-import,rpc-cli,tokio-console
--all-targets
args: >
-W clippy::all
- name: Run Clippy (beta, zaino backend)
uses: auguwu/clippy-action@94a9ff2f6920180b89e5c03d121d0af04a9d3e03 # 1.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
check-args: >
--manifest-path backends/zaino/Cargo.toml
--features zcashd-import,rpc-cli,tokio-console
--all-targets
args: >
-W clippy::all
- name: Run Clippy (beta, zebra-state backend)
uses: auguwu/clippy-action@94a9ff2f6920180b89e5c03d121d0af04a9d3e03 # 1.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
check-args: >
--manifest-path backends/zebra/Cargo.toml
--features zcashd-import,rpc-cli,tokio-console
--all-targets
args: >
-W clippy::all
doc-links:
name: Intra-doc links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- run: cargo fetch
- run: cargo fetch --manifest-path backends/zebra/Cargo.toml
- run: cargo fetch --manifest-path backends/zaino/Cargo.toml
# Requires #![deny(rustdoc::broken_intra_doc_links)] in crates.
- name: Check intra-doc links (zallet-core)
run: >
cargo doc
--all
--document-private-items
- name: Check intra-doc links (zebra-state backend)
run: >
cargo doc
--manifest-path backends/zebra/Cargo.toml
--document-private-items
- name: Check intra-doc links (zaino backend)
run: >
cargo doc
--manifest-path backends/zaino/Cargo.toml
--document-private-items
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check formatting (zebra-state backend)
run: cargo fmt --manifest-path backends/zebra/Cargo.toml -- --check
- name: Check formatting (zaino backend)
run: cargo fmt --manifest-path backends/zaino/Cargo.toml -- --check
hadolint:
name: Hadolint (${{ matrix.dockerfile }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dockerfile:
- Dockerfile
- Dockerfile.stagex
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Lint Dockerfile
uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
with:
dockerfile: ${{ matrix.dockerfile }}
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Run shellcheck
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0
required-lints:
name: Required lints have passed
needs:
- clippy
- doc-links
- fmt
- hadolint
- shellcheck
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Determine whether all required-pass steps succeeded
run: |
echo "${NEEDS}" | jq -e '[ .[] | .result == "success" ] | all'
env:
NEEDS: ${{ toJSON(needs) }}