File tree 5 files changed +42
-54
lines changed
5 files changed +42
-54
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,6 @@ skip_commits:
22
22
environment :
23
23
PsgKey :
24
24
secure : tlhLuUS6x8FcP159+X/EIBDlj9m+u5KCTTuqwzsiNHlPX6K4AolpaZcfAP4ClOdB
25
- matrix :
26
- - DOCKER_IMAGE :
27
- - DOCKER_IMAGE : nanoserver
28
- - DOCKER_IMAGE : windowsservercore
29
25
30
26
cache :
31
27
- test\download-cache -> .appveyor.yml
@@ -36,23 +32,11 @@ cache:
36
32
build : off
37
33
38
34
install :
39
- - ps : |
40
- if ($null -eq $Env:DOCKER_IMAGE -or $Env:DOCKER_IMAGE -eq '') {
41
- .\test\setup.ps1
42
- } else {
43
- & ".\test\Dockerfile.$Env:DOCKER_IMAGE.ps1"
44
- }
45
-
35
+ - ps : .\test\setup.ps1
46
36
test_script :
47
37
- ps : |
48
- if ($null -eq $Env:DOCKER_IMAGE -or $Env:DOCKER_IMAGE -eq '') {
49
- $pesterResult = .\test\pester.ps1
50
- $failCount = $pesterResult.FailedCount
51
- } else {
52
- $volume="$($Env:APPVEYOR_BUILD_FOLDER):C:\App"
53
- docker run --rm --volume $volume --workdir C:\App --env "PM_TEST_DOCKER=1" phpmanager/test powershell.exe 'Set-Location -LiteralPath C:\App; $pesterResult=.\test\pester.ps1; exit $pesterResult.FailedCount'
54
- $failCount = $LASTEXITCODE
55
- }
38
+ $pesterResult = .\test\pester.ps1
39
+ $failCount = $pesterResult.FailedCount
56
40
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path -LiteralPath .\TestsResults.xml))
57
41
if ($failCount -ne 0) {
58
42
throw "$failCount tests failed!"
Original file line number Diff line number Diff line change 57
57
if ($pesterResult.FailedCount -ne 0) {
58
58
throw "$($pesterResult.FailedCount) tests failed!"
59
59
}
60
+ docker :
61
+ strategy :
62
+ matrix :
63
+ docker-image :
64
+ - nanoserver
65
+ - windowsservercore
66
+ name : Docker (${{ matrix.docker-image }})
67
+ runs-on : windows-latest
68
+ steps :
69
+ - name : Debug
70
+ run : Get-ChildItem 'C:\\Program Files\\Docker'
71
+ - name : Enabling Windows containers
72
+ run : " & 'C:\\ Program Files\\ Docker\\ DockerCli.exe' -SwitchWindowsEngine"
73
+ - name : Checkout
74
+ uses : actions/checkout@v2
75
+ with :
76
+ fetch-depth : 1
77
+ - name : Prepare files for Docker image
78
+ run : .\test\Prepare-Dockerfile.ps1 "${{ matrix.docker-image }}"
79
+ - name : Build Docker image
80
+ run : docker build --tag phpmanager/test .\test\docker-build
81
+ - name : Test
82
+ run : |
83
+ 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'
84
+ $failCount = $LASTEXITCODE
85
+ if ($failCount -ne 0) {
86
+ throw "$failCount tests failed!"
87
+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ param ([string ] $DockerImage )
2
+
3
+ $dockerBuildPath = Join-Path - Path $PSScriptRoot - ChildPath docker- build
4
+ if (-Not (Test-Path - LiteralPath $dockerBuildPath )) {
5
+ New-Item - ItemType Directory - Path $dockerBuildPath | Out-Null
6
+ }
7
+ Copy-Item - LiteralPath " $ ( $Env: SystemRoot ) \System32\vcruntime140.dll" - Destination $dockerBuildPath
8
+ Copy-Item - LiteralPath " $ ( $Env: SystemRoot ) \System32\vcomp140.dll" - Destination $dockerBuildPath
9
+ Copy-Item - LiteralPath (Join-Path - Path $PSScriptRoot - ChildPath setup- nodejs.ps1) - Destination $dockerBuildPath
10
+ Copy-Item - LiteralPath (Join-Path - Path $PSScriptRoot - ChildPath setup.ps1) - Destination $dockerBuildPath
11
+ Copy-Item - LiteralPath (Join-Path - Path $PSScriptRoot - ChildPath " Dockerfile.$DockerImage " ) - Destination (Join-Path - Path $dockerBuildPath - ChildPath Dockerfile)
You can’t perform that action at this time.
0 commit comments