Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

add files for mutants #55

add files for mutants

add files for mutants #55

name: PR Differences Mutants
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
paths:
- '**.rs'
workflow_dispatch:
inputs:
ignore_timeout:
description: "Ignore mutants timeout limit"
required: false
type: choice
options:
- true
- false
default: 'true'
concurrency:
group: pr-differences-${{ github.head_ref || github.ref || github.run_id }}
# Always cancel duplicate jobs
cancel-in-progress: true
jobs:
check-right-permissions:
name: Check Right Permissions
runs-on: ubuntu-latest
steps:
- name: Check Right Permissions To Trigger This
id: check_right_permissions
uses: stacks-network/actions/team-membership@feat/mutation-testing
with:
username: ${{ github.actor }}
team: 'Blockchain Team'
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Fail if the user does not have the right permissions
if: ${{ inputs.ignore_timeout == true && steps.check_right_permissions.outputs.is_team_member != 'true' }}
run: exit 1
# Check and output whether to run big (`stacks-node`/`stackslib`) or small (others) packages with or without shards
check-big-packages-and-shards:
name: Check Packages and Shards
runs-on: ubuntu-latest
needs: check-right-permissions
outputs:
run_stackslib: ${{ steps.check_packages_and_shards.outputs.run_stackslib }}
stackslib_with_shards: ${{ steps.check_packages_and_shards.outputs.stackslib_with_shards }}
run_stacks_node: ${{ steps.check_packages_and_shards.outputs.run_stacks_node }}
stacks_node_with_shards: ${{ steps.check_packages_and_shards.outputs.stacks_node_with_shards }}
run_small_packages: ${{ steps.check_packages_and_shards.outputs.run_small_packages }}
small_packages_with_shards: ${{ steps.check_packages_and_shards.outputs.small_packages_with_shards }}
run_stacks_signer: ${{ steps.check_packages_and_shards.outputs.run_stacks_signer }}
too_many_mutants: ${{ steps.check_packages_and_shards.outputs.too_many_mutants }}
steps:
- id: check_packages_and_shards
uses: stacks-network/actions/stacks-core/mutation-testing/check-packages-and-shards@feat/mutation-testing
with:
ignore_timeout: ${{ inputs.ignore_timeout }}
# Mutation testing - Execute on PR on small packages that have functions modified (normal run, no shards)
pr-differences-mutants-small-normal:
name: Mutation Testing - Normal, Small
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_small_packages == 'true' &&
needs.check-big-packages-and-shards.outputs.small_packages_with_shards == 'false'
runs-on: ubuntu-latest
steps:
- name: Run mutants on diffs
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
package: 'small'
# Mutation testing - Execute on PR on small packages that have functions modified (run with strategy matrix shards)
pr-differences-mutants-small-shards:
name: Mutation Testing - Shards, Small
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_small_packages == 'true' &&
needs.check-big-packages-and-shards.outputs.small_packages_with_shards == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3]
steps:
- name: Run mutants on diffs
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
shard: ${{ matrix.shard }}
package: 'small'
# Mutation testing - Execute on PR on stackslib package (normal run, no shards)
pr-differences-mutants-stackslib-normal:
name: Mutation Testing - Normal, Stackslib
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stackslib == 'true' &&
needs.check-big-packages-and-shards.outputs.stackslib_with_shards == 'false'
runs-on: ubuntu-latest
steps:
- name: Run Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
package: 'stackslib'
# Mutation testing - Execute on PR on stackslib package (run with strategy matrix shards)
pr-differences-mutants-stackslib-shards:
name: Mutation Testing - Shards, Stackslib
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stackslib == 'true' &&
needs.check-big-packages-and-shards.outputs.stackslib_with_shards == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- name: Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
shard: ${{ matrix.shard }}
package: 'stackslib'
# Mutation testing - Execute on PR on stacks-node package (normal run, no shards)
pr-differences-mutants-stacks-node-normal:
name: Mutation Testing - Normal, Stacks Node
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stacks_node == 'true' &&
needs.check-big-packages-and-shards.outputs.stacks_node_with_shards == 'false'
runs-on: ubuntu-latest
steps:
- name: Run Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
package: 'stacks-node'
# Mutation testing - Execute on PR on stacks-node package (run with strategy matrix shards)
pr-differences-mutants-stacks-node-shards:
name: Mutation Testing - Shards, Stacks Node
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stacks_node == 'true' &&
needs.check-big-packages-and-shards.outputs.stacks_node_with_shards == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3]
steps:
- name: Run mutants on diffs
env:
BITCOIND_TEST: 1
RUST_BACKTRACE: full
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
shard: ${{ matrix.shard }}
package: 'stacks-node'
# Mutation testing - Execute on PR on stacks-signer package (normal run, no shards)
pr-differences-mutants-stacks-signer-normal:
name: Mutation Testing - Normal, Stacks Signer
needs: check-big-packages-and-shards
if: |
needs.check-big-packages-and-shards.outputs.run_stacks_signer == 'true'
runs-on: ubuntu-latest
steps:
- name: Run mutants on diffs
uses: stacks-network/actions/stacks-core/mutation-testing/pr-differences@feat/mutation-testing
with:
package: 'stacks-signer'
# Output the mutants and fail the workflow if there are missed/timeout/unviable mutants
output-mutants:
name: Output Mutants
runs-on: ubuntu-latest
if: always()
needs:
[
check-big-packages-and-shards,
pr-differences-mutants-small-normal,
pr-differences-mutants-small-shards,
pr-differences-mutants-stackslib-normal,
pr-differences-mutants-stackslib-shards,
pr-differences-mutants-stacks-node-normal,
pr-differences-mutants-stacks-node-shards,
pr-differences-mutants-stacks-signer-normal,
]
steps:
- name: Output Mutants
uses: stacks-network/actions/stacks-core/mutation-testing/output-pr-mutants@feat/mutation-testing
with:
stackslib_package: ${{ needs.check-big-packages-and-shards.outputs.run_stackslib }}
shards_for_stackslib_package: ${{ needs.check-big-packages-and-shards.outputs.stackslib_with_shards }}
stacks_node_package: ${{ needs.check-big-packages-and-shards.outputs.run_stacks_node }}
shards_for_stacks_node_package: ${{ needs.check-big-packages-and-shards.outputs.stacks_node_with_shards }}
small_packages: ${{ needs.check-big-packages-and-shards.outputs.run_small_packages }}
shards_for_small_packages: ${{ needs.check-big-packages-and-shards.outputs.small_packages_with_shards }}
stacks_signer: ${{ needs.check-big-packages-and-shards.outputs.run_stacks_signer }}
too_many_mutants: ${{ needs.check-big-packages-and-shards.outputs.too_many_mutants }}