Skip to content

feat(ci): migrate php checks , docs, and php unit tests from Drone to GitHub Actions #7

feat(ci): migrate php checks , docs, and php unit tests from Drone to GitHub Actions

feat(ci): migrate php checks , docs, and php unit tests from Drone to GitHub Actions #7

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
COMPOSER_HOME: ${{ github.workspace }}/.cache/composer
jobs:
php-checks:
name: PHP checks ${{ matrix.php-version}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version : ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
- uses: actions/cache@v4
with:
path: .cache/composer
key: composer-${{ hashFiles('composer.lock') }}
- run: composer install
- name: codeStyle-${{ matrix.php-version }}
run: make test-php-style
- name: phpStan-${{ matrix.php-version }}
run: make test-php-phpstan
- name: phpPhan-${{ matrix.php-version }}
run: make test-php-phan
unit-tests-without-coverage:
name: unit tests without coverage ${{ matrix.php-version}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version : ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: none
- uses: actions/cache@v4
with:
path: .cache/composer
key: composer-${{ hashFiles('composer.lock') }}
- run: composer install
- name: unitTests-${{ matrix.php-version }}
run: make test-php-unit
unit-tests-with-coverage:
name: unit tests with coverage ${{ matrix.php-version}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version : ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: xdebug
- uses: actions/cache@v4
with:
path: .cache/composer
key: composer-${{ hashFiles('composer.lock') }}
- run: composer install
- name: unitTests-${{ matrix.php-version }}
run: make test-php-unit
- name: coverage rename
run: |
mv tests/output/clover.xml tests/output/clover-unitTests-${{ matrix.php-version }}.xml
- uses: actions/upload-artifact@v4
with:
name: coverage-unitTests-${{ matrix.php-version }}
path: tests/output/clover-unitTests-${{ matrix.php-version }}.xml