-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
93 lines (83 loc) · 3.03 KB
/
.appveyor.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
version: 1.0.{build}
platform: x64
skip_tags: false
image: Visual Studio 2015
environment:
VCVARSALL: '"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall"'
matrix:
- DC: dmd
ARCH: x86
- DC: dmd
ARCH: x86_64
- DC: ldc2
ARCH: x86
- DC: ldc2
ARCH: x86_64
install:
- ps: function SetUpDCompiler {
$TempDir = [System.IO.Path]::GetTempPath();
if($env:DC -eq "dmd") {
echo "*** Getting latest dmd version... ***";
$env:DCVER = Invoke-WebRequest -URI "http://downloads.dlang.org/releases/LATEST";
echo "*** $($env:DCVER) it is. Downloading... ***";
Invoke-WebRequest "http://downloads.dlang.org/releases/2.x/$($env:DCVER)/dmd.$($env:DCVER).windows.7z"
-OutFile "$($TempDir)dmd-latest.7z";
echo "*** Unpacking... ***";
7z x "$($TempDir)dmd-latest.7z" -o"C:\\" > $null;
echo "*** Done! Adding it to PATH ***";
$env:PATH += ";C:\dmd2\windows\bin;";
echo "*** Checking dmd ***";
dmd --version;
echo "*** Checking dub ***";
dub --version;
} elseif($env:DC -eq "ldc2") {
echo "*** Getting latest ldc version... ***";
$env:DCVER = Invoke-RestMethod "https://api.github.com/repos/ldc-developers/ldc/releases/latest"|
Select -Expand "tag_name" |
%{ $_ -Replace("^v", "") };
echo "*** $($env:DCVER) it is. Downloading... ***";
Invoke-WebRequest "https://github.com/ldc-developers/ldc/releases/download/v$($env:DCVER)/ldc2-$($env:DCVER)-win64-msvc.zip"
-OutFile "$($TempDir)ldc-latest.zip";
echo "*** Unpacking... ***";
7z x "$($TempDir)ldc-latest.zip" -o"C:\\" > $null;
echo "*** Done! Adding it to PATH ***";
$env:PATH += ";C:\ldc2-$($env:DCVER)-win64-msvc\bin;";
echo "*** Checking ldc ***";
ldc2 --version;
echo "*** Checking dub ***";
dub --version;
}
}
- ps: SetUpDCompiler
- ps: if($env:ARCH -eq "x86") {
$env:VCVARS = "x86";
} else {
$env:VCVARS = "amd64";
}
- '%VCVARSALL% %VCVARS%'
build_script:
- ps: if($env:DC -eq "ldc2" -and $env:APPVEYOR_REPO_TAG -eq "true") {
dub build -b release --compiler=$env:DC --arch=$env:ARCH;
$archive = "covered-$($env:APPVEYOR_REPO_TAG_NAME)-windows-$($env:DC)-$($env:ARCH).zip";
echo "Compressing binaries -> $($archive)";
7z a $archive covered.exe > $null;
}
test_script:
- ps: dub build -b debug --compiler=$env:DC --arch=$env:ARCH;
- ps: $ErrorActionPreference = "SilentlyContinue";
dub build -b unittest -c unittest --compiler=$env:DC --arch=$env:ARCH;
$ErrorActionPreference = "Continue";
.\.dub\unittest.exe -t -s -d;
artifacts:
- path: covered-*.zip
name: bin
deploy:
provider: GitHub
auth_token:
secure: "+9yH5FXyqCRKTj30Mil9a+V83mmAJq4oQqpFdUPP3Byi3XqeuH2uR4loGxfIvS6x"
artifact: bin
draft: false
prerelease: false
on:
DC: "ldc2"
appveyor_repo_tag: true