mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-25 02:10:18 -06:00
46 lines
1.7 KiB
YAML
46 lines
1.7 KiB
YAML
name: Mutation tests
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
test-group:
|
|
type: string
|
|
required: true
|
|
description: One of unit, db, api or cli
|
|
|
|
jobs:
|
|
mutation-tests:
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
matrix:
|
|
php-version: ['8.1', '8.2']
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: './.github/actions/ci-setup'
|
|
with:
|
|
php-version: ${{ matrix.php-version }}
|
|
php-extensions: openswoole-22.0.0
|
|
extensions-cache-key: mutation-tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: coverage-${{ inputs.test-group }}
|
|
path: build
|
|
- name: Resolve infection args
|
|
id: infection_args
|
|
run: echo "args=--logger-github=false" >> $GITHUB_OUTPUT
|
|
# TODO Try to filter mutation tests to improve execution times. Investigate why --git-diff-lines --git-diff-base=develop does not work
|
|
# run: |
|
|
# BRANCH="${GITHUB_REF#refs/heads/}" |
|
|
# if [[ $BRANCH == 'main' || $BRANCH == 'develop' ]]; then
|
|
# echo "args=--logger-github=false" >> $GITHUB_OUTPUT
|
|
# else
|
|
# echo "args=--logger-github=false --git-diff-lines --git-diff-base=develop" >> $GITHUB_OUTPUT
|
|
# fi;
|
|
shell: bash
|
|
- if: ${{ inputs.test-group == 'unit' }}
|
|
run: composer infect:ci:unit -- ${{ steps.infection_args.outputs.args }}
|
|
env:
|
|
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
|
|
- if: ${{ inputs.test-group != 'unit' }}
|
|
run: composer infect:ci:${{ inputs.test-group }} -- ${{ steps.infection_args.outputs.args }}
|