-
Notifications
You must be signed in to change notification settings - Fork 19
67 lines (57 loc) · 1.95 KB
/
Copy pathtest-php.yml
File metadata and controls
67 lines (57 loc) · 1.95 KB
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
name: PHP Tests
on:
push:
branches:
- master
paths:
- 'HM/**'
- 'HM-Minimum/**'
- 'tests/**'
- 'composer.json'
- 'phpunit.xml.dist'
- 'ruleset.xml'
- '.github/workflows/test-php.yml'
pull_request:
paths:
- 'HM/**'
- 'HM-Minimum/**'
- 'tests/**'
- 'composer.json'
- 'phpunit.xml.dist'
- 'ruleset.xml'
- '.github/workflows/test-php.yml'
permissions:
contents: read
jobs:
test:
name: PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- '8.2'
- '8.3'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0
with:
php-version: ${{ matrix.php-version }}
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/composer/files
key: composer-${{ matrix.php-version }}-${{ hashFiles('composer.json') }}
restore-keys: |
composer-${{ matrix.php-version }}-
composer-
- name: Install Composer dependencies
# Ignore platform requirements as PHPUnit may require a higher PHP version than the minimum supported.
run: composer install --ignore-platform-reqs
- name: Run PHPUnit (AllSniffs)
# Pass settings via CLI to avoid PHPUnit config file compatibility issues across versions.
run: vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/AllSniffs.php
- name: Run PHPUnit (FixtureTests)
run: vendor/bin/phpunit --no-configuration --bootstrap=tests/bootstrap.php --dont-report-useless-tests tests/FixtureTests.php