You've already forked gitea-composer-upload-action
179 lines
4.5 KiB
YAML
179 lines
4.5 KiB
YAML
name: tests
|
|
|
|
on:
|
|
pull_request: ~
|
|
push:
|
|
branches: ['*.*.*']
|
|
|
|
env:
|
|
BRANCH: ${{ github.head_ref || github.ref_name }}
|
|
|
|
jobs:
|
|
docker-build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{env.BRANCH}}
|
|
- run: cp .env.dist .env
|
|
- uses: falti/dotenv-action@v1
|
|
id: dotenv
|
|
- uses: docker/setup-buildx-action@v3
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
build-args: |
|
|
PHP_VERSION=${{ steps.dotenv.outputs.PHP_VERSION }}
|
|
push: false
|
|
composer-validate:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php:
|
|
- 8.3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{env.BRANCH}}
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer:v2
|
|
coverage: none
|
|
- run: composer validate --strict --ansi
|
|
composer-require-checker:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php:
|
|
- 8.3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{env.BRANCH}}
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer:v2
|
|
coverage: none
|
|
- uses: ramsey/composer-install@v3
|
|
with:
|
|
composer-options: --optimize-autoloader
|
|
- run: composer require-checker
|
|
composer-unused:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php:
|
|
- 8.3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{env.BRANCH}}
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer:v2
|
|
coverage: none
|
|
- uses: ramsey/composer-install@v3
|
|
with:
|
|
composer-options: --optimize-autoloader
|
|
- run: composer unused
|
|
composer-normalize:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php:
|
|
- 8.3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{env.BRANCH}}
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer:v2
|
|
coverage: none
|
|
- uses: ramsey/composer-install@v3
|
|
with:
|
|
composer-options: --optimize-autoloader
|
|
- run: composer normalize --dry-run --diff --ansi
|
|
php-cs-fixer:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php:
|
|
- 8.3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{env.BRANCH}}
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer:v2, cs2pr
|
|
coverage: none
|
|
- uses: ramsey/composer-install@v3
|
|
with:
|
|
composer-options: --optimize-autoloader
|
|
- run: composer fixcs -- --dry-run --diff --format=checkstyle --ansi | cs2pr
|
|
rector:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php:
|
|
- 8.3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{env.BRANCH}}
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer:v2
|
|
coverage: none
|
|
- uses: ramsey/composer-install@v3
|
|
with:
|
|
composer-options: --optimize-autoloader
|
|
- run: composer rector -- --dry-run
|
|
psalm:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php:
|
|
- 8.3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{env.BRANCH}}
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer:v2
|
|
coverage: none
|
|
- uses: ramsey/composer-install@v3
|
|
with:
|
|
composer-options: --optimize-autoloader
|
|
- run: composer psalm -- --php-version=${{ matrix.php }} --stats --output-format=github --shepherd
|
|
phpunit:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php:
|
|
- 8.3
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{env.BRANCH}}
|
|
- uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer:v2
|
|
coverage: xdebug
|
|
- uses: ramsey/composer-install@v3
|
|
with:
|
|
composer-options: --optimize-autoloader
|
|
# - run: composer test -- --colors=always --order-by=random --coverage-clover coverage.xml
|
|
- run: composer test -- --colors=always --order-by=random
|