2022-08-12 02:30:52 -05:00
|
|
|
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:
|
2022-09-24 01:03:38 -05:00
|
|
|
php-version: ['8.1', '8.2']
|
2022-08-12 02:30:52 -05:00
|
|
|
steps:
|
2022-08-13 04:06:41 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-13 04:16:33 -05:00
|
|
|
- uses: './.github/actions/ci-setup'
|
2022-08-12 13:32:16 -05:00
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
2022-10-03 13:00:31 -05:00
|
|
|
php-extensions: openswoole-4.12.0
|
2022-08-13 03:53:24 -05:00
|
|
|
extensions-cache-key: mutation-tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
|
2022-08-12 11:19:12 -05:00
|
|
|
- uses: actions/download-artifact@v3
|
2022-08-12 02:30:52 -05:00
|
|
|
with:
|
2022-08-17 12:07:39 -05:00
|
|
|
name: coverage-${{ inputs.test-group }}
|
2022-08-12 02:30:52 -05:00
|
|
|
path: build
|
2022-08-14 03:34:27 -05:00
|
|
|
- name: Resolve infection args
|
|
|
|
id: infection_args
|
2022-08-14 06:18:29 -05:00
|
|
|
run: echo "::set-output name=args::--logger-github=false"
|
|
|
|
# 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 "::set-output name=args::--logger-github=false"
|
|
|
|
# else
|
|
|
|
# echo "::set-output name=args::--logger-github=false --git-diff-lines --git-diff-base=develop"
|
|
|
|
# fi;
|
2022-08-14 03:34:27 -05:00
|
|
|
shell: bash
|
2022-08-12 02:30:52 -05:00
|
|
|
- if: ${{ inputs.test-group == 'unit' }}
|
2022-08-14 03:34:27 -05:00
|
|
|
run: composer infect:ci:unit -- ${{ steps.infection_args.outputs.args }}
|
2022-08-12 02:30:52 -05:00
|
|
|
env:
|
|
|
|
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
|
|
|
|
- if: ${{ inputs.test-group != 'unit' }}
|
2022-08-14 03:34:27 -05:00
|
|
|
run: composer infect:ci:${{ inputs.test-group }} -- ${{ steps.infection_args.outputs.args }}
|