-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create reusable mutalk-workflow.yml
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: MutalkCI | ||
|
||
# This reusable workflow defines a mutation testing CI to run on a ginven project | ||
# Specify the mode (full or diff) to run mutations | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
mode: | ||
description: 'modes: full (run on all project), diff (run on the last commit diff)' | ||
default: 'full' | ||
type: string | ||
|
||
jobs: | ||
mutation_testing: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: hpi-swa/setup-smalltalkCI@v1 | ||
id: smalltalkci | ||
with: | ||
smalltalk-image: Pharo64-stable | ||
|
||
- run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }} | ||
shell: bash | ||
timeout-minutes: 15 | ||
|
||
- run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} metacello install "github://pharo-contributions/mutalk/src" BaselineOfMuTalk | ||
shell: bash | ||
|
||
- name: full mutation testing | ||
if: inputs.mode == 'full' | ||
run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}} | ||
|
||
- name: diff mutation testing | ||
if: inputs.mode == 'diff' | ||
run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}} --diff | ||
|
||
- name: Comment PR | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
comment_tag: mut_report | ||
filePath: "${{env.SMALLTALK_CI_BUILD_BASE}}/__mutalk_summary.md" | ||
|
||
- run: cp ${{env.SMALLTALK_CI_BUILD_BASE}}/__mutalk_summary.md $GITHUB_STEP_SUMMARY | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: mutation-testing-output | ||
path: ${{env.SMALLTALK_CI_BUILD_BASE}}/__mutalk_export.json |