-
-
Notifications
You must be signed in to change notification settings - Fork 138
82 lines (70 loc) · 2.25 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
79
80
81
82
name: CI
on:
pull_request:
push:
branches:
- v1
- v2
- v3
jobs:
CI:
runs-on: ubuntu-22.04
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
experimental: [false]
composer-extra: ['']
include:
- php: 8.4
experimental: true
composer-extra: '--ignore-platform-req=php+'
env:
PHP_VERSION: ${{ matrix.php }}
name: PHP ${{ matrix.php }}
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: bz2,xml,curl
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Validate composer.json
run: composer validate
- name: Cache composer files
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Install dependencies using composer
run: composer install --prefer-dist --no-interaction ${{ matrix.composer-extra }}
- name: PHP CodeStyle
run: |
mkdir -p build/logs
vendor/bin/phpcs src tests --extensions=php --ignore=bootstrap --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=build/config/phpcs.xml -v
vendor/bin/phpmd src,tests xml build/config/phpmd.xml
- name: Run PHPUnit
run: vendor/bin/phpunit -c phpunit.xml --verbose
- name: Upload Coveralls coverage
uses: coverallsapp/github-action@v2
with:
parallel: true
file: build/logs/clover.xml
- name: Upload Scrutinizer coverage
uses: sudo-bot/action-scrutinizer@latest
if: github.repository == 'Austinb/GameQ'
with:
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
Finish:
needs: CI
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true