Read Me #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows | |
on: [push] | |
jobs: | |
build-and-test: | |
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 /F /A | |
./vcpkg/vcpkg install osg:x64-windows | |
tree ./vcpkg/installed /F /A | |
} | |
else { | |
Write-Host "vcpkg directory exists. Skipping installation." | |
} | |
- name: Build | |
run: cargo build --verbose --release | |
- name: Test | |
run: cargo test --verbose |