-
Notifications
You must be signed in to change notification settings - Fork 15
83 lines (68 loc) · 2.02 KB
/
workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Linting & Testing
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "**.json"
- "**.php"
- "**.yml"
pull_request:
branches:
- master
paths:
- "**.json"
- "**.php"
- "**.yml"
jobs:
laravel-pint:
name: PHP Linting (Pint)
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Make sure the actual branch is checked out when running on pull requests.
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Laravel Pint
uses: aglipanci/[email protected]
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: PHP Linting (Pint)
skip_fetch: true
testing:
needs: laravel-pint
strategy:
fail-fast: true
matrix:
php: [8.3, 8.2, 8.1]
testbench: [9.0, 8.0, 7.0] # Laravel 11.x, 10.x, 9.x
version: [prefer-stable, prefer-lowest]
include:
- testbench: 7.0
phpunit: "-c phpunit-9.xml"
exclude:
- php: 8.1
testbench: 9.0
name: P${{ matrix.php }} - T${{ matrix.testbench }} - ${{ matrix.version }}
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:${{ matrix.php }}
options: "--user=root"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Make sure the actual branch is checked out when running on pull requests.
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: |
composer require "orchestra/testbench:^${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit ${{ matrix.phpunit }}