Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Use reusables actions. (#24)
Browse files Browse the repository at this point in the history
* Use reusables actions.

* Remove unnecesary mutation tests.
  • Loading branch information
terabytesoftw committed May 22, 2022
1 parent 0c915ae commit 7ddc1be
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 178 deletions.
63 changes: 7 additions & 56 deletions .github/workflows/build.yml
Expand Up @@ -22,60 +22,11 @@ on:
name: build

jobs:
tests:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

env:
phpunit:
uses: yiisoft/actions/.github/workflows/phpunit.yml@master
with:
extensions: fileinfo
key: cache-v1

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

strategy:
matrix:
os:
- ubuntu-latest
- windows-latest

php:
- 7.4
- 8.0
- 8.1

steps:
- name: Checkout
uses: actions/checkout@v2.3.4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
coverage: pcov
tools: composer:v2

- name: Determine composer cache directory on Linux
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

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

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit
run: vendor/bin/phpunit --colors=always
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
['7.4', '8.0', '8.1']
73 changes: 0 additions & 73 deletions .github/workflows/mutation.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/mutation.yml_
@@ -0,0 +1,31 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'

name: mutation test

jobs:
mutation:
uses: yiisoft/actions/.github/workflows/roave-infection.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['8.1']
secrets:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
52 changes: 7 additions & 45 deletions .github/workflows/static.yml
Expand Up @@ -22,48 +22,10 @@ on:
name: static analysis

jobs:
mutation:
name: PHP ${{ matrix.php }}-${{ matrix.os }}

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

strategy:
matrix:
os:
- ubuntu-latest

php:
- 7.4
- 8.0
- 8.1

steps:
- name: Checkout
uses: actions/checkout@v2.3.4

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2, cs2pr
coverage: none

- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update

- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Static analysis
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle | cs2pr --graceful-warnings --colorize
psalm:
uses: yiisoft/actions/.github/workflows/psalm.yml@master
with:
os: >-
['ubuntu-latest']
php: >-
['7.4', '8.0', '8.1']
8 changes: 4 additions & 4 deletions .scrutinizer.yml
Expand Up @@ -3,16 +3,16 @@ checks:

filter:
paths:
- "src/*"
- src/

build:
image: default-bionic

environment:
php:
version: 8.0.11
version: 8.0.18
ini:
"xdebug.mode": coverage
xdebug.mode: coverage

nodes:
analysis:
Expand All @@ -28,7 +28,7 @@ build:

tests:
override:
- command: "./vendor/bin/phpunit --coverage-clover ./coverage.xml"
- command: ./vendor/bin/phpunit --coverage-clover ./coverage.xml
on_node: 1
coverage:
file: coverage.xml
Expand Down

0 comments on commit 7ddc1be

Please sign in to comment.