-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the eslint to match w/action files format
- Loading branch information
1 parent
bde3ccb
commit 9c23a8e
Showing
1 changed file
with
32 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,48 @@ | ||
name: ESLint | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- trunk | ||
on: pull_request | ||
|
||
jobs: | ||
changed: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- id: changed-files | ||
uses: tj-actions/changed-files@v19 | ||
- uses: actions/checkout@v3 | ||
with: | ||
files: | | ||
**/*.js | ||
- name: Set PHP version | ||
fetch-depth: 0 | ||
|
||
- name: Setup proper PHP version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2 | ||
coverage: none | ||
tools: composer | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v35 | ||
with: | ||
files: | | ||
**/*.php | ||
- name: Install dependencies | ||
if: ${{ steps.changed-files.outputs.any_changed == 'true' }} | ||
run: composer install | ||
- name: NPM Install | ||
run: npm install | ||
run: | | ||
composer install | ||
npm install | ||
- name: Run ESLint | ||
if: ${{ steps.changed-files.outputs.any_changed == 'true' }} | ||
run: npm run lint:js ${{ steps.changed-files.outputs.all_changed_files }} |