Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
fanvanzh committed May 22, 2024
1 parent f800971 commit 9ead7d0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build

on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- 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: Build
run: cargo build --verbose --release

- name: Test
run: cargo test --verbose
17 changes: 5 additions & 12 deletions .github/workflows/build.yml → .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ name: Build

on: [push]
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
build-and-test: windows-latest
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -19,20 +16,16 @@ jobs:
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
tree ./vcpkg/installed
./vcpkg/vcpkg install osg:x64-windows
tree ./vcpkg/installed
}
else {
Write-Host "vcpkg directory exists. Skipping installation."
Expand Down

0 comments on commit 9ead7d0

Please sign in to comment.