Added Cache to CICD
This commit is contained in:
63
.github/workflows/lint.yml
vendored
63
.github/workflows/lint.yml
vendored
@@ -20,30 +20,59 @@ permissions:
|
||||
jobs:
|
||||
quality:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
# -------------------------
|
||||
# Cache Composer
|
||||
# -------------------------
|
||||
- name: Cache Composer dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.composer/cache
|
||||
key: composer-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
composer-${{ runner.os }}-
|
||||
|
||||
# -------------------------
|
||||
# Cache Node
|
||||
# -------------------------
|
||||
- name: Cache Node dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: node-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
node-${{ runner.os }}-
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.4'
|
||||
coverage: none
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
cache: 'npm'
|
||||
|
||||
# -------------------------
|
||||
# Install dependencies
|
||||
# -------------------------
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
||||
npm install
|
||||
composer install --no-interaction --prefer-dist --no-progress --no-scripts
|
||||
npm ci
|
||||
|
||||
- name: Run Pint
|
||||
run: composer lint
|
||||
|
||||
- name: Format Frontend
|
||||
run: npm run format
|
||||
|
||||
- name: Lint Frontend
|
||||
run: npm run lint
|
||||
|
||||
# - name: Commit Changes
|
||||
# uses: stefanzweifel/git-auto-commit-action@v7
|
||||
# with:
|
||||
# commit_message: fix code style
|
||||
# commit_options: '--no-verify'
|
||||
# -------------------------
|
||||
# Run linters in parallel
|
||||
# -------------------------
|
||||
- name: Run linters
|
||||
run: |
|
||||
composer lint &
|
||||
npm run format &
|
||||
npm run lint &
|
||||
wait
|
||||
|
||||
Reference in New Issue
Block a user