All checks were successful
CI / unit-test (7.4) (push) Successful in 54s
CI / unit-test (8.0) (push) Successful in 53s
CI / quality (push) Successful in 44s
CI / unit-test (5.6) (push) Successful in 1m26s
CI / unit-test (8.2) (push) Successful in 52s
CI / unit-test (8.4) (push) Successful in 41s
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: CI
|
|
on: [ push, pull_request ]
|
|
jobs:
|
|
unit-test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php: [ '5.6', '7.4', '8.0', '8.2', '8.4' ]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
coverage: xdebug
|
|
tools: composer
|
|
- name: Install
|
|
run: composer install --no-interaction
|
|
- name: Unit tests
|
|
run: |
|
|
composer test
|
|
sed -i "s#<file name=\"${GITHUB_WORKSPACE}#<file name=\"/github/workspace#g" tests-clover.xml
|
|
- name: Analyze with SonarCloud
|
|
if: matrix.php == '8.2' && env.SONAR_TOKEN != ''
|
|
uses: sonarsource/sonarcloud-github-action@master
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
with:
|
|
args: >
|
|
-Dsonar.organization=stklcode-github
|
|
-Dsonar.projectKey=stklcode:statify-blacklist
|
|
-Dsonar.sources=inc,statify-blacklist.php
|
|
-Dsonar.tests=test
|
|
-Dsonar.php.tests.reportPath=tests-junit.xml
|
|
-Dsonar.php.coverage.reportPaths=tests-clover.xml
|
|
-Dsonar.coverage.exclusions=test/**/*.php
|
|
|
|
quality:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.2'
|
|
tools: composer
|
|
- name: Install
|
|
run: composer install --no-interaction
|
|
- name: Code style checks for PHP
|
|
run: composer test-cs
|