Skip to content

chore: Update version number #85

chore: Update version number

chore: Update version number #85

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
tests:
name: PHP ${{ matrix.php }} (${{ matrix.dependencies }} deps)
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
php: ["8.2", "8.3", "8.4"]
dependencies: ["lowest", "locked"]
env:
extensions: mbstring, pcov
ini: pcov.directory=., "pcov.exclude=\"~(vendor|tests)~\""
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
with:
fetch-depth: 2
- name: Setup PHP cache environment
id: ext-cache
uses: shivammathur/cache-extensions@d814e887327271b6e290b018d51bba9f62590488 # pin@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
key: php-v1
- name: Cache PHP extensions
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # pin@v4
with:
path: ${{ steps.ext-cache.outputs.dir }}
key: ${{ steps.ext-cache.outputs.key }}
restore-keys: ${{ steps.ext-cache.outputs.key }}
- name: Setup PHP environment
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # pin@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: ${{ env.ini }}
coverage: pcov
tools: phpunit:10.5.38, psalm:5.26.1
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get Composer cache directory
id: composerCache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # pin@v4
with:
path: ${{ steps.composerCache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.dependencies }}-
- name: Install dependencies
run: |
# install the lowest or highest versions based on the matrix config
command=$([ "${{ matrix.dependencies }}" == "lowest" ] && echo "update --prefer-lowest" || echo "install")
composer $command --prefer-dist
- name: Cache analysis data
id: finishPrepare
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # pin@v4
with:
path: ~/.cache/psalm
key: backend-analysis-${{ matrix.php }}-v2
- name: Run tests
if: always() && steps.finishPrepare.outcome == 'success'
run: phpunit --coverage-clover ${{ github.workspace }}/clover.xml
- name: Statically analyze using Psalm
if: always() && steps.finishPrepare.outcome == 'success' && matrix.dependencies == 'locked' && matrix.php != '8.4'
run: psalm --output-format=github --php-version=${{ matrix.php }}
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # pin@v5
with:
file: ${{ github.workspace }}/clover.xml
flags: backend
env_vars: PHP
env:
PHP: ${{ matrix.php }}
analysis:
name: Analysis
runs-on: ubuntu-latest
timeout-minutes: 5
env:
php: "8.3"
extensions: mbstring
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
with:
fetch-depth: 2
- name: Setup PHP cache environment
id: ext-cache
uses: shivammathur/cache-extensions@d814e887327271b6e290b018d51bba9f62590488 # pin@v1
with:
php-version: ${{ env.php }}
extensions: ${{ env.extensions }}
key: php-v1
- name: Cache PHP extensions
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # pin@v4
with:
path: ${{ steps.ext-cache.outputs.dir }}
key: ${{ steps.ext-cache.outputs.key }}
restore-keys: ${{ steps.ext-cache.outputs.key }}
- name: Setup PHP environment
id: finishPrepare
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # pin@v2
with:
php-version: ${{ env.php }}
extensions: ${{ env.extensions }}
coverage: none
tools: |
composer:2.4.4, composer-normalize:2.28.3, composer-require-checker:4.0.0,
composer-unused:0.7.12, phpcpd:6.0.3, phpmd:2.13.0
- name: Validate composer.json/composer.lock
if: always() && steps.finishPrepare.outcome == 'success'
run: composer validate --strict --no-check-version --no-check-all
- name: Ensure that composer.json is normalized
if: always() && steps.finishPrepare.outcome == 'success'
run: composer-normalize --dry-run
- name: Get Composer cache directory
id: composerCache1
if: always() && steps.finishPrepare.outcome == 'success'
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
id: composerCache2
if: always() && steps.composerCache1.outcome == 'success'
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # pin@v4
with:
path: ${{ steps.composerCache1.outputs.dir }}
key: ${{ runner.os }}-composer-locked-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-locked-
- name: Install dependencies
id: composerInstall
if: always() && steps.composerCache2.outcome == 'success'
run: composer install --prefer-dist
- name: Check for missing Composer dependencies
if: always() && steps.composerInstall.outcome == 'success'
run: composer-require-checker --config-file=${{ github.workspace }}/.composer-require-checker.json
- name: Check for unused Composer dependencies
if: always() && steps.composerInstall.outcome == 'success'
run: composer-unused --no-progress
- name: Check for duplicated code
if: always() && steps.composerInstall.outcome == 'success'
run: phpcpd --fuzzy --exclude tests --exclude vendor .
- name: Statically analyze using PHPMD
if: always() && steps.composerInstall.outcome == 'success'
run: phpmd . github phpmd.xml.dist --exclude 'node_modules/*,stubs/*,tests/*,vendor/*'
coding-style:
name: Coding Style & Frontend Analysis
runs-on: ubuntu-latest
timeout-minutes: 5
env:
php: "8.3"
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4
with:
fetch-depth: 2
- name: Set up Node.js problem matchers and cache npm dependencies
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # pin@v4
with:
cache: 'npm'
- name: Install npm dependencies
run: npm ci
- name: Setup PHP environment
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # pin@v2
with:
php-version: ${{ env.php }}
coverage: none
tools: php-cs-fixer:3.65.0
- name: Cache analysis data
id: finishPrepare
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # pin@v4
with:
path: ~/.php-cs-fixer
key: coding-style
- name: Check for JavaScript coding style violations (ESLint)
if: always() && steps.finishPrepare.outcome == 'success'
run: npm run lint -- --max-warnings 0 --format stylish --no-fix
- name: Check for JavaScript coding style violations (Prettier)
if: always() && steps.finishPrepare.outcome == 'success'
run: npm run format --check
- name: Check for PHP coding style violations
if: always() && steps.finishPrepare.outcome == 'success'
run: php-cs-fixer fix --diff --dry-run