.github/workflows/ci.yml
name: CI
on: [ push ]
jobs:
build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php-versions: [ '8.0', '8.1', '8.2', '8.3' ]
name: PHP ${{ matrix.php-versions }} ${{ matrix.operating-system }}
steps:
- name: Git Configure
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: intl #optional
ini-values: "post_max_size=256M" #optional
- name: Prepare FS
run: mkdir -p build/logs
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --ignore-platform-reqs
- name: PHPUnit
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: PHPCS
run: vendor/bin/phpcs --standard=psr12 src/ -s
coverage:
name: Coverage Reports
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: intl #optional
ini-values: "post_max_size=256M" #optional
- name: Prepare FS
run: mkdir -p build/logs
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --ignore-platform-reqs
- name: PHPUnit
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
- name: CodeClimate
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageLocations: |
${{github.workspace}}/build/logs/clover.xml:clover