Skip to content

chore(deps): update shivammathur/setup-php action to v2.37.0 #40

chore(deps): update shivammathur/setup-php action to v2.37.0

chore(deps): update shivammathur/setup-php action to v2.37.0 #40

Workflow file for this run

on: [ push, pull_request ]
name: "CI"
jobs:
qa:
name: "QA (lint + static analysis)"
if: "!startsWith(github.event.head_commit.message, 'chore(release)')"
runs-on: "ubuntu-latest"
env:
PHP_CS_FIXER_IGNORE_ENV: true
steps:
- name: "Checkout"
uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
- name: "Install PHP"
uses: "shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f" # 2.37.0
with:
coverage: "none"
php-version: "8.3"
- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
- name: "Cache dependencies installed with composer"
uses: "actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306" # v5.0.3
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-8.3-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: |
php-8.3-composer-locked-${{ github.ref_name }}
php-8.3-composer-locked-
php-8.3-composer-main
- name: "Install locked dependencies with composer"
uses: "ergebnis/.github/actions/composer/install@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
with:
dependencies: "locked"
- name: "Check coding style"
run: "vendor/bin/codecept build"
- name: "Check coding style"
run: "composer cs:check"
- name: "Run static analysis"
run: "composer stan"
tests:
name: "Run codeception tests"
needs: [ qa ]
runs-on: "ubuntu-latest"
strategy:
matrix:
include:
- { php-version: 8.3, dependencies: locked, coverage: pcov, with_coverage: true, allow-fail: false }
- { php-version: 8.4, dependencies: highest, coverage: pcov, with_coverage: false, allow-fail: true }
- { php-version: 8.5, dependencies: highest, coverage: pcov, with_coverage: false, allow-fail: true }
steps:
- name: "Checkout"
uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
- name: "Install PHP"
uses: "shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f" # 2.37.0
with:
coverage: "${{ matrix.coverage }}"
ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767
php-version: "${{ matrix.php-version }}"
- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""
- name: "Validate composer.json and composer.lock"
run: "composer validate --ansi --strict"
- name: "Determine composer cache directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
- name: "Cache dependencies installed with composer"
uses: "actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306" # v5.0.3
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: |
php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ github.ref_name }}
php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
php-${{ matrix.php-version }}-composer-main
- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "ergebnis/.github/actions/composer/install@9785f99b3546d64df9cb331449e7fcdc41885d25" # 1.11.0
with:
dependencies: "${{ matrix.dependencies }}"
- name: "Run Tests (coverage)"
if: matrix.with_coverage == true
run: |
vendor/bin/codecept build
vendor/bin/codecept run --coverage --coverage-xml=coverage.xml --xml --report
- name: "Run Tests"
if: matrix.with_coverage != true
run: |
vendor/bin/codecept build
vendor/bin/codecept run --xml --report
- name: "Upload coverage artifact"
if: matrix.with_coverage == true
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: code-coverage-results
path: tests/_output/
retention-days: 5