Skip to content

Commit

Permalink
Merge pull request #9 from n4ss1m/main
Browse files Browse the repository at this point in the history
enhancement: improve `php.yml` GitHub test workflow
  • Loading branch information
Medboubazine authored Nov 9, 2024
2 parents c7b68a9 + 99ce01c commit 59deb38
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 70 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
name: PHP Composer
name: Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.1, 8.2, 8.3]

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

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v4

- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Validate composer.json
run: composer validate

- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Install dependencies
run: composer install --prefer-dist --no-interaction

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

# - name: Run test suite
# run: composer run-script test
- name: Execute tests
run: composer test
47 changes: 0 additions & 47 deletions .github/workflows/symfony.yml

This file was deleted.

0 comments on commit 59deb38

Please sign in to comment.