-
Notifications
You must be signed in to change notification settings - Fork 893
64 lines (55 loc) · 2.63 KB
/
testing.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
name: PHP Tests
on:
push:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
test:
runs-on: ubuntu-latest
strategy:
# if one job fails, abort the next ones too, because they'll probably fail - best to save the minutes
fail-fast: false # to change to: true
# run all combinations of the following, to make sure they're working together
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
php: ['8.1', '8.2', '8.3']
laravel: [^10.0, ^11.0]
dbal: [^3.0]
phpunit: [10.*]
dependency-version: [stable] # to add: lowest
exclude:
- laravel: "^11.0"
php: "8.1"
dbal: "^3.0"
name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }}, PHPUnit ${{ matrix.phpunit }}, DBAL ${{ matrix.dbal }} --prefer-${{ matrix.dependency-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install SQLite 3
run: |
sudo apt-get update
sudo apt-get install sqlite3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
coverage: none
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: dependencies-${{ matrix.dependency-version }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-phpunit-${{ matrix.phpunit }}-composer-${{ hashFiles('composer.json') }}
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update
composer update --prefer-${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: "Install dbal"
if: ${{ matrix.laravel }} == 10
run: composer require "doctrine/dbal:${{ matrix.dbal }}" --no-interaction --no-update
- name: "Update dependencies"
run: composer update --prefer-${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: composer test