vcpkg #11
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: Build | |
on: [push] | |
jobs: | |
build-and-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, 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 Ubuntu | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y g++ libgdal-dev libopenscenegraph-dev | |
- 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 osg:x64-windows | |
./vcpkg/vcpkg install gdal:x64-windows | |
} | |
else { | |
Write-Host "vcpkg directory exists. Skipping installation." | |
} | |
- name: Build | |
run: cargo build --verbose --release | |
- name: Test | |
run: cargo test --verbose |