forked from stacks-network/stacks-core
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (120 loc) · 4.12 KB
/
cargo-hack-check.yml
File metadata and controls
139 lines (120 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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
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: false
- 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 - No caching needed as it runs in parallel with longer jobs
wasm-targets:
name: WASM targets
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
with:
toolchain: ${{ needs.setup.outputs.rust-toolchain }}
target: wasm32-unknown-unknown
cache: false
- name: Install cargo-hack
uses: taiki-e/install-action@2383334cf567d78771fc7d89b6b3802ef1412cf6 # v2.56.8
with:
tool: cargo-hack
- name: Run cargo hack check (WASM Web)
run: |
cargo hack check \
-p clarity \
-p clarity-types \
-p stacks-common \
--each-feature \
--no-dev-deps \
--exclude-features=default,rusqlite,ctrlc-handler,wasm-deterministic,testing \
--features=wasm-web
- name: Run cargo hack check (WASM Deterministic)
run: |
cargo hack check \
-p clarity-types \
-p stacks-common \
--each-feature \
--no-dev-deps \
--include-features=wasm-deterministic,slog_json \
--features=wasm-deterministic
fuzz-targets:
name: Fuzz targets (nightly)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Install Rust nightly toolchain
uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1.13.0
with:
toolchain: nightly
cache: false
- name: Check fuzz targets (clarity)
run: |
cargo +nightly check \
--manifest-path clarity/fuzz/Cargo.toml \
--bins \
--locked
- name: Check fuzz targets (stackslib)
run: |
cargo +nightly check \
--manifest-path stackslib/fuzz/Cargo.toml \
--bins \
--locked