5720/merge #12611
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## The main Github Actions workflow | |
name: CI | |
on: | |
merge_group: | |
types: | |
- checks_requested | |
push: | |
branches: | |
- master | |
- develop | |
- next | |
paths-ignore: | |
- "**.md" | |
- "**.yml" | |
workflow_dispatch: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: ci-${{ github.head_ref || github.ref || github.run_id }} | |
## Always cancel duplicate jobs | |
cancel-in-progress: true | |
run-name: ${{ github.ref_name }} | |
jobs: | |
## | |
## Jobs to execute everytime workflow runs | |
## do not run if the trigger is any of the following: | |
## - PR review submitted (not approved) | |
## and any of: | |
## - PR review comment | |
## - PR change is requested | |
rustfmt: | |
name: Rust Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Rustfmt | |
id: rustfmt | |
uses: stacks-network/actions/rustfmt@main | |
with: | |
alias: "fmt-stacks" | |
###################################################################################### | |
## Check if the branch that this workflow is being run against is a release branch | |
## | |
## Outputs: | |
## - node_tag: Tag of the stacks-node if the branch is a release one (example: release/3.4.0.0.1), null otherwise | |
## - node_docker_tag: Version of the stacks-node if the branch is a release one (example: 3.4.0.0.1), null otherwise | |
## - signer_tag: Tag of the stacks-signer if the branch is a release one (example: release/3.4.0.0.1.0), null otherwise | |
## - signer_docker_tag: Version of the stacks-signer if the branch is a release one (example: 3.4.0.0.1.0), null otherwise | |
## - is_node_release: True if the branch represents a 'stacks-node' release, false otherwise. | |
## If this is true, 'is_signer_release' will also be true, since a 'stacks-signer' binary | |
## is always released alongside 'stacks-node'. | |
## - is_signer_release: True if the branch represents a 'stacks-signer' release, false otherwise. | |
check-release: | |
name: Check Release | |
needs: | |
- rustfmt | |
runs-on: ubuntu-latest | |
outputs: | |
node_tag: ${{ steps.check_release.outputs.node_tag }} | |
node_docker_tag: ${{ steps.check_release.outputs.node_docker_tag }} | |
signer_tag: ${{ steps.check_release.outputs.signer_tag }} | |
signer_docker_tag: ${{ steps.check_release.outputs.signer_docker_tag }} | |
is_node_release: ${{ steps.check_release.outputs.is_node_release }} | |
is_signer_release: ${{ steps.check_release.outputs.is_signer_release }} | |
steps: | |
- name: Check Release | |
id: check_release | |
uses: stacks-network/actions/stacks-core/release/check-release@main | |
with: | |
tag: ${{ github.ref_name }} | |
###################################################################################### | |
## Create a tagged github release | |
## | |
## Runs when: | |
## - it is either a node release or a signer release | |
create-release: | |
if: | | |
needs.check-release.outputs.is_node_release == 'true' || | |
needs.check-release.outputs.is_signer_release == 'true' | |
name: Create Release(s) | |
needs: | |
- rustfmt | |
- check-release | |
uses: ./.github/workflows/github-release.yml | |
with: | |
node_tag: ${{ needs.check-release.outputs.node_tag }} | |
node_docker_tag: ${{ needs.check-release.outputs.node_docker_tag }} | |
signer_tag: ${{ needs.check-release.outputs.signer_tag }} | |
signer_docker_tag: ${{ needs.check-release.outputs.signer_docker_tag }} | |
is_node_release: ${{ needs.check-release.outputs.is_node_release }} | |
is_signer_release: ${{ needs.check-release.outputs.is_signer_release }} | |
secrets: inherit | |
## Build and push Debian image built from source | |
## | |
## Runs when: | |
## - it is not a node or signer-only release run | |
docker-image: | |
if: | | |
needs.check-release.outputs.is_node_release != 'true' || | |
needs.check-release.outputs.is_signer_release != 'true' | |
name: Docker Image (Source) | |
uses: ./.github/workflows/image-build-source.yml | |
needs: | |
- rustfmt | |
- check-release | |
secrets: inherit | |
## Create a reusable cache for tests | |
## | |
## Runs when: | |
## - it is a node release run | |
## or any of: | |
## - this workflow is called manually | |
## - PR is opened | |
## - PR added to merge queue | |
create-cache: | |
if: | | |
needs.check-release.outputs.is_node_release == 'true' || | |
github.event_name == 'workflow_dispatch' || | |
github.event_name == 'pull_request' || | |
github.event_name == 'merge_group' | |
name: Create Test Cache | |
needs: | |
- rustfmt | |
- check-release | |
uses: ./.github/workflows/create-cache.yml | |
## Tests to run regularly | |
## | |
## 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 | |
stacks-core-tests: | |
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 Tests | |
needs: | |
- rustfmt | |
- create-cache | |
- check-release | |
uses: ./.github/workflows/stacks-core-tests.yml | |
## Checks to run on built binaries | |
## | |
## 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 | |
stacks-core-build-tests: | |
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 | |
needs: | |
- rustfmt | |
- check-release | |
uses: ./.github/workflows/core-build-tests.yml | |
## Checks to run on built binaries | |
## | |
## Runs when: | |
## - it is a node release run | |
## or any of: | |
## - this workflow is called manually | |
## - PR is opened | |
## - PR added to merge queue | |
bitcoin-tests: | |
if: | | |
needs.check-release.outputs.is_node_release == 'true' || | |
github.event_name == 'workflow_dispatch' || | |
github.event_name == 'pull_request' || | |
github.event_name == 'merge_group' | |
name: Bitcoin Tests | |
needs: | |
- rustfmt | |
- create-cache | |
- check-release | |
uses: ./.github/workflows/bitcoin-tests.yml | |
p2p-tests: | |
if: | | |
needs.check-release.outputs.is_node_release == 'true' || | |
github.event_name == 'workflow_dispatch' || | |
github.event_name == 'pull_request' || | |
github.event_name == 'merge_group' | |
name: P2P Tests | |
needs: | |
- rustfmt | |
- create-cache | |
- check-release | |
uses: ./.github/workflows/p2p-tests.yml | |
## Test to run on a tagged release | |
## | |
## Runs when: | |
## - it is a node release run | |
atlas-tests: | |
if: needs.check-release.outputs.is_node_release == 'true' | |
name: Atlas Tests | |
needs: | |
- rustfmt | |
- create-cache | |
- check-release | |
uses: ./.github/workflows/atlas-tests.yml | |
epoch-tests: | |
if: needs.check-release.outputs.is_node_release == 'true' | |
name: Epoch Tests | |
needs: | |
- rustfmt | |
- create-cache | |
- check-release | |
uses: ./.github/workflows/epoch-tests.yml | |
slow-tests: | |
if: needs.check-release.outputs.is_node_release == 'true' | |
name: Slow Tests | |
needs: | |
- rustfmt | |
- create-cache | |
- check-release | |
uses: ./.github/workflows/slow-tests.yml |