5445/merge #11171
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 | |
check-release: | |
name: Check Release | |
needs: | |
- rustfmt | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.check_release.outputs.tag }} | |
docker_tag: ${{ steps.check_release.outputs.docker_tag }} | |
is_release: ${{ steps.check_release.outputs.is_release }} | |
steps: | |
- name: Check Release | |
id: check_release | |
uses: stacks-network/actions/stacks-core/check-release@main | |
with: | |
tag: ${{ github.ref_name }} | |
###################################################################################### | |
## Create a tagged github release | |
## | |
## Runs when: | |
## - it is a release run | |
create-release: | |
if: | | |
needs.check-release.outputs.is_release == 'true' | |
name: Create Release | |
needs: | |
- rustfmt | |
- check-release | |
uses: ./.github/workflows/github-release.yml | |
with: | |
tag: ${{ needs.check-release.outputs.tag }} | |
docker_tag: ${{ needs.check-release.outputs.docker_tag }} | |
secrets: inherit | |
## Build and push Debian image built from source | |
## | |
## Runs when: | |
## - it is not a release run | |
docker-image: | |
if: | | |
needs.check-release.outputs.is_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 release run | |
## or: | |
## - it is not a release run | |
## and any of: | |
## - this workflow is called manually | |
## - PR is opened | |
## - commit to either (development, master) branch | |
create-cache: | |
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: Create Test Cache | |
needs: | |
- rustfmt | |
- check-release | |
uses: ./.github/workflows/create-cache.yml | |
## Tests to run regularly | |
## | |
## Runs when: | |
## - it is a release run | |
## or: | |
## - it is not a release run | |
## and any of: | |
## - this workflow is called manually | |
## - PR is opened | |
## - PR added to merge queue | |
## - commit to either (development, next, master) branch | |
stacks-core-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 Core Tests | |
needs: | |
- rustfmt | |
- create-cache | |
- check-release | |
uses: ./.github/workflows/stacks-core-tests.yml | |
bitcoin-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: Bitcoin Tests | |
needs: | |
- rustfmt | |
- create-cache | |
- check-release | |
uses: ./.github/workflows/bitcoin-tests.yml | |
p2p-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: 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 release run | |
atlas-tests: | |
if: needs.check-release.outputs.is_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_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_release == 'true' | |
name: Slow Tests | |
needs: | |
- rustfmt | |
- create-cache | |
- check-release | |
uses: ./.github/workflows/slow-tests.yml |