-
Notifications
You must be signed in to change notification settings - Fork 8
78 lines (65 loc) · 2.36 KB
/
tests.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
name: PHPStan and PHPUnit tests
on:
push:
pull_request:
jobs:
tests:
name: PHP ${{ matrix.php }} ${{ matrix.settings }} ${{ matrix.COMPOSER_FLAGS }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1']
settings: ['both', 'vips-only', 'ffi-only']
COMPOSER_FLAGS: ['']
include:
- php: '7.2'
settings: 'vips-only'
- php: '7.3'
settings: 'vips-only'
- php: '8.0'
COMPOSER_FLAGS: "--prefer-lowest"
settings: 'vips-only'
- php: '8.0'
COMPOSER_FLAGS: "--prefer-lowest"
settings: 'both'
- php: '8.0'
COMPOSER_FLAGS: "--prefer-lowest"
settings: 'ffi-only'
# currently fails on PHP 8.2 with vips-only, due to https://github.com/libvips/php-vips/pull/174
# once php-vips 1.0.10 is out, we can enable tests for PHP 8.2 for all "settings" and put this above in matrix.php
- php: '8.2'
settings: 'ffi-only'
- php: '8.2'
settings: 'both'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get Settings
id: set_var
run: |
echo "SETTINGS_JSON=$(jq -c . < .github/workflows/settings/${{ matrix.settings }}.json)" >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
extensions: ${{fromJson(env.SETTINGS_JSON).extensions}}
- name: Install vips
run: sudo apt install -y ${{fromJson(env.SETTINGS_JSON).aptinstall}} --no-install-recommends
- name: Install vips extension
run: sudo pecl install vips
if: fromJson(env.SETTINGS_JSON).aptinstall == 'libvips-dev'
- name: Install vips ext config
run: echo "extension=vips.so" >> $(php -i | grep /.+/php.ini -oE)
if: fromJson(env.SETTINGS_JSON).aptinstall == 'libvips-dev'
- name: Install composer dependencies
run: |
composer update --prefer-dist --no-interaction --no-progress --no-ansi ${{ matrix.COMPOSER_FLAGS || '' }}
- name: PHPStan
run: composer phpstan
- name: PHPUnit
run: composer phpunit
- name: Composer audit
run: composer audit