REST-64: Add PHP project and CI files #1
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: PHP Coding Standards | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout app | |
uses: actions/checkout@v3 | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-php- | |
- name: Create .env file | |
run: echo "${{ secrets.ENV_FILE }}" > .env | |
- name: Update dependencies | |
run: composer update | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Install PHP extensions | |
run: sudo apt install php-ast | |
- name: Run code quality checks | |
run: composer lint | |
- name: Run code analysis checks | |
run: composer phan |