This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
Update README.md #65
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: "Coding Standards" | |
on: [push] | |
jobs: | |
coding-standards: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: | |
- "8.1" | |
node-version: | |
- 16 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: "Install Node" | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "${{ matrix.node-version }}" | |
- name: "Install PHP with extensions" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: npm list | |
- name: "Install locked dependencies with npm" | |
run: "npm ci --ignore-scripts" | |
- name: "Cache dependencies installed with composer" | |
uses: "actions/cache@v2" | |
with: | |
path: "~/.composer/cache" | |
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}" | |
restore-keys: "php-${{ matrix.php-version }}-composer-" | |
- name: "Install locked dependencies with composer" | |
run: "composer install --no-interaction --no-progress --no-suggest" | |
- name: "Create cache directory for friendsofphp/php-cs-fixer" | |
run: mkdir -p .build/php-cs-fixer | |
- name: "Cache cache directory for friendsofphp/php-cs-fixer" | |
uses: "actions/cache@v2" | |
with: | |
path: "~/.build/php-cs-fixer" | |
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}" | |
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-" | |
- name: "Run eslint" | |
run: "npm run eslint" | |
- name: "Run friendsofphp/php-cs-fixer" | |
run: "composer php-cs-fixer" | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Fix styling |