Skip to content

Commit

Permalink
Add vcpkg ci
Browse files Browse the repository at this point in the history
  • Loading branch information
talregev committed Jun 15, 2023
1 parent adc4389 commit 2980ce1
Show file tree
Hide file tree
Showing 17 changed files with 372 additions and 339 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Linux CI

on: [pull_request]
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: macOS CI

on: [pull_request]
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/build-python.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Python CI

on: [pull_request]
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/build-special.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Special Cases CI

on: [pull_request]
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
name: Windows CI

on: [pull_request]
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Linux
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
schedule:
- cron: '10 12 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
BUILD_DIR: gtsam/3rdparty/linux
VCPKG_ROOT: gtsam/3rdparty/linux/vcpkg
VCPKG_LINK: https://github.com/microsoft/vcpkg/
VCPKG_CONFIGS: gtsam/3rdparty/vcpkg
BINARY_CACHE: gtsam/3rdparty/buildCache/linux

jobs:
build:
name: vcpkg-ubuntu
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
gtsam/3rdparty/buildCache/linux
key: linux-${{ hashFiles('.github/workflows/linux.yml') }}

- name: Init vcpkg
if: success()
run: |
mkdir -p $BUILD_DIR
git -C $BUILD_DIR clone $VCPKG_LINK
- name: Vcpkg build & cmake config
if: success()
run: |
sudo apt install -y ninja-build
ninja --version
export VCPKG_BINARY_SOURCES="clear;files,$PWD/$BINARY_CACHE,readwrite;"
mkdir -p $BINARY_CACHE
export CMAKE_GENERATOR=Ninja
cmake . -B build \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_MANIFEST_DIR=$VCPKG_CONFIGS/manifest \
-DVCPKG_INSTALLED_DIR=$VCPKG_ROOT/installed \
-DVCPKG_OVERLAY_TRIPLETS=$VCPKG_CONFIGS/triplets \
-DVCPKG_TARGET_TRIPLET=x64-linux \
-DVCPKG_INSTALL_OPTIONS=--clean-after-build \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=ON \
-DGTSAM_ROT3_EXPMAP=ON \
-DGTSAM_POSE3_EXPMAP=ON \
-DGTSAM_BUILD_PYTHON=ON \
-DGTSAM_BUILD_TESTS=ON \
-DGTSAM_BUILD_UNSTABLE=ON \
-DGTSAM_USE_SYSTEM_EIGEN=ON \
-DGTSAM_USE_SYSTEM_METIS=ON \
-DGTSAM_SUPPORT_NESTED_DISSECTION=ON
- name: Cmake build
if: success()
run: |
cmake --build build --config Release -j 2
- name: Run tests
if: success()
run: |
cmake --build build --target check -j 2
86 changes: 86 additions & 0 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: OSX
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
schedule:
- cron: '10 12 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
BUILD_DIR: gtsam/3rdparty/osx
VCPKG_ROOT: gtsam/3rdparty/osx/vcpkg
VCPKG_LINK: https://github.com/microsoft/vcpkg/
VCPKG_CONFIGS: gtsam/3rdparty/vcpkg
BINARY_CACHE: gtsam/3rdparty/buildCache/osx

jobs:
build:
name: vcpkg-macos
runs-on: macos-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
gtsam/3rdparty/buildCache/osx
key: osx-${{ hashFiles('.github/workflows/osx.yml') }}

