-
-
Notifications
You must be signed in to change notification settings - Fork 21
83 lines (81 loc) · 2.36 KB
/
test.yml
File metadata and controls
83 lines (81 loc) · 2.36 KB
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
name: Test
on:
pull_request:
push:
branches:
- master
jobs:
powershell:
name: PowerShell
runs-on: windows-latest
steps:
- name: Initialize
shell: powershell
run: |
$ErrorActionPreference = 'stop'
if (Test-Path -PathType Container -LiteralPath C:\tools\php) {
Remove-Item -Force -Recurse -LiteralPath C:\tools\php
}
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup
shell: powershell
run: .\test\setup.ps1
- name: Test
shell: powershell
run: |
$pesterResult = .\test\pester.ps1
if ($pesterResult.FailedCount -ne 0) {
throw "$($pesterResult.FailedCount) tests failed!"
}
powershellcore:
name: PowerShell Core
runs-on: windows-latest
steps:
- name: Initialize
shell: pwsh
run: |
$ErrorActionPreference = 'stop'
if (Test-Path -PathType Container -LiteralPath C:\tools\php) {
Remove-Item -Force -Recurse -LiteralPath C:\tools\php
}
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Setup
shell: pwsh
run: .\test\setup.ps1
- name: Test
shell: pwsh
run: |
$pesterResult = .\test\pester.ps1
if ($pesterResult.FailedCount -ne 0) {
throw "$($pesterResult.FailedCount) tests failed!"
}
docker:
strategy:
matrix:
docker-image:
- nanoserver
- windowsservercore
name: Docker (${{ matrix.docker-image }})
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Prepare files for Docker image
run: .\test\Prepare-Dockerfile.ps1 "${{ matrix.docker-image }}"
- name: Build Docker image
run: docker build --tag phpmanager/test .\test\docker-build
- name: Test
run: |
docker run --rm --volume "$($Env:GITHUB_WORKSPACE):C:\App" --workdir C:\App --env "PM_TEST_DOCKER=1" phpmanager/test powershell.exe 'pesterResult=.\test\pester.ps1; exit $pesterResult.FailedCount'
$failCount = $LASTEXITCODE
if ($failCount -ne 0) {
throw "$failCount tests failed!"
}