-
Notifications
You must be signed in to change notification settings - Fork 9
/
appveyor.yml
147 lines (131 loc) · 4.4 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
143
144
145
146
147
branches:
only:
- master
environment:
DOKAN_CONSOLE_DEBUG_LOG: 1
RUST_BACKTRACE: 1
AccessTokenDokanDoc:
secure: Z5/daTZ6OJaDbslmhxSxxB6leKaqHTnTbISy153Y4cdJm/oTAbDHaofb9TqvKXV1
matrix:
- ARCH: x86_64
TOOLCHAIN: msvc
UPLOAD_DOC: "true"
- ARCH: x86_64
TOOLCHAIN: msvc
USE_INSTALLED_LIB: "true"
- ARCH: i686
TOOLCHAIN: msvc
- ARCH: i686
TOOLCHAIN: msvc
USE_INSTALLED_LIB: "true"
- ARCH: x86_64
BITS: "64"
TOOLCHAIN: gnu
- ARCH: x86_64
BITS: "64"
TOOLCHAIN: gnu
USE_INSTALLED_LIB: "true"
- ARCH: i686
BITS: "32"
TOOLCHAIN: gnu
- ARCH: i686
BITS: "32"
TOOLCHAIN: gnu
USE_INSTALLED_LIB: "true"
os: Visual Studio 2022
platform: x64
init:
- ps: |
function CheckLastExitCode($ExpectedExitCode = 0) {
if ($LastExitCode -ne $ExpectedExitCode) {
throw "execution failed with code '$LastExitCode' (expected '$ExpectedExitCode')"
}
}
function ExecuteExe {
Param(
[Parameter(Mandatory=$true)]
[String]
$Exe,
[Array]
[Parameter(ValueFromRemainingArguments=$true)]
$Arguments
)
& $Exe @Arguments
CheckLastExitCode
}
install:
- ps: &download-dokany |
Invoke-WebRequest https://github.com/dokan-dev/dokany/releases/download/v2.2.0.1000/DokanSetup.exe -OutFile "$Env:TEMP\DokanSetup.exe"
Start-Process "$Env:TEMP\DokanSetup.exe" -ArgumentList '/quiet /norestart' -Wait
if ($Env:USE_INSTALLED_LIB -eq $true) {
$Env:DokanLibrary2_LibraryPath_x64 = 'C:\Program Files\Dokan\Dokan Library-2.2.0\lib\'
$Env:DokanLibrary2_LibraryPath_x86 = 'C:\Program Files\Dokan\Dokan Library-2.2.0\x86\lib\'
} else {
Remove-Item 'C:\Windows\System32\dokan2.dll'
Remove-Item 'C:\Windows\SysWOW64\dokan2.dll'
}
- ps: |
Invoke-WebRequest https://win.rustup.rs/x86_64 -OutFile "$Env:TEMP\rustup-init.exe"
& "$Env:TEMP\rustup-init.exe" -y --default-host "$Env:ARCH-pc-windows-$Env:TOOLCHAIN"
CheckLastExitCode
$Env:PATH = "$Env:PATH;C:\Users\appveyor\.cargo\bin"
before_build:
- ps: $Version = (git describe --tags)
- ps: Update-AppveyorBuild -Version $Version
- cmd: git submodule update --init
- ps: |
if ($Env:USE_INSTALLED_LIB -ne $true) {
$Env:DOKAN_DLL_OUTPUT_PATH = "$Env:APPVEYOR_BUILD_FOLDER\target\release"
}
build_script:
- cmd: cargo build --release --workspace --all-targets
- cmd: cargo doc --release --workspace
test_script:
- cmd: cargo test --release --workspace
- cmd: cargo test --release --workspace -- --ignored
deploy_script:
- ps: |
$ErrorActionPreference = "Stop"
if ($Env:APPVEYOR_REPO_TAG -ne $true -or $Env:UPLOAD_DOC -ne $true) {
return;
}
ExecuteExe -- git config --global user.email [email protected]
ExecuteExe -- git config --global user.name appveyor
ExecuteExe -- git clone https://lirynastark:$($Env:AccessTokenDokanDoc)@github.com/dokan-dev/dokan-rust-doc.git doc 2>&1
if (Test-Path doc\html) {
Remove-Item -Recurse -Force doc\html\*
} else {
mkdir doc\html
}
Copy-Item -Recurse target\doc\* doc\html\
cd doc
if ($(git status --porcelain)) {
Write-Host "Updating documentation..." -ForegroundColor Green
ExecuteExe -- git add -A 2>&1
ExecuteExe -- git commit -m "Automatically update documentation for $version" 2>&1
ExecuteExe -- git push 2>&1
Write-Host -ForegroundColor Green "Documentation updated!"
} else {
Write-Host -ForegroundColor Green "No documentation changes detected."
}
for:
- matrix:
only:
- TOOLCHAIN: gnu
install:
- ps: *download-dokany
- ps: |
function ExecuteBash($SCRIPT) {
& "C:\msys64\mingw$Env:BITS.exe" -c $SCRIPT
}
ExecuteBash @"
pacman -Syu --noconfirm --noprogressbar
pacman -Syu --needed --noconfirm --noprogressbar
pacman -S mingw-w64-$ARCH-rust
"@
build_script:
- ps: ExecuteBash 'cargo build --release --workspace --all-targets'
- ps: ExecuteBash 'cargo doc --release --workspace'
test_script:
- ps: ExecuteBash 'cargo test --release --workspace'
- ps: ExecuteBash 'cargo test --release --workspace -- --ignored'