Skip to content

Commit 396fd6b

Browse files
author
Basile Burg
authored
Merge pull request #44 from wilzbach/enable-appveyor
Enable testing on Windows with AppVeyor
2 parents 6d14e8a + 8ad65c2 commit 396fd6b

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed

appveyor.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
platform: x64
2+
environment:
3+
matrix:
4+
- DC: dmd
5+
DVersion: nightly
6+
arch: x64
7+
- DC: dmd
8+
DVersion: nightly
9+
arch: x86
10+
- DC: dmd
11+
DVersion: beta
12+
arch: x64
13+
- DC: dmd
14+
DVersion: beta
15+
arch: x86
16+
- DC: dmd
17+
DVersion: stable
18+
arch: x64
19+
- DC: dmd
20+
DVersion: stable
21+
arch: x86
22+
- DC: ldc
23+
DVersion: beta
24+
arch: x86
25+
- DC: ldc
26+
DVersion: beta
27+
arch: x64
28+
- DC: ldc
29+
DVersion: stable
30+
arch: x86
31+
- DC: ldc
32+
DVersion: stable
33+
arch: x64
34+
35+
skip_tags: false
36+
branches:
37+
only:
38+
- master
39+
40+
install:
41+
- ps: function ResolveLatestDMD
42+
{
43+
$version = $env:DVersion;
44+
if($version -eq "stable") {
45+
$latest = (Invoke-WebRequest "http://downloads.dlang.org/releases/LATEST").toString();
46+
$url = "http://downloads.dlang.org/releases/2.x/$($latest)/dmd.$($latest).windows.7z";
47+
}elseif($version -eq "beta") {
48+
$latest = (Invoke-WebRequest "http://downloads.dlang.org/pre-releases/LATEST").toString();
49+
$latestVersion = $latest.split("-")[0].split("~")[0];
50+
$url = "http://downloads.dlang.org/pre-releases/2.x/$($latestVersion)/dmd.$($latest).windows.7z";
51+
}elseif($version -eq "nightly") {
52+
$url = "http://nightlies.dlang.org/dmd-master-2017-05-20/dmd.master.windows.7z"
53+
}else {
54+
$url = "http://downloads.dlang.org/releases/2.x/$($version)/dmd.$($version).windows.7z";
55+
}
56+
$env:PATH += ";C:\dmd2\windows\bin;";
57+
return $url;
58+
}
59+
- ps: function ResolveLatestLDC
60+
{
61+
$version = $env:DVersion;
62+
if($version -eq "stable") {
63+
$latest = (Invoke-WebRequest "https://ldc-developers.github.io/LATEST").toString().replace("`n","").replace("`r","");
64+
$url = "https://github.com/ldc-developers/ldc/releases/download/v$($latest)/ldc2-$($latest)-win64-msvc.zip";
65+
}elseif($version -eq "beta") {
66+
$latest = (Invoke-WebRequest "https://ldc-developers.github.io/LATEST_BETA").toString().replace("`n","").replace("`r","");
67+
$url = "https://github.com/ldc-developers/ldc/releases/download/v$($latest)/ldc2-$($latest)-win64-msvc.zip";
68+
} else {
69+
$latest = $version;
70+
$url = "https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-win64-msvc.zip";
71+
}
72+
$env:PATH += ";C:\ldc2-$($latest)-win64-msvc\bin";
73+
$env:DC = "ldc2";
74+
return $url;
75+
}
76+
- ps: function SetUpDCompiler
77+
{
78+
$env:toolchain = "msvc";
79+
if($env:DC -eq "dmd"){
80+
echo "downloading ...";
81+
$url = ResolveLatestDMD;
82+
echo $url;
83+
Invoke-WebRequest $url -OutFile "c:\dmd.7z";
84+
echo "finished.";
85+
pushd c:\\;
86+
7z x dmd.7z > $null;
87+
popd;
88+
}
89+
elseif($env:DC -eq "ldc"){
90+
echo "downloading ...";
91+
$url = ResolveLatestLDC;
92+
echo $url;
93+
Invoke-WebRequest $url -OutFile "c:\ldc.zip";
94+
echo "finished.";
95+
pushd c:\\;
96+
7z x ldc.zip > $null;
97+
popd;
98+
}
99+
}
100+
- ps: SetUpDCompiler
101+
102+
build_script:
103+
- ps: if($env:arch -eq "x86"){
104+
$env:compilersetupargs = "x86";
105+
$env:Darch = "x86";
106+
$env:DConf = "m32";
107+
}elseif($env:arch -eq "x64"){
108+
$env:compilersetupargs = "amd64";
109+
$env:Darch = "x86_64";
110+
$env:DConf = "m64";
111+
}
112+
- ps: $env:compilersetup = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall";
113+
- '"%compilersetup%" %compilersetupargs%'
114+
115+
test_script:
116+
- echo %PLATFORM%
117+
- echo %Darch%
118+
- echo %DC%
119+
- echo %PATH%
120+
- '%DC% --version'
121+
- dub build --arch=%Darch% --compiler=%DC%

0 commit comments

Comments
 (0)