- name: Install Dependencies
run: |
sudo xcode-select -switch /Applications/Xcode.app
- name: Install python packages
if: success()
run: |
pip3 install pyparsing
- name: Init vcpkg
if: success()
run: |
mkdir -p $BUILD_DIR
git -C $BUILD_DIR clone $VCPKG_LINK
- name: Vcpkg build & cmake config
if: success()
run: |
brew install ninja
ninja --version
export VCPKG_BINARY_SOURCES="clear;files,$PWD/$BINARY_CACHE,readwrite;"
mkdir -p $BINARY_CACHE
export CMAKE_GENERATOR=Ninja
cmake . -B build \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_MANIFEST_DIR=$VCPKG_CONFIGS/manifest \
-DVCPKG_INSTALLED_DIR=$VCPKG_ROOT/installed \
-DVCPKG_OVERLAY_TRIPLETS=$VCPKG_CONFIGS/triplets \
-DVCPKG_TARGET_TRIPLET=x64-osx \
-DVCPKG_INSTALL_OPTIONS=--clean-after-build \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=ON \
-DGTSAM_ROT3_EXPMAP=ON \
-DGTSAM_POSE3_EXPMAP=ON \
-DGTSAM_BUILD_PYTHON=ON \
-DGTSAM_BUILD_TESTS=ON \
-DGTSAM_BUILD_UNSTABLE=ON \
-DGTSAM_USE_SYSTEM_EIGEN=ON \
-DGTSAM_USE_SYSTEM_METIS=ON \
-DGTSAM_SUPPORT_NESTED_DISSECTION=ON
- name: Cmake build
if: success()
run: |
cmake --build build --config Release -j 2
- name: Run tests
if: success()
run: |
cmake --build build --target check -j 2
97 changes: 97 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Windows
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
schedule:
- cron: '10 12 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
BUILD_DIR: gtsam\3rdparty\windows
VCPKG_LINK: https://github.com/microsoft/vcpkg/
VCPKG_CONFIGS: gtsam\3rdparty\vcpkg
BINARY_CACHE: gtsam\3rdparty\buildCache\windows

jobs:
build:
name: vcpkg-windows
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
gtsam\3rdparty\buildCache\windows
key: windows-${{ hashFiles('.github/workflows/windows.yml') }}

- name: Setup msbuild
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Install python packages
if: success()
shell: cmd
run: |
choco install python311
c:\python311\python.exe -m pip install pyparsing
- name: Fix vcpkg
run: vcpkg.exe integrate remove

- name: Init vcpkg
if: success()
shell: cmd
run: |
mkdir -p %BUILD_DIR%
git -C %BUILD_DIR% clone %VCPKG_LINK%
- name: Vcpkg build & cmake config
if: success()
shell: cmd
run: |
set VCPKG_ROOT=gtsam\3rdparty\windows\vcpkg
choco install ninja
ninja --version
set VCPKG_BINARY_SOURCES=clear;files,%CD%\%BINARY_CACHE%,readwrite;
mkdir %BINARY_CACHE%
set CMAKE_GENERATOR=Ninja
cmake . -B build ^
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake ^
-DVCPKG_MANIFEST_DIR=%VCPKG_CONFIGS%\manifest ^
-DVCPKG_INSTALLED_DIR=%VCPKG_ROOT%\installed ^
-DVCPKG_OVERLAY_TRIPLETS=%VCPKG_CONFIGS%\triplets ^
-DVCPKG_TARGET_TRIPLET=x64-windows ^
-DVCPKG_INSTALL_OPTIONS=--clean-after-build ^
-DGTSAM_BUILD_EXAMPLES_ALWAYS=ON ^
-DGTSAM_ROT3_EXPMAP=ON ^
-DGTSAM_POSE3_EXPMAP=ON ^
-DGTSAM_BUILD_PYTHON=OFF ^
-DGTSAM_BUILD_TESTS=ON ^
-DGTSAM_BUILD_UNSTABLE=OFF ^
-DGTSAM_USE_SYSTEM_EIGEN=ON ^
-DGTSAM_USE_SYSTEM_METIS=ON ^
-DGTSAM_SUPPORT_NESTED_DISSECTION=ON
- name: Cmake build
if: success()
shell: cmd
run: |
cmake --build build --config Release -j 2
- name: Run tests
if: success()
shell: cmd
run: |
:: Tests don't compile for windows. Need to be fixed and can remove these comments.
:: cmake --build build --target check -j 1
Loading

0 comments on commit 2980ce1

Please sign in to comment.