-
Notifications
You must be signed in to change notification settings - Fork 594
38 lines (32 loc) · 1.05 KB
/
windows.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
name: Build
on: [push]
jobs:
build-and-test: windows-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2 # 使用actions/cache
with:
path: ./vcpkg # 设置缓存目录路径
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/build.rs') }} # 设置缓存的key
restore-keys: | # 设置恢复缓存的key列表
${{ runner.os }}-vcpkg-
- name: Install dependencies on Windows
if: runner.os == 'Windows'
run: |
if (-Not (Test-Path "./vcpkg")) {
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.bat
./vcpkg/vcpkg install gdal:x64-windows
tree ./vcpkg/installed
./vcpkg/vcpkg install osg:x64-windows
tree ./vcpkg/installed
}
else {
Write-Host "vcpkg directory exists. Skipping installation."
}
- name: Build
run: cargo build --verbose --release
- name: Test
run: cargo test --verbose