Skip to content

Aggregate duplicate findings and show a white count on findings and s… #62

Aggregate duplicate findings and show a white count on findings and s…

Aggregate duplicate findings and show a white count on findings and s… #62

Workflow file for this run

name: "CI"
on:
pull_request:
types: [ "opened", "synchronize", "edited", "reopened" ]
paths-ignore:
- "docs/**"
push:
branches:
- "**"
paths-ignore:
- "docs/**"
schedule:
- cron: "0 8 * * 1" # At 08:00 on Monday
workflow_dispatch:
inputs: {}
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
permissions:
contents: "read"
jobs:
coding-standard:
name: "Coding standard"
runs-on: "${{ matrix.operating-system }}"
if: |
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
include:
- operating-system: "ubuntu-latest"
php-version: "8.4"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "PHP"
uses: "orisai/github-workflows/.github/actions/setup-php@v1"
with:
version: "${{ matrix.php-version }}"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Composer"
uses: "orisai/github-workflows/.github/actions/setup-composer@v1"
- name: "PHP_CodeSniffer"
uses: "orisai/github-workflows/.github/actions/php-codesniffer@v1"
with:
command: "make cs ARGS='--report=checkstyle -q | vendor/bin/cs2pr'"
cache-path: "var/tools/PHP_CodeSniffer"
static-analysis:
name: "Static analysis"
runs-on: "${{ matrix.operating-system }}"
if: |
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
include:
- operating-system: "ubuntu-latest"
php-version: "8.4"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "PHP"
uses: "orisai/github-workflows/.github/actions/setup-php@v1"
with:
version: "${{ matrix.php-version }}"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Composer"
uses: "orisai/github-workflows/.github/actions/setup-composer@v1"
- name: "PHPStan"
uses: "orisai/github-workflows/.github/actions/phpstan@v1"
with:
command: "make phpstan"
cache-path: "var/tools/PHPStan"
tests:
name: "Tests - ${{ matrix.name }}"
runs-on: "${{ matrix.operating-system }}"
continue-on-error: "${{ matrix.experimental }}"
if: |
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
fail-fast: false
matrix:
include:
# Full PHP sweep on the baseline pair (oldest supported MySQL + current MariaDB LTS)
- name: "PHP 7.4"
operating-system: "ubuntu-latest"
php-version: "7.4"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: ""
composer-require: ""
experimental: false
- name: "PHP 8.0"
operating-system: "ubuntu-latest"
php-version: "8.0"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: ""
composer-require: ""
experimental: false
- name: "PHP 8.1"
operating-system: "ubuntu-latest"
php-version: "8.1"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: ""
composer-require: ""
experimental: false
- name: "PHP 8.2"
operating-system: "ubuntu-latest"
php-version: "8.2"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: ""
composer-require: ""
experimental: false
- name: "PHP 8.3"
operating-system: "ubuntu-latest"
php-version: "8.3"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: ""
composer-require: ""
experimental: false
- name: "PHP 8.4"
operating-system: "ubuntu-latest"
php-version: "8.4"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: ""
composer-require: ""
experimental: false
# Lowest dependencies (dibi 4.x + nextras/dbal 1.x) on the minimum PHP
- name: "PHP 7.4, lowest deps"
operating-system: "ubuntu-latest"
php-version: "7.4"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: "--prefer-lowest --prefer-stable"
composer-require: ""
experimental: false
# Mid-major library coverage: nextras/dbal 4.x (lowest picks 1.x, newest picks 5.x)
- name: "PHP 8.1, nextras-dbal 4"
operating-system: "ubuntu-latest"
php-version: "8.1"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: ""
composer-require: "nextras/dbal:^4.0.0"
experimental: false
# Additional database versions on the latest PHP
- name: "MySQL 8.4, MariaDB 10.11"
operating-system: "ubuntu-latest"
php-version: "8.4"
mysql-version: "8.4"
mariadb-version: "10.11"
composer-flags: ""
composer-require: ""
experimental: false
- name: "MySQL 9.4, MariaDB 12.0"
operating-system: "ubuntu-latest"
php-version: "8.4"
mysql-version: "9.4"
mariadb-version: "12.0"
composer-flags: ""
composer-require: ""
experimental: false
# Other operating systems - service containers are Linux-only, so these are best-effort
- name: "macOS (best-effort)"
operating-system: "macos-latest"
php-version: "8.4"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: ""
composer-require: ""
experimental: true
- name: "Windows (best-effort)"
operating-system: "windows-latest"
php-version: "8.4"
mysql-version: "8.0"
mariadb-version: "11.4"
composer-flags: ""
composer-require: ""
experimental: true
services:
mysql:
image: "mysql:${{ matrix.mysql-version }}"
options: >-
--health-cmd "mysqladmin ping --silent"
-e MYSQL_ROOT_PASSWORD=root
ports:
- "35306:3306"
mariadb:
image: "mariadb:${{ matrix.mariadb-version }}"
options: >-
--health-cmd "mariadb-admin ping --silent"
-e MARIADB_ROOT_PASSWORD=root
ports:
- "35307:3306"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "PHP"
uses: "orisai/github-workflows/.github/actions/setup-php@v1"
with:
version: "${{ matrix.php-version }}"
coverage: "pcov"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Pin dependencies"
if: "${{ matrix.composer-require != '' }}"
run: "composer require ${{ matrix.composer-require }} --no-update --no-interaction"
- name: "Composer"
uses: "orisai/github-workflows/.github/actions/setup-composer@v1"
with:
command: "composer update --no-interaction --no-progress --prefer-dist ${{ matrix.composer-flags }}"
- name: "PHPUnit"
uses: "orisai/github-workflows/.github/actions/phpunit@v1"
with:
command: "make coverage-clover"
cache-path: "var/tools/PHPUnit"
- name: "Coveralls"
uses: "orisai/github-workflows/.github/actions/coveralls-php-upload@v1"
with:
config: "tools/.coveralls.yml"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Upload logs"
uses: "actions/upload-artifact@v4"
with:
name: "Logs - Tests - ${{ matrix.name }}"
path: "var/log"
if-no-files-found: "ignore"
coverage-finish:
name: "Code coverage finish"
needs: "tests"
runs-on: "${{ matrix.operating-system }}"
if: |
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
include:
- operating-system: "ubuntu-latest"
php-version: "8.4"
steps:
- name: "Coveralls"
uses: "orisai/github-workflows/.github/actions/coveralls-finish@v1"
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tests-mutations:
name: "Test for mutants"
runs-on: "${{ matrix.operating-system }}"
if: |
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
include:
- operating-system: "ubuntu-latest"
php-version: "8.4"
services:
mysql:
image: "mysql:8.0"
options: >-
--health-cmd "mysqladmin ping --silent"
-e MYSQL_ROOT_PASSWORD=root
ports:
- "35306:3306"
mariadb:
image: "mariadb:11.4"
options: >-
--health-cmd "mariadb-admin ping --silent"
-e MARIADB_ROOT_PASSWORD=root
ports:
- "35307:3306"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "PHP"
uses: "orisai/github-workflows/.github/actions/setup-php@v1"
with:
version: "${{ matrix.php-version }}"
coverage: "pcov"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Composer"
uses: "orisai/github-workflows/.github/actions/setup-composer@v1"
- name: "PHPUnit"
uses: "orisai/github-workflows/.github/actions/phpunit@v1"
with:
command: "make mutations-tests"
cache-path: "var/tools/PHPUnit"
- name: "Infection PHP"
uses: "orisai/github-workflows/.github/actions/infection-php@v1"
with:
command: "make mutations-infection ARGS='--logger-github'"
cache-path: "var/tools/Infection"
stryker-token: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}"
- name: "Upload logs"
uses: "actions/upload-artifact@v4"
with:
name: "Logs - Mutations"
path: "var/coverage/mutations/infection.log"
if-no-files-found: "ignore"
status-check:
name: "Status check - ${{ github.workflow }}"
runs-on: "ubuntu-latest"
needs: [ "coding-standard", "static-analysis", "tests", "tests-mutations" ]
if: "${{ always() }}"
steps:
- name: "Check required jobs are successful"
uses: "orisai/github-workflows/.github/actions/status-check@v1"
with:
needs: "${{ toJSON(needs) }}"