From ce4bf62d75199203c4a98079732d98ea382f77bb Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 14 Aug 2022 10:34:27 +0200 Subject: [PATCH] Added more granular resolution of arguments for infection based on branch --- .github/workflows/ci-mutation-tests.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-mutation-tests.yml b/.github/workflows/ci-mutation-tests.yml index a4ce7432..f152ed15 100644 --- a/.github/workflows/ci-mutation-tests.yml +++ b/.github/workflows/ci-mutation-tests.yml @@ -24,9 +24,19 @@ jobs: - uses: actions/download-artifact@v3 with: path: build + - name: Resolve infection args + id: infection_args + 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; + shell: bash - if: ${{ inputs.test-group == 'unit' }} - run: composer infect:ci:unit -- --git-diff-lines --logger-github=false + 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 }} -- --git-diff-lines --logger-github=false + run: composer infect:ci:${{ inputs.test-group }} -- ${{ steps.infection_args.outputs.args }}