Skip to content

feat(otel): optional OpenTelemetry tracing (ADR-0025) #28

feat(otel): optional OpenTelemetry tracing (ADR-0025)

feat(otel): optional OpenTelemetry tracing (ADR-0025) #28

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
steps:
- uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json
coverage: none
tools: composer:v2
- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress
- name: Run tests
run: vendor/bin/phpunit
static-analysis:
name: Static analysis (PHPStan)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: json
coverage: none
tools: composer:v2
- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress
- name: PHPStan
run: vendor/bin/phpstan analyse --no-progress
coverage:
name: Coverage gate (>=90%)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: json
coverage: pcov
tools: composer:v2
- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress
- name: Tests with coverage
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Enforce coverage gate
run: php bin/check-coverage.php coverage.xml 90
conformance:
name: Conformance suite in sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Verify vendored conformance matches the canonical suite
run: |
git clone --depth 1 https://github.com/BabelQueue/conformance.git "$RUNNER_TEMP/conformance"
diff -ru "$RUNNER_TEMP/conformance/manifest.json" "tests/conformance/manifest.json"
diff -ru "$RUNNER_TEMP/conformance/fixtures" "tests/conformance/fixtures"
diff -ru "$RUNNER_TEMP/conformance/schema" "tests/conformance/schema"
echo "Vendored conformance is in sync with the canonical suite."
ci-green:
name: CI green
runs-on: ubuntu-latest
needs: [test, static-analysis, coverage, conformance]
if: ${{ always() }}
steps:
- name: Fail if any required job did not pass
run: |
if ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}; then
echo "A required job failed or was cancelled."
exit 1
fi