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
118 changes: 118 additions & 0 deletions .github/workflows/cargo-hack-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Cargo Hack Check

on:
workflow_call:

env:
RUST_BACKTRACE: full

concurrency:
group: cargo-hack-check-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
# Setup job to prepare common dependencies
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
rust-toolchain: ${{ steps.toolchain.outputs.rust-toolchain }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Get Rust toolchain
id: toolchain
run: echo "rust-toolchain=$(cat ./rust-toolchain)" >> $GITHUB_OUTPUT

# Native targets (Windows/Linux)
native-targets:
name: All Crates (Windows/Linux)
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Setup Rust with Cache
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
with:
toolchain: ${{ needs.setup.outputs.rust-toolchain }}
target: x86_64-pc-windows-gnu,x86_64-unknown-linux-gnu
cache: true
cache-key: cargo-hack-native-${{ needs.setup.outputs.rust-toolchain }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install cargo-hack
uses: taiki-e/install-action@2383334cf567d78771fc7d89b6b3802ef1412cf6 # v2.56.8
with:
tool: cargo-hack

- name: Install Windows cross-compilation tools
run: |
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64-x86-64

- name: Run cargo hack check
run: |
cargo hack check \
--all \
--each-feature \
--no-dev-deps \
--exclude-features=wasm-deterministic,wasm-web \
--target x86_64-pc-windows-gnu \
--target x86_64-unknown-linux-gnu

# WASM targets - separate cache since dependencies differ
wasm-targets:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
needs: setup
strategy:
fail-fast: false
matrix:
include:
- name: "Clarity & Stacks-Common WASM Web"
command: |
cargo hack check \
-p clarity-serialization \
-p stacks-common \
--each-feature \
--no-dev-deps \
--exclude-features=default,rusqlite,ctrlc-handler,wasm-deterministic \
--features=wasm-web

- name: "Clarity & Stacks-Common WASM Deterministic"
command: |
cargo hack check \
-p clarity-serialization \
-p stacks-common \
--each-feature \
--no-dev-deps \
--include-features=wasm-deterministic,slog_json \
--features=wasm-deterministic

steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Setup Rust with Cache
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
with:
toolchain: ${{ needs.setup.outputs.rust-toolchain }}
target: wasm32-unknown-unknown
cache: true
cache-key: cargo-hack-wasm-${{ matrix.name }}-${{ needs.setup.outputs.rust-toolchain }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install cargo-hack
uses: taiki-e/install-action@2383334cf567d78771fc7d89b6b3802ef1412cf6 # v2.56.8
with:
tool: cargo-hack

- name: Run cargo hack check
run: ${{ matrix.command }}
29 changes: 25 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
needs:
- rustfmt
- check-release
secrets: inherit
secrets: inherit
uses: ./.github/workflows/github-release.yml
with:
node_tag: ${{ needs.check-release.outputs.node_tag }}
Expand Down Expand Up @@ -145,6 +145,27 @@ jobs:
- check-release
uses: ./.github/workflows/stacks-core-tests.yml

## Validate constants dumped by stacks-inspect
##
## Runs when:
## - it is a node or signer-only release run
## or any of:
## - this workflow is called manually
## - PR is opened
## - PR added to merge queue
constants-check:
if: |
needs.check-release.outputs.is_node_release == 'true' ||
needs.check-release.outputs.is_signer_release == 'true' ||
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
github.event_name == 'merge_group'
name: Constants Check
needs:
- rustfmt
- check-release
uses: ./.github/workflows/constants-check.yml

## Checks to run on built binaries
##
## Runs when:
Expand All @@ -153,18 +174,18 @@ jobs:
## - this workflow is called manually
## - PR is opened
## - PR added to merge queue
stacks-core-build-tests:
cargo-hack-check:
if: |
needs.check-release.outputs.is_node_release == 'true' ||
needs.check-release.outputs.is_signer_release == 'true' ||
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
github.event_name == 'merge_group'
name: Stacks Core Build Tests
name: Cargo Hack Check
needs:
- rustfmt
- check-release
uses: ./.github/workflows/core-build-tests.yml
uses: ./.github/workflows/cargo-hack-check.yml

## Checks to run on built binaries
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Core build tests
name: Constants Check

# Only run when:
# - PRs are (re)opened against develop branch
on:
workflow_call:

jobs:
check-consts:
name: Check the constants from stacks-inspect
Expand All @@ -26,27 +26,6 @@ jobs:
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}

## run cargo check steps
- name: Cargo Check
id: cargo_check
run: |
cargo check

- name: Cargo Check (monitoring_prom)
id: cargo_check_prom
run: |
cargo check --features monitoring_prom

- name: Cargo Check (clarity)
id: cargo_check_clarity
run: |
cargo check -p clarity --no-default-features

- name: Cargo Check (stacks-common)
id: cargo_check_stacks-common
run: |
cargo check -p stacks-common --no-default-features

- name: Dump constants JSON
id: consts-dump
run: |
Expand Down
2 changes: 1 addition & 1 deletion clarity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ default = ["rusqlite"]
developer-mode = ["stacks_common/developer-mode"]
slog_json = ["stacks_common/slog_json"]
rusqlite = ["stacks_common/rusqlite", "dep:rusqlite"]
testing = ["rstest", "rstest_reuse"]
testing = ["rstest", "rstest_reuse", "rusqlite"]
devtools = []
rollback_value_check = []
disable-costs = []
Expand Down
4 changes: 2 additions & 2 deletions stacks-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ name = "stacks-events"
path = "src/stacks_events.rs"

[features]
monitoring_prom = ["stacks/monitoring_prom", "stacks-signer/monitoring_prom", "async-h1", "async-std", "http-types"]
monitoring_prom = ["stacks/monitoring_prom", "async-h1", "async-std", "http-types"]
slog_json = ["stacks/slog_json", "stacks-common/slog_json", "clarity/slog_json"]
prod-genesis-chainstate = []
default = []
testing = ["stacks-common/testing", "stacks/testing", "clarity/testing", "stacks-signer/testing"]
testing = ["stacks-common/testing", "stacks/testing", "clarity/testing"]
build-signer-v3-1-0-0-13 = ["signer_v3_1_0_0_13", "libsigner_v3_1_0_0_13", "stacks_v3_1_00_13", "stacks_common_v3_1_00_13"]

[package.metadata.pinny]
Expand Down
Loading