2019-11-07 09:40:41 -08:00
|
|
|
name: CI checks
|
2019-08-20 15:46:53 -07:00
|
|
|
|
2019-08-23 04:13:23 -07:00
|
|
|
on: [push, pull_request]
|
2019-08-20 15:46:53 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Test on ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-10-07 19:32:26 -07:00
|
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
2019-08-22 03:21:05 -07:00
|
|
|
|
|
|
|
steps:
|
2023-09-04 22:54:36 -07:00
|
|
|
- uses: actions/checkout@v4
|
2019-10-07 19:32:26 -07:00
|
|
|
- name: Run tests
|
2023-02-01 09:18:24 -08:00
|
|
|
run: cargo test --all-features --verbose --release --all
|
2019-10-07 19:32:26 -07:00
|
|
|
- name: Run slow tests
|
2023-02-01 09:18:24 -08:00
|
|
|
run: cargo test --all-features --verbose --release --all -- --ignored
|
2022-11-01 17:42:41 -07:00
|
|
|
- name: Verify working directory is clean
|
|
|
|
run: git diff --exit-code
|
|
|
|
|
2023-09-11 16:10:59 -07:00
|
|
|
build-latest:
|
|
|
|
name: Latest build on ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
id: toolchain
|
|
|
|
- run: rustup override set ${{steps.toolchain.outputs.name}}
|
|
|
|
- name: Remove lockfile to build with latest dependencies
|
|
|
|
run: rm Cargo.lock
|
|
|
|
- name: Build crates
|
|
|
|
run: cargo build --workspace --all-targets --all-features --verbose
|
|
|
|
- name: Verify working directory is clean (excluding lockfile)
|
|
|
|
run: git diff --exit-code ':!Cargo.lock'
|
|
|
|
|
|
|
|
build-nodefault:
|
2020-08-07 08:36:46 -07:00
|
|
|
name: Build target ${{ matrix.target }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target:
|
|
|
|
- wasm32-wasi
|
|
|
|
|
|
|
|
steps:
|
2023-09-04 22:54:36 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-03 16:45:25 -07:00
|
|
|
with:
|
|
|
|
path: crates
|
|
|
|
# We use a synthetic crate to ensure no dev-dependencies are enabled, which can
|
|
|
|
# be incompatible with some of these targets.
|
|
|
|
- name: Create synthetic crate for testing
|
|
|
|
run: cargo init --lib ci-build
|
|
|
|
- name: Copy Rust version into synthetic crate
|
|
|
|
run: cp crates/rust-toolchain.toml ci-build/
|
|
|
|
- name: Add zcash_proofs as a dependency of the synthetic crate
|
|
|
|
working-directory: ./ci-build
|
|
|
|
run: cargo add --no-default-features --path ../crates/zcash_proofs
|
|
|
|
- name: Add zcash_client_backend as a dependency of the synthetic crate
|
|
|
|
working-directory: ./ci-build
|
|
|
|
run: cargo add --no-default-features --path ../crates/zcash_client_backend
|
|
|
|
- name: Copy pinned dependencies into synthetic crate
|
|
|
|
run: cp crates/Cargo.lock ci-build/
|
2020-08-07 08:36:46 -07:00
|
|
|
- name: Add target
|
2023-11-03 16:45:25 -07:00
|
|
|
working-directory: ./ci-build
|
2020-08-07 08:36:46 -07:00
|
|
|
run: rustup target add ${{ matrix.target }}
|
2023-11-03 16:45:25 -07:00
|
|
|
- name: Build for target
|
|
|
|
working-directory: ./ci-build
|
|
|
|
run: cargo build --verbose --target ${{ matrix.target }}
|
2020-10-23 09:26:03 -07:00
|
|
|
|
|
|
|
bitrot:
|
|
|
|
name: Bitrot check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-04 22:54:36 -07:00
|
|
|
- uses: actions/checkout@v4
|
2020-10-23 09:26:03 -07:00
|
|
|
# Build benchmarks to prevent bitrot
|
|
|
|
- name: Build benchmarks
|
2023-02-01 09:18:24 -08:00
|
|
|
run: cargo build --all --benches
|
2020-10-23 09:26:03 -07:00
|
|
|
|
|
|
|
clippy:
|
2023-02-01 09:18:24 -08:00
|
|
|
name: Clippy (MSRV)
|
2020-10-23 09:26:03 -07:00
|
|
|
timeout-minutes: 30
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-04 22:54:36 -07:00
|
|
|
- uses: actions/checkout@v4
|
2020-10-23 09:26:03 -07:00
|
|
|
- name: Run clippy
|
|
|
|
uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
2023-02-01 09:18:24 -08:00
|
|
|
name: Clippy (MSRV)
|
2020-10-23 09:26:03 -07:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
args: --all-features --all-targets -- -D warnings
|
|
|
|
|
2022-02-01 06:34:49 -08:00
|
|
|
clippy-beta:
|
|
|
|
name: Clippy (beta)
|
2020-10-23 09:26:03 -07:00
|
|
|
timeout-minutes: 30
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
2023-09-04 22:54:36 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-02 09:06:54 -08:00
|
|
|
- uses: dtolnay/rust-toolchain@beta
|
|
|
|
id: toolchain
|
|
|
|
- run: rustup override set ${{steps.toolchain.outputs.name}}
|
2022-02-01 06:34:49 -08:00
|
|
|
- name: Run Clippy (beta)
|
2020-10-23 09:26:03 -07:00
|
|
|
uses: actions-rs/clippy-check@v1
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
2022-02-01 06:34:49 -08:00
|
|
|
name: Clippy (beta)
|
2020-10-23 09:26:03 -07:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2020-10-27 10:20:00 -07:00
|
|
|
args: --all-features --all-targets -- -W clippy::all
|
2020-08-07 08:36:46 -07:00
|
|
|
|
2019-11-07 10:16:27 -08:00
|
|
|
codecov:
|
|
|
|
name: Code coverage
|
|
|
|
runs-on: ubuntu-latest
|
2023-02-01 09:18:24 -08:00
|
|
|
container:
|
|
|
|
image: xd009642/tarpaulin:develop-nightly
|
|
|
|
options: --security-opt seccomp=unconfined
|
2019-11-07 10:16:27 -08:00
|
|
|
|
|
|
|
steps:
|
2023-09-04 22:54:36 -07:00
|
|
|
- uses: actions/checkout@v4
|
2019-11-07 10:16:27 -08:00
|
|
|
- name: Generate coverage report
|
2023-09-22 14:43:43 -07:00
|
|
|
run: cargo tarpaulin --engine llvm --all-features --release --timeout 600 --out xml
|
2019-11-07 10:16:27 -08:00
|
|
|
- name: Upload coverage to Codecov
|
2023-05-15 22:57:59 -07:00
|
|
|
uses: codecov/codecov-action@v3.1.4
|
2019-11-07 10:16:27 -08:00
|
|
|
|
2019-09-24 02:31:04 -07:00
|
|
|
doc-links:
|
2020-10-23 09:26:03 -07:00
|
|
|
name: Intra-doc links
|
2019-09-24 02:31:04 -07:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-04 22:54:36 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-01 09:18:24 -08:00
|
|
|
- run: cargo fetch
|
|
|
|
# Requires #![deny(rustdoc::broken_intra_doc_links)] in crates.
|
2019-10-07 19:32:26 -07:00
|
|
|
- name: Check intra-doc links
|
2023-10-02 17:02:06 -07:00
|
|
|
run: cargo doc --all --all-features --document-private-items
|
2020-10-23 09:26:03 -07:00
|
|
|
|
|
|
|
fmt:
|
|
|
|
name: Rustfmt
|
|
|
|
timeout-minutes: 30
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-04 22:54:36 -07:00
|
|
|
- uses: actions/checkout@v4
|
2020-10-23 09:26:03 -07:00
|
|
|
- name: Check formatting
|
2023-02-01 09:18:24 -08:00
|
|
|
run: cargo fmt --all -- --check
|
2023-09-25 04:49:40 -07:00
|
|
|
|
|
|
|
uuid:
|
|
|
|
name: UUID validity
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Extract UUIDs
|
|
|
|
id: extract
|
|
|
|
run: |
|
|
|
|
{
|
|
|
|
echo 'UUIDS<<EOF'
|
|
|
|
git grep -h "Uuid::from_u128" zcash_client_sqlite/ |
|
|
|
|
sed -e "s,.*Uuid::from_u128(0x,," -e "s,_,-,g" -e "s,);,,"
|
|
|
|
echo EOF
|
|
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Check UUID validity
|
|
|
|
env:
|
|
|
|
UUIDS: ${{ steps.extract.outputs.UUIDS }}
|
|
|
|
run: uuidparse -n -o type $UUIDS | xargs -L 1 test "invalid" !=
|
|
|
|
- name: Check UUID type
|
|
|
|
env:
|
|
|
|
UUIDS: ${{ steps.extract.outputs.UUIDS }}
|
|
|
|
run: uuidparse -n -o type $UUIDS | xargs -L 1 test "random" =
|
|
|
|
- name: Check UUID uniqueness
|
|
|
|
env:
|
|
|
|
UUIDS: ${{ steps.extract.outputs.UUIDS }}
|
|
|
|
run: >
|
|
|
|
test $(
|
|
|
|
uuidparse -n -o uuid $U4 | wc -l
|
|
|
|
) -eq $(
|
|
|
|
uuidparse -n -o uuid $U4 | sort | uniq | wc -l
|
|
|
|
)
|