Skip to content

Commit f768b1e

Browse files
fix: resolve GitHub Actions "Queued" state and modernize workflow
- Corrected 'path-ignore' to 'paths-ignore' - Updated runner from 'ubuntu-20.04' to 'ubuntu-latest' - Removed 'container' and switched to 'shivammathur/setup-php' - Updated action versions (checkout@v4, cache@v4) - Optimized composer caching and installation steps
1 parent 0a813f8 commit f768b1e

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

.github/workflows/php.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,39 @@ on:
88
pull_request:
99
branches:
1010
- master
11-
path-ignore:
11+
paths-ignore:
1212
- 'docs/**'
1313
- '*.md'
1414

1515
jobs:
1616
build:
17+
runs-on: ubuntu-latest
1718

18-
runs-on: ubuntu-20.04
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
1922

20-
container: php:8.0-cli-buster
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: '8.0'
27+
coverage: xdebug
2128

22-
steps:
23-
- uses: actions/checkout@v2
29+
- name: Get Composer Cache Directory
30+
id: composer-cache
31+
run: |
32+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
2433
25-
- name: Cache composer dependencies
26-
uses: actions/cache@v3
27-
env:
28-
cache-name: cache-composer
34+
- name: Cache dependencies
35+
uses: actions/cache@v4
2936
with:
30-
path: ~/vendor
31-
key: ${{ env.cache-name }}
37+
path: ${{ steps.composer-cache.outputs.dir }}
38+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
3239
restore-keys: |
33-
${{ env.cache-name }}-
40+
${{ runner.os }}-composer-
3441
3542
- name: Install dependencies
36-
uses: php-actions/composer@v2
43+
run: composer install --prefer-dist --no-progress
3744

3845
- name: Run php unit tests
3946
run: ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

0 commit comments

Comments
 (0)