Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,28 @@ coverage:
flags:
dash-num:
paths: [pkgs/num/]
carryforward: false
carryforward: true
dash-script:
paths: [pkgs/script/]
carryforward: false
carryforward: true
dash-p2p-core:
paths: [pkgs/p2p_core/]
carryforward: false
carryforward: true
dash-params:
paths: [pkgs/params/]
carryforward: false
carryforward: true
dash-pkc:
paths: [pkgs/pkc/]
carryforward: false
carryforward: true
dash-pow:
paths: [pkgs/pow/]
carryforward: false
carryforward: true
dash-primitives:
paths: [pkgs/primitives/]
carryforward: false
carryforward: true
dash-types:
paths: [pkgs/types/, pkgs/types/marker/]
carryforward: false
carryforward: true
ignore:
- "**/bench/**"
- "**/corpus/**"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock') }}
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock', 'fuzz/Cargo.lock') }}
restore-keys: cargo-deps-

- name: Manage build artifacts
Expand Down
134 changes: 37 additions & 97 deletions .github/workflows/build_msrv.yml
Original file line number Diff line number Diff line change
@@ -1,98 +1,31 @@
name: MSRV (1.89)

on:
push:
branches: [develop]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
workflow_call:
inputs:
package:
description: Cargo package name (e.g. dash-num)
required: true
type: string
package_dir:
description: Package directory relative to pkgs/ (e.g. num)
required: true
type: string
fuzz_package_dir:
description: Fuzz package directory relative to fuzz/ (e.g. pow)
required: false
type: string
default: ""
secrets:
CACHIX_AUTH_TOKEN:
required: false
CODECOV_TOKEN:
required: false

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-24.04

defaults:
run:
shell: nix develop ./contrib/nix#ci --command bash -eo pipefail {0}

steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 100

- name: Run pull request checks
if: github.event_name == 'pull_request'
shell: bash
run: |
source .github/ci.env
commits=${{ github.event.pull_request.commits }}
if [ "${commits}" -gt "${MAX_PR_COMMITS}" ]; then
echo "::error::PR has ${commits} commits (limit: ${MAX_PR_COMMITS})"
exit 1
fi

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v22
with:
extra-conf: |
extra-substituters = https://dashpay-base-sdk.cachix.org
extra-trusted-public-keys = dashpay-base-sdk.cachix.org-1:TAoDyYL2e60lUEG8n10gvIZmujM5rJAhaG613fNfOWI=

- name: Cache Nix
uses: cachix/cachix-action@v17
with:
name: dashpay-base-sdk
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
skipAddingSubstituter: true

- name: Restore cargo registry
uses: actions/cache/restore@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock') }}
restore-keys: cargo-deps-

- name: Manage build artifacts
uses: actions/cache@v5
with:
path: target
key: cargo-build-lint-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}
restore-keys: |
cargo-build-lint-${{ runner.os }}-${{ runner.arch }}-

- name: Manage CodeQL packs
uses: actions/cache@v5
with:
path: ~/.codeql
key: codeql-packs-${{ hashFiles('maint/codeql/*/codeql-pack.lock.yml') }}

- name: Run linters
run: just lint

- name: Lint every feature combination
run: cargo hack --workspace --exclude-features default --feature-powerset clippy --all-targets -- -D warnings

- name: Check PR title
if: github.event_name == 'pull_request'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: python3 maint/lint/lint_commit.py -m "${PR_TITLE}"

- name: Check PR commit messages
if: github.event_name == 'pull_request'
run: >
python3 maint/lint/lint_commit.py
-r "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"

build:
name: Build and test
runs-on: ubuntu-24.04-arm
Expand All @@ -108,6 +41,7 @@ jobs:
uses: actions/checkout@v6
with:
fetch-depth: 1
submodules: ${{ inputs.fuzz_package_dir != '' }}

- name: Run pull request checks
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -140,7 +74,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock') }}
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock', 'fuzz/Cargo.lock') }}
restore-keys: cargo-deps-

- name: Manage build artifacts
Expand All @@ -149,9 +83,10 @@ jobs:
path: |
target
!target/nextest
key: cargo-build-msrv-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}
fuzz/target
key: cargo-build-msrv-${{ runner.os }}-${{ runner.arch }}-${{ inputs.package }}-${{ github.sha }}
restore-keys: |
cargo-build-msrv-${{ runner.os }}-${{ runner.arch }}-
cargo-build-msrv-${{ runner.os }}-${{ runner.arch }}-${{ inputs.package }}-

- name: Select the MSRV toolchain
run: |
Expand All @@ -162,25 +97,25 @@ jobs:
} >> "$GITHUB_ENV"

- name: Build every feature
run: '"$CARGO" hack --workspace --exclude-features default --each-feature build'
run: '"$CARGO" hack -p ${{ inputs.package }} --exclude-features default --each-feature build'

- name: Test every feature
run: |
"$CARGO" hack --workspace --exclude-features default --each-feature nextest run --config-file .cargo/nextest.toml --no-tests=warn
"$CARGO" hack --workspace --exclude-features default --each-feature test --doc
"$CARGO" hack -p ${{ inputs.package }} --exclude-features default --each-feature nextest run --config-file .cargo/nextest.toml --no-tests=warn
"$CARGO" hack -p ${{ inputs.package }} --exclude-features default --each-feature test --doc

