Skip to content

Commit

Permalink
Merge pull request #588 from Slamdunk/inside_job
Browse files Browse the repository at this point in the history
[CI] Drop `laminas-continuous-integration-action`, add jobs static Config
  • Loading branch information
Slamdunk authored Oct 28, 2024
2 parents ff10c7f + 3367a51 commit 4957bd7
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 27 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/roave-infection-static-analysis-plugin"
env:
INFECTION_DASHBOARD_API_KEY: "${{ secrets.INFECTION_DASHBOARD_API_KEY }}"
STRYKER_DASHBOARD_API_KEY: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}"
1 change: 0 additions & 1 deletion infection.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
]
},
"logs": {
"text": "php:\/\/stderr",
"stryker": {
"report": "/^\\d\\.\\d\\.x$/"
}
Expand Down

0 comments on commit 4957bd7

Please sign in to comment.