-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (38 loc) · 1.4 KB
/
Copy pathtest.yml
File metadata and controls
47 lines (38 loc) · 1.4 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
name: Tests
# Pull requests only. A push to main runs the same checks as the `check` job in
# main.yml, where they additionally gate the release; running them here too would
# just duplicate that.
on:
pull_request:
permissions:
contents: read
jobs:
test:
name: Lint and hook registration (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# The floor declared in readme.txt, and a current release. The runner's
# ambient PHP is whatever the image ships and tracks neither, so relying
# on it tested a version the plugin does not claim to support.
php: [ '8.1', '8.4' ]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# The job lints and executes PHP straight from the checked-out pull
# request, so the GITHUB_TOKEN must not be left in the local git
# config where that code could read it.
persist-credentials: false
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Report PHP version
run: php -v
- name: Lint PHP files
run: find . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n1 -- php -l
- name: Hook registration regression test
run: php tests/hook-registration-test.php