forked from rust-lang/rustup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
142 lines (127 loc) · 4.99 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
image: Visual Studio 2017
branches:
# whitelist
only:
- master
- stable
- auto
cache:
- '%USERPROFILE%\.cargo\'
- target
# before cache
after_test:
- set CARGO_TARGET_DIR=%APPVEYOR_BUILD_FOLDER%\target
- cargo install
--debug
--force
--git https://github.com/matthiaskrgr/cargo-cache
--no-default-features
--features ci-autoclean
--bin cargo-cache
--
cargo-cache
- cargo cache
environment:
global:
RUSTFLAGS: -Ctarget-feature=+crt-static
RUST_BACKTRACE: 1
matrix:
- TARGET: x86_64-pc-windows-msvc
ALLOW_PR: 1
- TARGET: i686-pc-windows-msvc
- TARGET: x86_64-pc-windows-gnu
MINGW_DIR: mingw64
- TARGET: i686-pc-windows-gnu
MINGW_DIR: mingw32
access_token:
secure: q8Wqx0brgfpOYFQqWauvucE2h0o1WYb41a3gKaCKV9QiE4eTz6qLNlqyC3mdsp4Q
matrix:
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
install:
# If this is a PR and we're not allowed to test PRs, skip the whole build.
# Also if we're on the master branch no need to run the full test suite, so
# just do a smoke test.
- if defined APPVEYOR_PULL_REQUEST_NUMBER if NOT defined ALLOW_PR appveyor exit
- if "%APPVEYOR_REPO_BRANCH%" == "master" if NOT defined ALLOW_PR appveyor exit
# Install MSYS2 and MINGW (32-bit & 64-bit)
- ps: |
# Check if MSYS2 was restored from cache
if($env:MINGW_DIR) {
if($env:MINGW_DIR -eq "mingw32") {
# Download and install MINGW (32-bit)
Write-Host "Installing MinGW (32-bit)..." -ForegroundColor Cyan
Write-Host "Downloading installation package..."
appveyor-retry appveyor DownloadFile https://rust-lang-ci.s3.amazonaws.com/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z -FileName mingw.7z
} elseif($env:MINGW_DIR -eq "mingw64") {
# Download and install MINGW (64-bit)
Write-Host "Installing MinGW (64-bit)..." -ForegroundColor Cyan
Write-Host "Downloading installation package..."
appveyor-retry appveyor DownloadFile https://rust-lang-ci.s3.amazonaws.com/x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z -FileName mingw.7z
}
Write-Host "Extracting installation package..."
7z x -y mingw.7z -oC:\msys64 | Out-Null
del mingw.7z
} else {
Write-Host "MSYS2 not required" -ForegroundColor Green
}
# Install rust, x86_64-pc-windows-msvc host
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --profile=minimal
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin
- del rustup-init.exe
# Install the target we're compiling for
- rustup target add %TARGET%
# add mingw to PATH if necessary
- if defined MINGW_DIR set PATH=C:\msys64\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH%
# And if mingw, re-put appveyor's git in place
- if defined MINGW_DIR set PATH=C:\Program Files\Git\cmd;%PATH%
# let's see what we got
- where gcc rustc cargo
- rustc -vV
- cargo -V
# Build settings, not to be confused with "before_build" and "after_build".
build: false
build_script:
- cargo build --release --target %TARGET% --locked
- cargo run --release --target %TARGET% --locked -- --dump-testament
test_script:
# The rest of this relies on the set of things to test not changing
# because I have no idea how to script it. TODO: Get someone to script it?
- cargo test --release --target %TARGET% -p download
- cargo test --release --target %TARGET% --bin rustup-init
- cargo test --release --target %TARGET% --lib --all
- cargo test --release --target %TARGET% --doc --all
- cargo test --release --target %TARGET% --test cli-exact
- cargo test --release --target %TARGET% --test cli-inst-interactive
- cargo test --release --target %TARGET% --test cli-misc
- cargo test --release --target %TARGET% --test cli-rustup
- cargo test --release --target %TARGET% --test cli-self-upd
- cargo test --release --target %TARGET% --test cli-v1
- cargo test --release --target %TARGET% --test cli-v2
- cargo test --release --target %TARGET% --test dist_install
- cargo test --release --target %TARGET% --test dist_manifest
- cargo test --release --target %TARGET% --test dist -- --test-threads 1
- cargo test --release --target %TARGET% --test dist_transactions
before_deploy:
- powershell -File ci/prepare-deploy-appveyor.ps1
artifacts:
- path: dist\$(TARGET)\rustup-init.exe
name: rustup-init
- path: dist\$(TARGET)\rustup-init.exe.sha256
name: rustup-init-sha
- path: dist\$(TARGET)\rustup-setup.exe
name: rustup-setup
- path: dist\$(TARGET)\rustup-setup.exe.sha256
name: rustup-setup-sha
deploy:
- provider: S3
skip_cleanup: true
access_key_id: $(AWS_ACCESS_KEY_ID)
secret_access_key: $(AWS_SECRET_ACCESS_KEY)
bucket: dev-static-rust-lang-org
set_public: true
region: us-west-1
artifact: rustup-init,rustup-init-sha,rustup-setup,rustup-setup-sha
folder: rustup
on:
branch: stable