Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stacks-signer-tests.yml to run stacks signer unit tests in CI #5593

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,29 @@ jobs:
- check-release
uses: ./.github/workflows/p2p-tests.yml


stacks-signer-tests:
if: |
needs.check-release.outputs.is_release == 'true' || (
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request' ||
github.event_name == 'merge_group' ||
(
contains('
refs/heads/master
refs/heads/develop
refs/heads/next
', github.event.pull_request.head.ref) &&
github.event_name == 'push'
)
)
name: Stacks Signer Unit Tests
needs:
- rustfmt
- create-cache
- check-release
uses: ./.github/workflows/stacks-signer-tests.yml

## Test to run on a tagged release
##
## Runs when:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/stacks-signer-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Run Stacks Signer Unit Tests
name: Tests::Stacks Signer Unit Tests

on:
workflow_call:

env:
RUST_BACKTRACE: full
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
TEST_TIMEOUT: 30

concurrency:
group: stacks-core-tests-${{ github.head_ref || github.ref || github.run_id }}
# Only cancel in progress if this is for a PR
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
## Setup test environment
- name: Setup Test Environment
id: setup_tests
uses: stacks-network/actions/stacks-core/testenv@main

# Run unit tests
- name: Run Unit Tests
run: cargo test -p stacks-signer -- --nocapture --test-threads 1
continue-on-error: true
17 changes: 17 additions & 0 deletions .github/workflows/standalone-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
- Slow Tests
- Stacks-Core Tests
- SBTC Tests
- Stacks-Signer Tests

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

## Runs when:
## either or of the following:
## - workflow is 'Release Tests'
## - workflow is 'CI Tests'
## - workflow is 'Stacks-Signer Tests'
stacks-signer-tests:
if: |
(
inputs.workflow == 'Release Tests' ||
inputs.workflow == 'CI Tests' ||
inputs.workflow == 'Stacks-Signer Tests'
)
name: Stacks Signer Tests
needs:
- create-cache
uses: ./.github/workflows/stacks-signer-tests.yml
Loading