From 674a58c89ea543d804d9a508c2ced6e6003163ed Mon Sep 17 00:00:00 2001 From: Sascha Heilmeier Date: Mon, 6 Nov 2023 09:06:54 +0100 Subject: [PATCH] fix: workflow --- .github/actions/codecoverage/action.yml | 4 ++-- .github/workflows/test.yaml | 21 +++++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/actions/codecoverage/action.yml b/.github/actions/codecoverage/action.yml index 796b5dc..d66169f 100644 --- a/.github/actions/codecoverage/action.yml +++ b/.github/actions/codecoverage/action.yml @@ -8,7 +8,7 @@ runs: - name: 'Generate Unit Test Code Coverage Summary Report' uses: saschanowak/CloverCodeCoverageSummary@0.3.1 with: - filename: shop/Build/Artifacts/Reports/Unit/clover.xml + filename: build/clover.xml - shell: bash run: cat code-coverage-summary.md >> $GITHUB_STEP_SUMMARY @@ -17,4 +17,4 @@ runs: uses: marocchino/sticky-pull-request-comment@v2 with: recreate: true - path: code-coverage-merged.md + path: code-coverage-summary.md diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6510847..fa78560 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,14 @@ name: CI -on: [ push, pull_request ] +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop jobs: test: @@ -19,7 +27,7 @@ jobs: - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -58,11 +66,16 @@ jobs: php_extensions: "xdebug" configuration: "phpunit.xml" + - uses: actions/upload-artifact@v3 + with: + name: clover + path: build/clover.xml + - name: 'Generate Code Coverage Report' uses: ./.github/actions/codecoverage - if: "matrix.env.php == '8.2' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'" + if: ${{ matrix.env.php == '8.2' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }} - name: Run Infection for added files only run: | git fetch --depth=1 origin $GITHUB_BASE_REF - php bin/infection -j2 --git-diff-filter=A --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --ignore-msi-with-no-mutations --only-covered + vendor/bin/infection -j2 --git-diff-base="origin/develop" --git-diff-filter=A --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --ignore-msi-with-no-mutations