Skip to content

Commit

Permalink
[CI] Drop laminas-continuous-integration-action, add jobs static Co…
Browse files Browse the repository at this point in the history
…nfig
  • Loading branch information
Slamdunk committed Oct 28, 2024
1 parent ff10c7f commit af6f608
Showing 1 changed file with 97 additions and 26 deletions.
123 changes: 97 additions & 26 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,107 @@
# See https://github.com/laminas/laminas-continuous-integration-action
# Generates a job matrix based on current dependencies and supported version
# ranges, then runs all those jobs
name: "Continuous Integration"
name: "CI"

on:
pull_request:
push:

env:
PHP_CURRENT: "8.2"
PHP_NEXT: "8.3"

jobs:
matrix:
name: Generate job matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
composer-json-lint:
name: "Lint composer.json"
runs-on: "ubuntu-latest"

steps:
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ env.PHP_CURRENT }}"
ini-values: "${{ env.INI_VALUES }}"
tools: composer-normalize, composer-require-checker
- uses: "ramsey/composer-install@v3"

- run: "composer validate --strict"
- run: "composer-normalize --dry-run"

coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-latest"

steps:
- name: Gather CI configuration
id: matrix
uses: laminas/[email protected]

qa:
name: QA Checks
needs: [ matrix ]
runs-on: ${{ matrix.operatingSystem }}
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ env.PHP_CURRENT }}"
ini-values: "${{ env.INI_VALUES }}"
tools: cs2pr
- uses: "ramsey/composer-install@v3"

- run: "vendor/bin/phpcs -q --report=checkstyle | cs2pr"

static-analysis:
name: "Static Analysis"
runs-on: "ubuntu-latest"

steps:
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ env.PHP_CURRENT }}"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v3"

- run: "vendor/bin/psalm --shepherd --stats --output-format=github --no-cache"

tests:
name: "Tests"
runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
matrix:
php-version:
- "8.2"
- "8.3"
dependencies:
- "lowest"
- "locked"
- "highest"

steps:
- name: ${{ matrix.name }}
uses: laminas/[email protected]
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"INFECTION_DASHBOARD_API_KEY": ${{ secrets.INFECTION_DASHBOARD_API_KEY }}
"STRYKER_DASHBOARD_API_KEY": ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v3"
with:
job: ${{ matrix.job }}
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run tests"
timeout-minutes: 3
run: "vendor/bin/phpunit --no-coverage --no-logging"

code-coverage:
name: "Code Coverage"
runs-on: "ubuntu-latest"

steps:
- uses: "actions/checkout@v4"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ env.PHP_CURRENT }}"
ini-values: "${{ env.INI_VALUES }}"
- uses: "ramsey/composer-install@v3"

- name: "Run Infection"
timeout-minutes: 30
run: "vendor/bin/infection run --ansi --threads=$(nproc)"
env:
INFECTION_DASHBOARD_API_KEY: "${{ secrets.INFECTION_DASHBOARD_API_KEY }}"
STRYKER_DASHBOARD_API_KEY: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}"

0 comments on commit af6f608

Please sign in to comment.