Skip to content

Commit 3516007

Browse files
Update test pipelines and dev dependencies
Co-authored-by: Wilmer Arambula <terabytesoftw@gmail.com>
1 parent b439271 commit 3516007

4 files changed

Lines changed: 49 additions & 67 deletions

File tree

.github/workflows/build.yml

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ name: build
66

77
jobs:
88
tests:
9-
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
10+
1011
env:
11-
extensions: curl, mbstring, dom, intl, json, libxml, xml, xmlwriter
1212
key: cache-v1
1313

1414
runs-on: ${{ matrix.os }}
@@ -19,76 +19,56 @@ jobs:
1919
- ubuntu-latest
2020
- windows-latest
2121

22-
php-version:
22+
php:
2323
- "7.4"
2424
- "8.0"
2525

2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v2
2929

30-
- name: Setup cache environment
31-
id: cache-env
32-
uses: shivammathur/cache-extensions@v1
33-
with:
34-
php-version: ${{ matrix.php-version }}
35-
extensions: ${{ env.extensions }}
36-
key: ${{ env.key }}
37-
38-
- name: Cache extensions
39-
uses: actions/cache@v1
40-
with:
41-
path: ${{ steps.cache-env.outputs.dir }}
42-
key: ${{ steps.cache-env.outputs.key }}
43-
restore-keys: ${{ steps.cache-env.outputs.key }}
44-
45-
- name: Install PHP with extensions
30+
- name: Install PHP
4631
uses: shivammathur/setup-php@v2
4732
with:
48-
php-version: ${{ matrix.php-version }}
49-
extensions: ${{ env.extensions }}
33+
php-version: ${{ matrix.php }}
5034
ini-values: date.timezone='UTC'
5135
coverage: pcov
5236
tools: composer:v2
5337

5438
- name: Determine composer cache directory on Linux
5539
if: matrix.os == 'ubuntu-latest'
56-
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
40+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
5741

5842
- name: Determine composer cache directory on Windows
5943
if: matrix.os == 'windows-latest'
60-
run: ECHO "::set-env name=COMPOSER_CACHE_DIR::~\AppData\Local\Composer"
44+
run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6145

6246
- name: Cache dependencies installed with composer
63-
uses: actions/cache@v1
47+
uses: actions/cache@v2
6448
with:
6549
path: ${{ env.COMPOSER_CACHE_DIR }}
66-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
50+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
6751
restore-keys: |
68-
php${{ matrix.php-version }}-composer-
52+
php${{ matrix.php }}-composer-
6953
7054
- name: Install dependencies with composer php 7.4
71-
if: matrix.php-version == '7.4'
72-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
55+
if: matrix.php == '7.4'
56+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
7357

7458
- name: Install dependencies with composer php 8.0
75-
if: matrix.php-version == '8.0'
76-
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader
59+
if: matrix.php == '8.0'
60+
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
7761

7862
- name: Run tests with phpunit and coverage on Linux php 7.4
79-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
80-
run: vendor/bin/phpunit --coverage-clover=coverage.clover
81-
82-
- name: Run tests with phpunit without coverage on Linux php 8.0
83-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.0'
84-
run: vendor/bin/phpunit
63+
if: matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
64+
run: vendor/bin/phpunit --coverage-clover=coverage.clover --colors=always
8565

86-
- name: Run tests with phpunit without coverage on Windows
87-
if: matrix.os == 'windows-latest'
88-
run: vendor/bin/phpunit
66+
- name: Run tests with phpunit without coverage on Windows php 7.4 - 8.0 and Linux php 8.0
67+
if: matrix.os != 'ubuntu-latest' || matrix.php != '7.4'
68+
run: vendor/bin/phpunit --colors=always
8969

9070
- name: Upload code coverage scrutinizer on Linux php 7.4
91-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
71+
if: matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
9272
run: |
9373
wget https://scrutinizer-ci.com/ocular.phar
9474
php ocular.phar code-coverage:upload --format=php-clover coverage.clover

.github/workflows/mutation.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name: mutation test
88

99
jobs:
1010
mutation:
11-
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
11+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
1212

1313
runs-on: ${{ matrix.os }}
1414

@@ -17,36 +17,38 @@ jobs:
1717
os:
1818
- ubuntu-latest
1919

20-
php-version:
20+
php:
2121
- "7.4"
2222

2323
steps:
24-
- name: "Checkout"
25-
uses: "actions/checkout@v2"
24+
- name: Checkout
25+
uses: actions/checkout@v2
2626

27-
- name: "Install PHP"
28-
uses: "shivammathur/setup-php@v2"
27+
- name: Install PHP
28+
uses: shivammathur/setup-php@v2
2929
with:
3030
coverage: "pcov"
31-
php-version: "${{ matrix.php-version }}"
31+
php-version: "${{ matrix.php }}"
3232
ini-values: memory_limit=-1
3333
tools: composer:v2
3434

3535
- name: Determine composer cache directory
36-
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
36+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
3737

3838
- name: Cache dependencies installed with composer
39-
uses: actions/cache@v1
39+
uses: actions/cache@v2
4040
with:
4141
path: ${{ env.COMPOSER_CACHE_DIR }}
42-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
42+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
4343
restore-keys: |
44-
php${{ matrix.php-version }}-composer-
44+
php${{ matrix.php }}-composer-
4545
4646
- name: Install dependencies with composer
47-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
47+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4848

49-
- name: Run test mutation infection with coverage
50-
run: vendor/bin/infection
49+
- name: Run infection
50+
run: |
51+
git fetch --depth=1 origin $GITHUB_BASE_REF
52+
vendor/bin/infection -j2 --git-diff-filter=A --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --ignore-msi-with-no-mutations --only-covered
5153
env:
5254
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/static.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: static analysis
66

77
jobs:
88
mutation:
9-
name: PHP ${{ matrix.php-version }}-${{ matrix.os }}
9+
name: PHP ${{ matrix.php }}-${{ matrix.os }}
1010

1111
runs-on: ${{ matrix.os }}
1212

@@ -15,33 +15,33 @@ jobs:
1515
os:
1616
- ubuntu-latest
1717

18-
php-version:
18+
php:
1919
- "7.4"
2020

2121
steps:
22-
- name: "Checkout"
23-
uses: "actions/checkout@v2"
22+
- name: Checkout
23+
uses: actions/checkout@v2
2424

25-
- name: "Install PHP"
26-
uses: "shivammathur/setup-php@v2"
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
2727
with:
28-
php-version: "${{ matrix.php-version }}"
28+
php-version: "${{ matrix.php }}"
2929
tools: composer:v2, cs2pr
3030
coverage: none
3131

3232
- name: Determine composer cache directory
33-
run: echo "::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)"
33+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
3434

3535
- name: Cache dependencies installed with composer
3636
uses: actions/cache@v2
3737
with:
3838
path: ${{ env.COMPOSER_CACHE_DIR }}
39-
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
39+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
4040
restore-keys: |
41-
php${{ matrix.php-version }}-composer-
41+
php${{ matrix.php }}-composer-
4242
4343
- name: Install dependencies with composer
44-
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
44+
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4545

4646
- name: Static analysis with psalm
4747
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle | cs2pr --graceful-warnings --colorize

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"yiisoft/var-dumper": "^3.0@dev"
2727
},
2828
"require-dev": {
29-
"infection/infection": "^0.18.0",
30-
"phpunit/phpunit": "^9.3",
29+
"infection/infection": "^0.20.0",
30+
"phpunit/phpunit": "^9.4",
3131
"vimeo/psalm": "^4.0"
3232
},
3333
"provide": {

0 commit comments

Comments
 (0)