- name: Test workspace (with coverage)
- name: Test package (with coverage)
run: |
"$CARGO" llvm-cov clean --workspace
"$CARGO" llvm-cov --no-report nextest --config-file .cargo/nextest.toml --workspace --features full
"$CARGO" llvm-cov --no-report nextest --config-file .cargo/nextest.toml --package ${{ inputs.package }} --features full
"$CARGO" llvm-cov report --lcov --output-path lcov.info

- name: Upload coverage to Codecov
if: env.HAS_CODECOV == 'true'
uses: codecov/codecov-action@v5
with:
files: lcov.info
flags: dash-num,dash-p2p-core,dash-params,dash-pkc,dash-pow,dash-primitives,dash-script,dash-types
flags: ${{ inputs.package }}
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
Expand All @@ -189,7 +124,12 @@ jobs:
with:
files: target/nextest/default/junit.xml
report_type: test_results
flags: ${{ inputs.package }}
token: ${{ secrets.CODECOV_TOKEN }}

- name: Replay fuzz corpora
if: inputs.fuzz_package_dir != ''
run: PATH="$TOOLCHAIN_MSRV/bin:$PATH" just fuzz::test

- name: Sanity check benchmarks
run: '"$CARGO" hack --workspace --exclude-features default --each-feature test --benches'
run: '"$CARGO" hack -p ${{ inputs.package }} --exclude-features default --each-feature test --benches'
107 changes: 92 additions & 15 deletions .github/workflows/build_stable.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,98 @@
name: Build on stable

on:
workflow_call:
inputs:
package:
description: Cargo package name (e.g. dash-num)
required: true
type: string
package_dir:
description: Package directory relative to pkgs/ (e.g. num)
required: true
type: string
push:
branches: [develop]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
lint:
name: Lint
runs-on: ubuntu-24.04

defaults:
run:
shell: nix develop ./contrib/nix#ci --command bash -eo pipefail {0}

steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 100

- name: Run pull request checks
if: github.event_name == 'pull_request'
shell: bash
run: |
source .github/ci.env
commits=${{ github.event.pull_request.commits }}
if [ "${commits}" -gt "${MAX_PR_COMMITS}" ]; then
echo "::error::PR has ${commits} commits (limit: ${MAX_PR_COMMITS})"
exit 1
fi

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v22
with:
extra-conf: |
extra-substituters = https://dashpay-base-sdk.cachix.org
extra-trusted-public-keys = dashpay-base-sdk.cachix.org-1:TAoDyYL2e60lUEG8n10gvIZmujM5rJAhaG613fNfOWI=

- name: Cache Nix
uses: cachix/cachix-action@v17
with:
name: dashpay-base-sdk
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
skipAddingSubstituter: true

- name: Restore cargo registry
uses: actions/cache/restore@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock', 'fuzz/Cargo.lock') }}
restore-keys: cargo-deps-

- name: Manage build artifacts
uses: actions/cache@v5
with:
path: target
key: cargo-build-lint-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}
restore-keys: |
cargo-build-lint-${{ runner.os }}-${{ runner.arch }}-

- name: Manage CodeQL packs
uses: actions/cache@v5
with:
path: ~/.codeql
key: codeql-packs-${{ hashFiles('maint/codeql/*/codeql-pack.lock.yml') }}

- name: Run linters
run: just lint

- name: Lint every feature combination
run: cargo hack --workspace --exclude-features default --feature-powerset clippy --all-targets -- -D warnings

- name: Check PR title
if: github.event_name == 'pull_request'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: python3 maint/lint/lint_commit.py -m "${PR_TITLE}"

- name: Check PR commit messages
if: github.event_name == 'pull_request'
run: >
python3 maint/lint/lint_commit.py
-r "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"

stable:
strategy:
fail-fast: false
Expand Down Expand Up @@ -62,23 +139,23 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock') }}
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock', 'fuzz/Cargo.lock') }}
restore-keys: cargo-deps-

- name: Manage build artifacts
uses: actions/cache@v5
with:
path: target
key: cargo-build-stable-${{ runner.os }}-${{ runner.arch }}-${{ inputs.package }}-${{ github.sha }}
key: cargo-build-stable-${{ runner.os }}-${{ runner.arch }}-${{ github.sha }}
restore-keys: |
cargo-build-stable-${{ runner.os }}-${{ runner.arch }}-${{ inputs.package }}-
cargo-build-stable-${{ runner.os }}-${{ runner.arch }}-

- name: Build every feature
run: cargo hack -p ${{ inputs.package }} --exclude-features default --each-feature build
run: cargo hack --workspace --exclude-features default --each-feature build
env:
RUSTUP_TOOLCHAIN: stable

- name: Test every feature
run: cargo hack -p ${{ inputs.package }} --exclude-features default --each-feature test
run: cargo hack --workspace --exclude-features default --each-feature test
env:
RUSTUP_TOOLCHAIN: stable
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock') }}
key: cargo-deps-${{ hashFiles('Cargo.lock', 'docs/samples/Cargo.lock', 'fuzz/Cargo.lock') }}
restore-keys: cargo-deps-

- name: Build documentation
Expand Down
Loading
Loading