Skip to content

Commit 670b7d9

Browse files
committed
ci: add mutation testing job
1 parent f41cc33 commit 670b7d9

File tree

2 files changed

+71
-6
lines changed

2 files changed

+71
-6
lines changed

.github/workflows/testing.yml

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ name: 🧪 Testing (SQLite)
1111
env:
1212
# Disable docker support in Makefile
1313
APP_RUNNER: 'cd app &&'
14+
APP_NAME: laravel
15+
SHARED_SERVICES_NAMESPACE: ss
16+
COMPOSE_PROJECT_NAME: laravel-starter-tpl
1417

1518
jobs:
1619
code-coverage:
@@ -70,10 +73,6 @@ jobs:
7073
run: |
7174
make env
7275
cp -rf .env app/.env
73-
env:
74-
APP_NAME: laravel
75-
SHARED_SERVICES_NAMESPACE: ss
76-
COMPOSE_PROJECT_NAME: laravel-starter-tpl
7776
7877
- name: 🔑 Generate secret application key
7978
working-directory: app
@@ -89,3 +88,69 @@ jobs:
8988
files: app/.build/phpunit/logs/clover.xml
9089
token: ${{ secrets.CODECOV_TOKEN }}
9190
verbose: true
91+
92+
mutation-testing:
93+
timeout-minutes: 16
94+
runs-on: ${{ matrix.os }}
95+
concurrency:
96+
cancel-in-progress: true
97+
group: mutation-testing-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
98+
strategy:
99+
fail-fast: true
100+
matrix:
101+
os:
102+
- ubuntu-latest
103+
php-version:
104+
- '8.3'
105+
dependencies:
106+
- locked
107+
steps:
108+
- name: 📦 Check out the codebase
109+
uses: actions/[email protected]
110+
111+
- name: 🛠️ Setup PHP
112+
uses: shivammathur/[email protected]
113+
with:
114+
php-version: ${{ matrix.php-version }}
115+
extensions: mbstring, pdo, pdo_sqlite
116+
ini-values: error_reporting=E_ALL
117+
coverage: xdebug
118+
119+
- name: 🛠️ Setup problem matchers
120+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
121+
122+
- name: 🤖 Validate composer.json and composer.lock
123+
run: make validate-composer
124+
125+
- name: 🔍 Get composer cache directory
126+
uses: wayofdev/gh-actions/actions/composer/[email protected]
127+
with:
128+
working-directory: app
129+
130+
- name: ♻️ Restore cached dependencies installed with composer
131+
uses: actions/[email protected]
132+
with:
133+
path: ${{ env.COMPOSER_CACHE_DIR }}
134+
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}
135+
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
136+
137+
- name: 📥 Install "${{ matrix.dependencies }}" dependencies with composer
138+
uses: wayofdev/gh-actions/actions/composer/[email protected]
139+
with:
140+
working-directory: app
141+
dependencies: ${{ matrix.dependencies }}
142+
143+
- name: 🛠️ Prepare environment
144+
run: |
145+
make env
146+
cp -rf .env app/.env
147+
148+
- name: 🔑 Generate secret application key
149+
working-directory: app
150+
run: php artisan key:generate
151+
152+
- name: 🧪 Run mutation testing using Xdebug and infection/infection
153+
working-directory: app
154+
run: composer infect:ci
155+
env:
156+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<p align="center">
1313
<strong>Build</strong><br>
1414
<a href="https://actions-badge.atrox.dev/wayofdev/laravel-starter-tpl/goto" target="_blank"><img alt="Build Status" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Flaravel-starter-tpl%2Fbadge&style=flat-square&label=github%20actions"/></a>
15-
<a href="https://github.com/wayofdev/laravel-starter-tpl/actions/workflows/deploy-staging.yml?query=workflow%3ADeploy" target="_blank"><img alt="Deploy to Staging Status" src="https://github.com/wayofdev/laravel-starter-tpl/actions/workflows/deploy-staging.yml/badge.svg?style=flat-square"/></a>
16-
<a href="https://github.com/wayofdev/laravel-starter-tpl/actions/workflows/deploy-release.yml?query=workflow%3ADeploy" target="_blank"><img alt="Deploy to Production Status" src="https://github.com/wayofdev/laravel-starter-tpl/actions/workflows/deploy-release.yml/badge.svg?style=flat-square"/></a>
15+
<a href="https://github.com/wayofdev/laravel-starter-tpl/actions/workflows/deploy-staging.yml?query=workflow%3ADeploy" target="_blank"><img alt="Deploy to Staging Status" src="https://img.shields.io/github/actions/workflow/status/wayofdev/laravel-starter-tpl/deploy-staging.yml?branch=develop&style=flat-square&label=deploy%20to%20staging&logo=github"/></a>
16+
<a href="https://github.com/wayofdev/laravel-starter-tpl/actions/workflows/deploy-release.yml?query=workflow%3ADeploy" target="_blank"><img alt="Deploy to Production Status" src="https://img.shields.io/github/actions/workflow/status/wayofdev/laravel-starter-tpl/deploy-release.yml?style=flat-square&label=deploy%20to%20prod&logo=github"/></a>
1717
</p>
1818
<p align="center">
1919
<strong>Project</strong><br>

0 commit comments

Comments
 (0)