Skip to content

Commit

Permalink
update the eslint to match w/action files format
Browse files Browse the repository at this point in the history
  • Loading branch information
faisal-alvi committed Sep 13, 2023
1 parent bde3ccb commit 9c23a8e
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/eslint.yml
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 }}

0 comments on commit 9c23a8e

Please sign in to comment.