Skip to content

chore: complete SDK refactor — see REFACTOR_REPORT.md #4

chore: complete SDK refactor — see REFACTOR_REPORT.md

chore: complete SDK refactor — see REFACTOR_REPORT.md #4

Workflow file for this run

# CI for php-sdk.
#
# Action pinning policy:
# - First-party actions (actions/*) are pinned to a major tag (e.g. @v4).
# - Third-party actions are pinned to a full commit SHA, with the released
# version recorded in a trailing comment for human review.
name: test
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.editorconfig'
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.gitignore'
- '.editorconfig'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
with:
php-version: ${{ matrix.php }}
extensions: pdo, pdo_sqlite, mbstring, json
coverage: pcov
tools: composer:v2
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock', '**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
- name: Install dependencies
run: composer install --no-progress --no-interaction --prefer-dist
- name: Lint (php-cs-fixer dry-run)
if: hashFiles('.php-cs-fixer.dist.php', '.php-cs-fixer.php') != ''
run: vendor/bin/php-cs-fixer fix --dry-run --diff
- name: Run PHPUnit
run: vendor/bin/phpunit
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-artifacts-php-${{ matrix.php }}
path: |
.phpunit.cache/
build/
coverage.xml
if-no-files-found: ignore
retention-days: 7