Skip to content

Update paragonie/constant_time_encoding #366

Update paragonie/constant_time_encoding

Update paragonie/constant_time_encoding #366

Workflow file for this run

name: PHP Composer
on:
push:
branches:
- develop
- "[0-9]+.[0-9]+.x"
tags:
- v[0-9]+.[0-9]+.[0-9]+
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.2', '8.3']
experimental: [false]
env:
code-coverage-version: '8.3' # Most recent stable PHP version.
name: PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v4
- name: Setup PHP ${{ matrix.php-versions }} without code coverage
if: matrix.php-versions != env.code-coverage-version
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
tools: cs2pr
- name: Setup PHP ${{ matrix.php-versions }} with code coverage
if: matrix.php-versions == env.code-coverage-version
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
tools: cs2pr
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: cache
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
composer-${{ matrix.php-versions }}-
composer-
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install PHP dependencies
if: matrix.experimental == false
run: composer update --prefer-dist --no-progress
# Ignore platform requirements for experimental branches.
- name: Install PHP experimental dependencies
if: matrix.experimental
run: composer update --ignore-platform-reqs --prefer-dist --no-progress
- name: Run PHPUnit tests
run: composer run-script phpunit
- name: Run PHPStan
if: matrix.php-versions == env.code-coverage-version
run: composer run-script phpstan -- --no-progress
- name: Check code style
if: matrix.php-versions == env.code-coverage-version
run: composer run-script phpcs -- --report=checkstyle | cs2pr
# Ensure the next test run fetches the latest test ruleset.
- name: Cleanup composer cache
if: steps.cache.outputs.cache-hit != 'true'
run: rm -rf $(composer config cache-files-dir)/httpwg
- name: Upload code coverage report
if: matrix.php-versions == env.code-coverage-version
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: tmp/code-coverage
- name: Upload code coverage to codecov
if: matrix.php-versions == env.code-coverage-version
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./tmp/code-coverage/clover.xml
flags: phpunit