Skip to content

Store talk locale (#194) #1383

Store talk locale (#194)

Store talk locale (#194) #1383

Workflow file for this run

name: PHP tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
info:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- name: OS info
run: cat /etc/os-release
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- name: PHP info
run: |
php -v
php -m
composer-validate:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- name: Validate composer.json and composer.lock
run: composer --working-dir=site validate
check-file-patterns:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- run: make --directory=site check-file-patterns
check-makefile:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- run: make --directory=site check-makefile
lint-php:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- run: make --directory=site lint-php
lint-latte:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- run: make --directory=site lint-latte
lint-neon:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- run: make --directory=site lint-neon
lint-xml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make --directory=site lint-xml-auto-install
phpcs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- name: Get PHP_CodeSniffer cache file pattern
id: phpcs-cache
run: echo "file=$(php -r "echo sys_get_temp_dir() . '/phpcs.*';")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.phpcs-cache.outputs.file }}
key: phpcs-cache-php${{ matrix.php-version }}
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- run: make --directory=site phpcs
phpstan:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- name: Get PHPStan result cache directory
id: phpstan-cache
run: echo "dir=$(php -r "echo sys_get_temp_dir() . '/phpstan';")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.phpstan-cache.outputs.dir }}
key: phpstan-cache-php${{ matrix.php-version }}
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- run: make --directory=site phpstan
phpstan-vendor:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- name: Get PHPStan result cache directory
id: phpstan-cache
run: echo "dir=$(php -r "echo sys_get_temp_dir() . '/phpstan';")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.phpstan-cache.outputs.dir }}
key: phpstan-vendor-cache-php${{ matrix.php-version }}
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: ${{ matrix.php-version }}
- run: make --directory=site phpstan-vendor
tester:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.2"
- "8.3"
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
coverage: pcov
php-version: ${{ matrix.php-version }}
- run: make --directory=site tester
- name: Failed test output, if any
if: failure()
run: for i in $(find ./site/tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
- name: Upload test code coverage
uses: actions/upload-artifact@v3
if: success()
with:
name: Test code coverage (PHP ${{ matrix.php-version }})
path: 'site/temp/coverage.html'
retention-days: 5