#1 - initialize project #7
Workflow file for this run
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: Test & lint PHP codebase | |
on: | |
pull_request: | |
branches: [ "main" ] | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths: | |
- '**.php' | |
- 'composer.json' | |
- 'composer.lock' | |
- 'phpunit.xml' | |
jobs: | |
test-and-lint-php: | |
name: Test & lint PHP codebase | |
timeout-minutes: 10 | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] # https://github.com/actions/checkout | |
- name: Cache dependencies | |
uses: actions/[email protected] # https://github.com/actions/cache | |
with: | |
path: vendor | |
key: ${{ runner.os }}-composer-dependencies-${{ hashFiles('composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer-dependencies | |
- name: Setup PHP | |
uses: shivammathur/[email protected] # https://github.com/shivammathur/setup-php | |
with: | |
php-version: 8.3 | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, intl, git | |
coverage: none | |
- name: Cache composer dependencies | |
uses: actions/cache@v2 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Validate composer.json | |
run: composer validate | |
- name: Install Composer dependencies | |
working-directory: src | |
run: composer install --prefer-dist --no-interaction | |
- name: Run linter | |
working-directory: src | |
run: composer cs | |
- name: Run test | |
working-directory: src | |
run: composer test |