(feat): register REST endpoints #16
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: Check Code Style | |
on: push | |
jobs: | |
php-cs: | |
runs-on: ubuntu-latest | |
needs: what-has-changed | |
# Run only if PHP files have changed | |
if: ${{ needs.what-has-changed.outputs.php == 'true' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.composer/cache/files | |
key: dependencies-composer-${{ hashFiles('composer.json') }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
extensions: simplexml, tokenizer, xmlwriter | |
coverage: none | |
- name: Install dependencies | |
run: composer update --prefer-dist --no-interaction --no-suggest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Execute tests | |
run: ./vendor/bin/phpcs | |
# Job to check if certain files have changed | |
what-has-changed: | |
name: Detect file changes | |
runs-on: ubuntu-latest | |
outputs: | |
php: ${{ steps.filter.outputs.php }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# For pull requests it's not necessary to checkout the code | |
if: ${{ github.event_name != 'pull_request' }} | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
base: ${{ github.ref }} | |
filters: | | |
php: | |
- added|modified: 'src/**/*.php' |