Skip to content

Commit fec6f86

Browse files
committed
Add stacks-signer-tests.yml to run stacks signer unit tests in CI
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent 952d939 commit fec6f86

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

Diff for: .github/workflows/ci.yml

+23
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,29 @@ jobs:
209209
- check-release
210210
uses: ./.github/workflows/p2p-tests.yml
211211

212+
213+
stacks-signer-tests:
214+
if: |
215+
needs.check-release.outputs.is_release == 'true' || (
216+
github.event_name == 'workflow_dispatch' ||
217+
github.event_name == 'pull_request' ||
218+
github.event_name == 'merge_group' ||
219+
(
220+
contains('
221+
refs/heads/master
222+
refs/heads/develop
223+
refs/heads/next
224+
', github.event.pull_request.head.ref) &&
225+
github.event_name == 'push'
226+
)
227+
)
228+
name: Stacks Signer Unit Tests
229+
needs:
230+
- rustfmt
231+
- create-cache
232+
- check-release
233+
uses: ./.github/workflows/stacks-signer-tests.yml
234+
212235
## Test to run on a tagged release
213236
##
214237
## Runs when:

Diff for: .github/workflows/stacks-signer-tests.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Run Stacks Signer Unit Tests
2+
name: Tests::Stacks Signer Unit Tests
3+
4+
on:
5+
workflow_call:
6+
7+
env:
8+
RUST_BACKTRACE: full
9+
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
10+
TEST_TIMEOUT: 30
11+
12+
concurrency:
13+
group: stacks-core-tests-${{ github.head_ref || github.ref || github.run_id }}
14+
# Only cancel in progress if this is for a PR
15+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
16+
17+
jobs:
18+
unit-tests:
19+
name: Unit Tests
20+
runs-on: ubuntu-latest
21+
steps:
22+
# Checkout the latest code
23+
- name: Checkout Latest Code
24+
uses: actions/checkout@v3
25+
26+
# Install Rust toolchain
27+
- name: Install Rust Toolchain
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
toolchain: stable
31+
32+
# Run unit tests
33+
- name: Run Unit Tests
34+
run: cargo test -p stacks-signer -- --nocapture --test-threads 1
35+
continue-on-error: true
36+
37+
# Upload code coverage results
38+
- name: Code Coverage
39+
uses: stacks-network/actions/codecov@main
40+
with:
41+
test-name: stacks-signer-tests

Diff for: .github/workflows/standalone-tests.yml

+17
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ on:
2525
- Slow Tests
2626
- Stacks-Core Tests
2727
- SBTC Tests
28+
- Stacks-Signer Tests
2829

2930
## Set the display name to the test being run
3031
run-name: ${{ inputs.workflow }}
@@ -148,3 +149,19 @@ jobs:
148149
- create-cache
149150
uses: ./.github/workflows/sbtc-tests.yml
150151

152+
## Runs when:
153+
## either or of the following:
154+
## - workflow is 'Release Tests'
155+
## - workflow is 'CI Tests'
156+
## - workflow is 'Stacks-Signer Tests'
157+
stacks-signer-tests:
158+
if: |
159+
(
160+
inputs.workflow == 'Release Tests' ||
161+
inputs.workflow == 'CI Tests' ||
162+
inputs.workflow == 'Stacks-Signer Tests'
163+
)
164+
name: Stacks Signer Tests
165+
needs:
166+
- create-cache
167+
uses: ./.github/workflows/stacks-signer-tests.yml

0 commit comments

Comments
 (0)