Skip to content

Commit 2ffe3a9

Browse files
committed
Add GitHub Actions workflow for running tests
- Run tests on push to main/master branches - Run tests on pull requests to main/master - Run tests when new version tags (v*) are created - Test matrix: PHP 8.2, 8.3, 8.4 with Laravel 11.x and 12.x
1 parent d63c29d commit 2ffe3a9

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/tests.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
tags:
9+
- 'v*'
10+
pull_request:
11+
branches:
12+
- main
13+
- master
14+
15+
jobs:
16+
test:
17+
runs-on: ${{ matrix.os }}
18+
19+
strategy:
20+
fail-fast: true
21+
matrix:
22+
os: [ubuntu-latest]
23+
php: [8.2, 8.3, 8.4]
24+
laravel: [11.*, 12.*]
25+
stability: [prefer-stable]
26+
include:
27+
- laravel: 11.*
28+
testbench: 9.*
29+
- laravel: 12.*
30+
testbench: 10.*
31+
32+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Setup PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: ${{ matrix.php }}
42+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
43+
coverage: none
44+
45+
- name: Setup problem matchers
46+
run: |
47+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
48+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
49+
50+
- name: Install dependencies
51+
run: |
52+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
53+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
54+
55+
- name: List installed dependencies
56+
run: composer show -D
57+
58+
- name: Execute tests
59+
run: vendor/bin/pest --ci

0 commit comments

Comments
 (0)