Set version number #39
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
name: Tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: ~ | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
php-versions: ['8.1', '8.2', '8.3'] | |
lexer-version: ['^2', 'latest'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup PHP with composer | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
tools: composer | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install | |
- name: Install doctrine/lexer | |
if: ${{ matrix.lexer-version != 'latest' }} | |
run: composer require doctrine/lexer:${{ matrix.lexer-version }} | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: PHPStan | |
run: vendor/bin/phpstan analyse | |
- name: unit tests | |
run: vendor/bin/phpunit tests |