forked from coenjacobs/mozart
-
Notifications
You must be signed in to change notification settings - Fork 25
80 lines (65 loc) · 1.8 KB
/
main.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
name: Lint and test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
os: [ubuntu-latest, windows-latest]
fail-fast: false
name: PHP tests ${{ matrix.php }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: fileinfo
- name: Debugging
run: |
php --version
php -m
composer --version
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run tests
run: vendor/bin/phpunit
- name: Build phar
run:
./scripts/createphar.sh
- name: Run tests with strauss.phar
run: vendor/bin/phpunit
# TODO: get GitHub Actions annotations working again.
# run: vendor/bin/phpunit --printer mheap\\GithubActionsReporter\\Printer
lint:
runs-on: ubuntu-latest
name: Lint project files
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer, cs2pr
- name: Debugging
run: |
php --version
php -m
composer --version
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run validate
run: |
vendor/bin/phpcbf || true
vendor/bin/phpcs -q -n --report=checkstyle | cs2pr
- name: Commit PHPCBF changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "🤖 PHPCBF"