Skip to content

Commit 59deb38

Browse files
authored
Merge pull request #9 from n4ss1m/main
enhancement: improve `php.yml` GitHub test workflow
2 parents c7b68a9 + 99ce01c commit 59deb38

File tree

2 files changed

+25
-70
lines changed

2 files changed

+25
-70
lines changed

.github/workflows/php.yml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
1-
name: PHP Composer
1+
name: Tests
22

33
on:
44
push:
55
branches: [ "main" ]
66
pull_request:
77
branches: [ "main" ]
88

9-
permissions:
10-
contents: read
11-
129
jobs:
13-
build:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
timeout-minutes: 5
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
os: [ubuntu-latest, windows-latest]
17+
php: [8.1, 8.2, 8.3]
1418

15-
runs-on: ubuntu-latest
19+
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }}
1620

1721
steps:
18-
- uses: actions/checkout@v3
22+
- name: Checkout code
23+
uses: actions/checkout@v4
1924

20-
- name: Validate composer.json and composer.lock
21-
run: composer validate --strict
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
coverage: none
2230

23-
- name: Cache Composer packages
24-
id: composer-cache
25-
uses: actions/cache@v3
26-
with:
27-
path: vendor
28-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
29-
restore-keys: |
30-
${{ runner.os }}-php-
31+
- name: Validate composer.json
32+
run: composer validate
3133

32-
- name: Install dependencies
33-
run: composer install --prefer-dist --no-progress
34+
- name: Install dependencies
35+
run: composer install --prefer-dist --no-interaction
3436

35-
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
36-
# Docs: https://getcomposer.org/doc/articles/scripts.md
37+
- name: List Installed Dependencies
38+
run: composer show -D
3739

38-
# - name: Run test suite
39-
# run: composer run-script test
40+
- name: Execute tests
41+
run: composer test

.github/workflows/symfony.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)