-
Notifications
You must be signed in to change notification settings - Fork 64
65 lines (60 loc) · 1.93 KB
/
ci-build.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
name: Build
on:
push:
branches: [ master ]
pull_request:
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-22.04
strategy:
matrix:
php-version:
- 7.3
- 7.4
- 8.0
- 8.1
include:
- php-version: 5.6
phpunit-version: 5.7
- php-version: 7.0
phpunit-version: 6.5
- php-version: 7.1
phpunit-version: 7.5
- php-version: 7.2
phpunit-version: 8.5
- phpunit-version: 9.5
steps:
- uses: actions/checkout@v3
- name: "Setup PHP ${{ matrix.php-version }} with PHPUnit ${{ matrix.phpunit-version }}"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpunit:${{ matrix.phpunit-version }}
- name: Remove composer.lock
run: rm composer.lock
- name: Remove PHPUnit from composer.json
run: composer remove phpunit/phpunit --dev --no-update
- name: Prepare composer cache
id: composer-cache
run: |
COMPOSER_CACHE_DIR=$(composer config cache-files-dir)
mkdir -p ${COMPOSER_CACHE_DIR}
echo "dir=${COMPOSER_CACHE_DIR}" >> ${GITHUB_OUTPUT}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.php-version }}
- name: Install dependencies
run: composer install --no-interaction --prefer-source
- name: Run PHP_CodeSniffer
run: |
vendor/bin/phpcs --standard=phpcs.xml src -s
vendor/bin/phpcs --standard=phpcs.xml extensions -s
vendor/bin/phpcs --standard=phpcs.xml examples -s
- name: Run PHPUnit
run: phpunit