68 lines
1.5 KiB
YAML
68 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
tests:
|
|
if: github.event.repository.visibility == 'public'
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
php: [8.2, 8.3, 8.4]
|
|
|
|
name: PHP ${{ matrix.php }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
|
|
coverage: pcov
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-interaction --no-progress
|
|
|
|
- name: Run Pint
|
|
run: vendor/bin/pint --test
|
|
|
|
- name: Run tests
|
|
run: vendor/bin/pest --ci --coverage --coverage-clover coverage.xml
|
|
|
|
- name: Upload coverage to Codecov
|
|
if: matrix.php == '8.3'
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
files: coverage.xml
|
|
fail_ci_if_error: false
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
assets:
|
|
if: github.event.repository.visibility == 'public'
|
|
runs-on: ubuntu-latest
|
|
name: Assets
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build assets
|
|
run: npm run build
|