Allow thecodingmachine/safe
v3 as dependency
#95
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | |
on: | |
pull_request: | |
push: | |
branches: | |
- "master" | |
jobs: | |
composer-validate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
extensions: mbstring | |
php-version: 8.3 | |
- run: composer validate | |
static-code-analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
extensions: mbstring | |
php-version: 8.3 | |
- uses: ramsey/composer-install@v3 | |
- run: vendor/bin/phpstan analyse --configuration=phpstan.neon | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: | |
- 7.4 | |
- 8.0 | |
- 8.1 | |
- 8.2 | |
- 8.3 | |
- 8.4 | |
dependencies: | |
- lowest | |
- locked | |
- highest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
extensions: mbstring | |
php-version: ${{ matrix.php-version }} | |
- uses: ramsey/composer-install@v3 | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- run: vendor/bin/phpunit | |
examples: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
example: | |
- custom-types | |
- input | |
- install | |
- php-keywords | |
- simple | |
- polymorphic | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
extensions: mbstring | |
php-version: 8.3 | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: cd examples/${{ matrix.example }} && ./test.sh | |
code-coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
coverage: pcov | |
extensions: mbstring | |
php-version: 8.3 | |
- uses: ramsey/composer-install@v3 | |
- run: vendor/bin/phpunit --coverage-clover=build/logs/clover.xml | |
# Not using v4 due to the breaking changes described in https://github.com/codecov/codecov-action/releases/tag/v4.0.0 | |
- uses: codecov/codecov-action@v3 |