Skip to content

Commit 22a50d5

Browse files
committed
add appveyor config trial
1 parent ea1475f commit 22a50d5

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

appveyor.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
image: Visual Studio 2017
2+
environment:
3+
RUSTFLAGS: -Ctarget-feature=+crt-static
4+
matrix:
5+
- TARGET: x86_64-pc-windows-msvc
6+
ALLOW_PR: 1
7+
- TARGET: i686-pc-windows-msvc
8+
- TARGET: i686-pc-windows-msvc
9+
BUILD_MSI: 1
10+
- TARGET: i686-pc-windows-gnu
11+
MINGW_DIR: mingw32
12+
- TARGET: x86_64-pc-windows-gnu
13+
MINGW_DIR: mingw64
14+
access_token:
15+
secure: q8Wqx0brgfpOYFQqWauvucE2h0o1WYb41a3gKaCKV9QiE4eTz6qLNlqyC3mdsp4Q
16+
branches:
17+
# only:
18+
# - master
19+
- auto
20+
21+
install:
22+
# If this is a PR and we're not allowed to test PRs, skip the whole build.
23+
# Also if we're on the master branch no need to run the full test suite, so
24+
# just do a smoke test.
25+
- if defined APPVEYOR_PULL_REQUEST_NUMBER if NOT defined ALLOW_PR appveyor exit
26+
- if "%APPVEYOR_REPO_BRANCH%" == "master" if NOT defined ALLOW_PR appveyor exit
27+
28+
# Install MSYS2 and MINGW (32-bit & 64-bit)
29+
- ps: |
30+
# Check if MSYS2 was restored from cache
31+
if($env:MINGW_DIR) {
32+
if($env:MINGW_DIR -eq "mingw32") {
33+
# Download and install MINGW (32-bit)
34+
Write-Host "Installing MinGW (32-bit)..." -ForegroundColor Cyan
35+
Write-Host "Downloading installation package..."
36+
appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z -FileName mingw.7z
37+
} elseif($env:MINGW_DIR -eq "mingw64") {
38+
# Download and install MINGW (64-bit)
39+
Write-Host "Installing MinGW (64-bit)..." -ForegroundColor Cyan
40+
Write-Host "Downloading installation package..."
41+
appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z -FileName mingw.7z
42+
}
43+
Write-Host "Extracting installation package..."
44+
7z x -y mingw.7z -oC:\msys64 | Out-Null
45+
del mingw.7z
46+
} else {
47+
Write-Host "MSYS2 not required" -ForegroundColor Green
48+
}
49+
50+
# Install rust, x86_64-pc-windows-msvc host
51+
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
52+
- rustup-init.exe -y --default-host=x86_64-pc-windows-msvc
53+
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
54+
55+
# Install the target we're compiling for
56+
- if NOT "%TARGET%" == "x86_64-pc-windows-msvc" rustup target add %TARGET%
57+
58+
# add mingw to PATH if necessary
59+
- if defined MINGW_DIR set PATH=C:\msys64\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH%
60+
61+
# set cargo features for MSI if requested (otherwise empty string)
62+
- set FEATURES=
63+
- if defined BUILD_MSI set FEATURES=--features msi-installed
64+
65+
# let's see what we got
66+
- where gcc rustc cargo
67+
- rustc -vV
68+
- cargo -vV
69+
70+
build: false
71+
72+
test_script:
73+
- cargo build --release --target %TARGET% %FEATURES% --locked
74+
- cargo test --release -p rustup-dist --target %TARGET%
75+
- cargo test --release --target %TARGET% %FEATURES%
76+
- if defined BUILD_MSI pushd src\rustup-win-installer && cargo build --release --target %TARGET% & popd
77+
- if defined BUILD_MSI pushd src\rustup-win-installer\msi && powershell .\build.ps1 -Target %TARGET% & popd

0 commit comments

Comments
 (0)