-
-
Notifications
You must be signed in to change notification settings - Fork 13
73 lines (59 loc) · 2.22 KB
/
mutation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
on:
pull_request:
push:
branches:
- "master"
name: mutation test
jobs:
mutation:
name: PHP ${{ matrix.php }}-${{ matrix.os }}
env:
extensions: curl, intl, pdo, pdo_sqlsrv
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
php:
- "7.4"
services:
mssql:
image: mcr.microsoft.com/mssql/server:2017-latest
env:
SA_PASSWORD: YourStrong!Passw0rd
ACCEPT_EULA: Y
MSSQL_PID: Developer
ports:
- 1433:1433
options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: Create MS SQL Database
run: docker exec -i mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
extensions: ${{ env.extensions }}
ini-values: memory_limit=-1
coverage: "pcov"
tools: composer:v2, pecl
- name: Determine composer cache directory
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
- name: Cache dependencies installed with composer
uses: actions/cache@v2.1.1
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
- name: Run test mutation infection with coverage
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-xml=build/logs/coverage-xml --log-junit=build/logs/junit.xml
vendor/bin/infection --threads=2 --coverage=build/logs --show-mutations --no-progress
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}