forked from mozilla/grcov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
78 lines (68 loc) · 2.74 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
image: Visual Studio 2017
platform:
- x64
environment:
matrix:
- CHANNEL: stable
PLATFORM_TARGET: x86_64
PLATFORM_VS: x64
- CHANNEL: nightly
PLATFORM_TARGET: x86_64
PLATFORM_VS: x64
# TODO: The i686 build currently doesn't work.
# - CHANNEL: nightly
# PLATFORM_TARGET: i686
# PLATFORM_VS: x86
install:
# Install Rust.
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init -yv --default-toolchain %CHANNEL% --default-host x86_64-pc-windows-msvc
- set PATH=%USERPROFILE%\.cargo\bin;%PATH%
- rustup component add llvm-tools-preview
- rustc -vV
- cargo -vV
# Install LLVM.
- appveyor-retry appveyor DownloadFile https://github.com/marco-c/llvm-appveyor/releases/download/llvm_342383/clang.tar.bz2 -FileName clang.tar.bz2
- 7z x clang.tar.bz2
- 7z x clang.tar
- set PATH=clang\bin;%PATH%
- set TARGET=%PLATFORM_TARGET%-pc-windows-msvc
- if NOT "%PLATFORM_TARGET%" == "x86_64" (
rustup target add %TARGET%
)
- if [%APPVEYOR_REPO_TAG%]==[false] (set BUILD_TYPE=debug)
- if [%APPVEYOR_REPO_TAG%]==[true] (set BUILD_TYPE=release)
- if [%BUILD_TYPE%]==[debug] (set CARGO_RELEASE_ARG=)
- if [%BUILD_TYPE%]==[release] (set CARGO_RELEASE_ARG=--release)
build_script:
- ps: |
If ($env:CHANNEL -eq "nightly" -And $env:APPVEYOR_REPO_TAG -eq "false") {
$env:RUSTFLAGS = "-Zinstrument-coverage"
}
- cargo build %CARGO_RELEASE_ARG% --locked --target %TARGET%
- 7z a grcov-win-%PLATFORM_TARGET%.tar .\target\%TARGET%\%BUILD_TYPE%\grcov.exe
- 7z a grcov-win-%PLATFORM_TARGET%.tar.bz2 grcov-win-%PLATFORM_TARGET%.tar
test_script:
- LLVM_PROFILE_FILE="grcov-%p-%m.profraw" cargo test %CARGO_RELEASE_ARG% --verbose
- ps: |
If ($env:CHANNEL -eq "nightly" -And $env:APPVEYOR_REPO_TAG -eq "false") {
mkdir ccov_dir
Get-ChildItem -Path *\grcov*.profraw -Recurse | Copy-Item -Destination ccov_dir
.\target\debug\grcov ccov_dir --binary-path .\target\debug\grcov.exe -s . -t lcov --branch --ignore-not-existing --ignore "C:*" -o lcov.info
(Get-Content lcov.info) | Foreach-Object {$_ -replace "\xEF\xBB\xBF", ""} | Set-Content lcov.info
((Get-Content lcov.info) -join "`n") + "`n" | Set-Content -NoNewline lcov.info
$env:PATH = "C:\msys64\usr\bin;" + $env:PATH
Invoke-WebRequest -Uri "https://codecov.io/bash" -OutFile codecov.sh
bash codecov.sh -f "lcov.info"
}
artifacts:
- path: grcov-win-$(PLATFORM_TARGET).tar.bz2
deploy:
artifact: grcov-win-$(PLATFORM_TARGET).tar.bz2
auth_token:
secure: /BjmtIYmmvSDJ5939QEcd857vcA29dIlcb/u6wgbWkAm+Cp4LN2KTi3+cVveoqz+
description: ''
on:
CHANNEL: nightly
appveyor_repo_tag: true
provider: GitHub