Skip to content

Modernize currency API #6

Modernize currency API

Modernize currency API #6

Workflow file for this run

name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
permissions:
contents: read
jobs:
test:
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
- name: Setup PHP
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f
with:
php-version: ${{ matrix.php }}
extensions: json, mbstring
coverage: ${{ matrix.php == '8.3' && 'xdebug' || 'none' }}
tools: composer:v2
- name: Cache Composer dependencies
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
with:
path: ~/.composer/cache
key: composer-${{ matrix.php }}-${{ hashFiles('composer.json') }}
restore-keys: composer-${{ matrix.php }}-
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Lint (Pint)
run: vendor/bin/pint --test
- name: Static analysis (PHPStan)
run: vendor/bin/phpstan analyse --no-progress
- name: Rector dry-run
run: vendor/bin/rector --dry-run
- name: Run tests
run: |
mkdir -p build
if [ "${{ matrix.php }}" = "8.3" ]; then
XDEBUG_MODE=coverage vendor/bin/phpunit
else
vendor/bin/phpunit --no-coverage
fi
- name: Upload coverage to Coveralls
if: matrix.php == '8.3'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
if [ -n "$COVERALLS_REPO_TOKEN" ]; then
vendor/bin/php-coveralls --coverage_clover build/cov.xml --json_path build/coverage.json -v
else
echo "Skipping Coveralls upload — COVERALLS_REPO_TOKEN not set."
fi