Skip to content

Commit

Permalink
fix: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Scarbous authored Nov 6, 2023
1 parent 031227e commit 674a58c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/actions/codecoverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:
- name: 'Generate Unit Test Code Coverage Summary Report'
uses: saschanowak/[email protected]
with:
filename: shop/Build/Artifacts/Reports/Unit/clover.xml
filename: build/clover.xml

- shell: bash
run: cat code-coverage-summary.md >> $GITHUB_STEP_SUMMARY
Expand All @@ -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
21 changes: 17 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: CI

on: [ push, pull_request ]
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
test:
Expand All @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 674a58c

Please sign in to comment.