-
-
Notifications
You must be signed in to change notification settings - Fork 1
107 lines (89 loc) · 2.87 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Test
on:
push:
paths-ignore:
- '**.md'
pull_request:
schedule:
- cron: '30 0 * * *'
# │ │ │ │ │───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │───────────── month (1 - 12 or JAN-DEC)
# │ │ │───────────── day of the month (1 - 31)
# │ │───────────── hour (0 - 23)
# │──────────── minute (0 - 59)
env:
CACHE_DIR: 'C:\Downloads'
INSTALL_DIR: 'C:\tools'
defaults:
run:
shell: powershell
jobs:
test:
name: "PHP v${{ matrix.php }} (${{ matrix.ts }}) ${{ matrix.arch }} - ${{ matrix.msvc }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: win2016-php74-nts-x64-vc15
os: windows-2016
php: '7.4'
ts: 'nts'
arch: 'x64'
msvc: 'vc15'
- name: win2019-php80-nts-x64-vs16
os: windows-2019
php: '8.0'
ts: 'nts'
arch: 'x64'
msvc: 'vs16'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: psr, zip, mysqli
ini-values: >-
variables_order=EGPCS,
enable_dl=On,
allow_url_fopen=On,
error_reporting=-1,
memory_limit=1G,
date.timezone=UTC,
env:
PHPTS: ${{ matrix.ts }}
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Prepare
run: |
if (-not (Test-Path "${{ env.CACHE_DIR }}")) { mkdir "${{ env.CACHE_DIR }}" }
if (-not (Test-Path "${{ env.INSTALL_DIR }}")) { mkdir "${{ env.INSTALL_DIR }}" }
- name: Setup PHP SDK and Developer Pack
uses: ./
with:
php_version: ${{ matrix.php }}
ts: ${{ matrix.ts }}
msvc: ${{ matrix.msvc }}
arch: ${{ matrix.arch }}
install_dir: ${{ env.INSTALL_DIR }}
cache_dir: ${{ env.CACHE_DIR }}
- name: Tests
run: |
$exitCode = 0
Write-Output "::group::Check directories"
if (Test-Path "${{ env.INSTALL_DIR }}\php-sdk") {
Write-Output "PHP SDK installed: ${{ env.INSTALL_DIR }}\php-sdk"
} else {
Write-Output "PHP SDK not exists"
$exitCode = 1
}
if (Test-Path "${{ env.INSTALL_DIR }}\php-devpack") {
Write-Output "PHP Developer Pack installed: ${{ env.INSTALL_DIR }}\php-devpack"
} else {
Write-Output "PHP Developer Pack not exists"
$exitCode = 1
}
Write-Output "::endgroup::"
exit $exitCode