From a178ea6feffa5d8a6e4fd5565cdab900cc8b3e10 Mon Sep 17 00:00:00 2001 From: Guille Polito Date: Fri, 5 Jul 2024 15:56:12 +0200 Subject: [PATCH 1/4] Create mutalk-workflow.yml --- .github/workflows/mutalk-workflow.yml | 55 +++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/mutalk-workflow.yml diff --git a/.github/workflows/mutalk-workflow.yml b/.github/workflows/mutalk-workflow.yml new file mode 100644 index 00000000..681b3628 --- /dev/null +++ b/.github/workflows/mutalk-workflow.yml @@ -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)' + required: true + default: 'diff' + +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: github.event.inputs.mode == 'full' + run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}} + + - name: diff mutation testing + if: github.event.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 From fa5e027627cf561bbc3b667bcf8b35adf697a509 Mon Sep 17 00:00:00 2001 From: Guille Polito Date: Fri, 5 Jul 2024 16:16:01 +0200 Subject: [PATCH 2/4] Add type --- .github/workflows/mutalk-workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mutalk-workflow.yml b/.github/workflows/mutalk-workflow.yml index 681b3628..953bea0d 100644 --- a/.github/workflows/mutalk-workflow.yml +++ b/.github/workflows/mutalk-workflow.yml @@ -10,6 +10,7 @@ on: description: 'modes: full (run on all project), diff (run on the last commit diff)' required: true default: 'diff' + type: string jobs: mutation_testing: From b9362662680f00c5d39868440fe35d8a4c880a34 Mon Sep 17 00:00:00 2001 From: Guille Polito Date: Fri, 5 Jul 2024 16:19:30 +0200 Subject: [PATCH 3/4] Update mutalk-workflow.yml --- .github/workflows/mutalk-workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/mutalk-workflow.yml b/.github/workflows/mutalk-workflow.yml index 953bea0d..2d4c35c7 100644 --- a/.github/workflows/mutalk-workflow.yml +++ b/.github/workflows/mutalk-workflow.yml @@ -8,7 +8,6 @@ on: inputs: mode: description: 'modes: full (run on all project), diff (run on the last commit diff)' - required: true default: 'diff' type: string From fa29a6aeedd3912e9b308e83fc98969ffce93ef8 Mon Sep 17 00:00:00 2001 From: Guille Polito Date: Fri, 5 Jul 2024 16:23:20 +0200 Subject: [PATCH 4/4] Update mutalk-workflow.yml --- .github/workflows/mutalk-workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mutalk-workflow.yml b/.github/workflows/mutalk-workflow.yml index 2d4c35c7..139c0d37 100644 --- a/.github/workflows/mutalk-workflow.yml +++ b/.github/workflows/mutalk-workflow.yml @@ -8,7 +8,7 @@ on: inputs: mode: description: 'modes: full (run on all project), diff (run on the last commit diff)' - default: 'diff' + default: 'full' type: string jobs: @@ -34,11 +34,11 @@ jobs: shell: bash - name: full mutation testing - if: github.event.inputs.mode == 'full' + if: inputs.mode == 'full' run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}} - name: diff mutation testing - if: github.event.inputs.mode == 'diff' + if: inputs.mode == 'diff' run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}} --diff - name: Comment PR