-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (48 loc) · 1.84 KB
/
push.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
name: CI
on: push
jobs:
run:
env:
ACTIONS_STEP_DEBUG: true
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
php-versions: ["7.3", "7.4"]
phpunit-version: ["7", "8", "9"]
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.os }} (PHPUnit ${{ matrix.phpunit-version }})
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
coverage: xdebug
- name: Set PHPUnit Version
run: |
$content = Get-Content -Path 'composer.json' | ConvertFrom-Json
$content.{require-dev}.{phpunit/phpunit} = "^${{ matrix.phpunit-version }}"
$content | ConvertTo-Json | Set-Content -Path 'composer.json'
shell: pwsh
- name: Composer dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Configure tests for the current PHPUnit version (Non-Windows)
run: |
V=$(./vendor/bin/phpunit --version)
sed -i.bak "s/%%VERSION%%/$V/" test/states-test.phpt
if: "!startsWith(matrix.os, 'windows')"
- name: Configure tests for the current PHPUnit version (Windows)
id: phpunit-windows
run: |
$V = (.\vendor\bin\phpunit --version | Out-String).trim()
$content = Get-Content -Path 'test/states-test.phpt'
$newContent = $content -replace '%%VERSION%%', $V
$newContent | Set-Content -Path 'test/states-test.phpt'
if: "startsWith(matrix.os, 'windows')"
- name: Run phpunit
run: ./vendor/bin/phpunit
- name: Run phpcs
run: ./vendor/bin/phpcs