Skip to content

Commit

Permalink
Create mutalk-workflow.yml (#120)
Browse files Browse the repository at this point in the history
Create reusable mutalk-workflow.yml
  • Loading branch information
guillep authored Jul 5, 2024
1 parent 7a75b07 commit c83f711
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/mutalk-workflow.yml
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

0 comments on commit c83f711

Please sign in to comment.