Fix mutation tests workflow for push events
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
b11d81b40c
commit
1f734f932c
56
.github/workflows/mutation-tests.yml
vendored
56
.github/workflows/mutation-tests.yml
vendored
@ -20,9 +20,8 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
infection-changed-files:
|
||||
name: Infection for changed files
|
||||
if: github.event_name == 'pull_request' || github.event_name == 'push'
|
||||
infection:
|
||||
name: Infection
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
@ -65,56 +64,17 @@ jobs:
|
||||
run: composer run phpunit -- --testsuite unit --stop-on-failure
|
||||
|
||||
- name: Run Infection for changed files only
|
||||
if: github.event_name == 'pull_request'
|
||||
if: github.event_name == 'push' || github.event_name == 'pull_request'
|
||||
run: |
|
||||
infection -j$(nproc) --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF \
|
||||
if [ "$GITHUB_EVENT_NAME" = "push" ]; then \
|
||||
INFECTION_GIT_DIFF_BASE="origin/$GITHUB_REF_NAME^"; else \
|
||||
INFECTION_GIT_DIFF_BASE="origin/$GITHUB_BASE_REF"; fi
|
||||
infection -j$(nproc) --git-diff-lines --git-diff-base="$INFECTION_GIT_DIFF_BASE" \
|
||||
--logger-github --ignore-msi-with-no-mutations --only-covered \
|
||||
--skip-initial-tests --coverage=build/logs --no-interaction --no-progress
|
||||
|
||||
- name: Run Infection for changed files only
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
infection -j$(nproc) --git-diff-lines --git-diff-base=origin/$GITHUB_REF_NAME \
|
||||
--logger-github --ignore-msi-with-no-mutations --only-covered \
|
||||
--skip-initial-tests --coverage=build/logs --no-interaction --no-progress
|
||||
|
||||
infection-all-files:
|
||||
name: Infection for all files
|
||||
if: github.event_name == 'schedule'
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
php-version:
|
||||
- "8.2"
|
||||
operating-system:
|
||||
- ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Gettext
|
||||
run: sudo apt-get install -y gettext
|
||||
|
||||
- name: Generate mo files
|
||||
run: ./scripts/generate-mo --quiet
|
||||
|
||||
- name: Set up PHP ${{ matrix.php-version }}
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
coverage: pcov
|
||||
ini-values: memory_limit=-1
|
||||
tools: composer:v2, infection
|
||||
|
||||
- name: Install Composer dependencies
|
||||
uses: ramsey/composer-install@v2
|
||||
with:
|
||||
dependency-versions: highest
|
||||
|
||||
- name: Collect coverage report
|
||||
run: composer run phpunit -- --testsuite unit --stop-on-failure
|
||||
|
||||
- name: Run Infection for all files
|
||||
if: github.event_name == 'schedule'
|
||||
env:
|
||||
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
|
||||
run: infection -j$(nproc) --skip-initial-tests --coverage=build/logs --no-interaction --no-progress
|
||||
|
||||
Loading…
Reference in New Issue
Block a user