Skip to content

Commit

Permalink
updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
deemonic committed Oct 19, 2024
1 parent e661015 commit e347761
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
name: run-tests
name: Tests

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

jobs:
test:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
php: [7.4, 8.0]
laravel: [8.*, 9.*, 10.*, 11.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 11.*
testbench: ^6.6
os: [ubuntu-latest]
php: ["8.3"]
dependency-version: [prefer-lowest, prefer-stable]

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
extensions: dom, mbstring, zip
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
- name: Get Composer cache directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }}
restore-keys: dependencies-php-${{ matrix.php }}-os-${{ matrix.os }}-version-${{ matrix.dependency-version }}-composer-

- name: Install Composer dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist

- name: Run Tests
run: php ./vendor/bin/phpunit

0 comments on commit e347761

Please sign in to comment.