chore: updated test-all gh action #3
This file contains hidden or 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: Run Lefthook on Push | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| - 'feature/*' | |
| - 'fix/*' | |
| jobs: | |
| setup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup PHP | |
| id: setup-php | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.x' | |
| tools: composer:v2, wp-cli | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v4 | |
| name: Setup package cache | |
| with: | |
| path: | | |
| ${{ steps.pnpm-cache.outputs.dir }} | |
| ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-cached-test-package-${{ hashFiles('**/pnpm-lock.yaml', '**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cached-test-package- | |
| - name: Install dependencies | |
| run: | | |
| composer install --prefer-dist --no-progress | |
| pnpm install | |
| - name: Run Lefthook | |
| run: pnpm lefthook run github-actions |