Skip to content

Commit

Permalink
Add Windows CI (RainerKuemmerle#572)
Browse files Browse the repository at this point in the history
* Add Windows CI by github actions
  • Loading branch information
RainerKuemmerle authored Feb 21, 2022
1 parent d68c441 commit b6f7dc6
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 15 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
pull_request:
types: [ assigned, opened, synchronize, reopened ]

release:

jobs:
Expand All @@ -28,14 +28,6 @@ jobs:
build_type: "Debug",
do_coverage: "OFF",
}
#- {
#name: "Windows Latest MSVC",
#os: windows-latest,
#build_type: "Debug",
#environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
#generators: "Visual Studio 16 2019"
#do_coverage: "OFF",
#}


steps:
Expand Down Expand Up @@ -66,10 +58,6 @@ jobs:
if: runner.os == 'macOS'
run: brew install cmake eigen

#- name: Install dependencies on Windows
#if: runner.os == 'Windows'
#run: brew install cmake eigen

- name: Configure CMake
run: |
cmake --version
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: win64

on:
push:
branches:
- master
pull_request:

release:

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows 2019 MSVC",
os: windows-2019,
build_type: "Debug",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
generators: "Visual Studio 16 2019"
}


steps:
- uses: actions/checkout@v2
with:
fetch-depth: 25

- name: Print env
run: |
echo github.ref: ${{github.ref}}
echo github.event.action: ${{github.event.action}}
echo github.event_name: ${{github.event_name}}
echo runner.os: ${{runner.os}}
- name: Install libraries with vcpkg
run: |
vcpkg --triplet x64-windows install eigen3
- name: Eigen Introspection
run: |
type C:/vcpkg/packages/eigen3_x64-windows/debug/lib/pkgconfig/eigen3.pc
- name: Configure CMake
run: |
cmake --version
cmake -B ${{github.workspace}}/build -G "${{matrix.config.generators}}" -A x64 -DBUILD_UNITTESTS=ON -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
- name: Build Introspection
run: |
echo "g2o config.h"
type ${{github.workspace}}/build/g2o/config.h
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.config.build_type}} -j 2

- name: Test
run: |
cd ${{github.workspace}}/build
$Env:PATH += ";${{github.workspace}}\bin\${{matrix.config.build_type}}"
$Env:PATH += ";${{github.workspace}}\lib\${{matrix.config.build_type}}"
$Env:PATH += ";${{github.workspace}}\build\bin\${{matrix.config.build_type}}"
$Env:PATH += ";${{github.workspace}}\build\lib\${{matrix.config.build_type}}"
ctest -C ${{matrix.config.build_type}} --extra-verbose --output-on-failure
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# g2o - General Graph Optimization

Linux: [![CI](https://github.com/RainerKuemmerle/g2o/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/RainerKuemmerle/g2o/actions/workflows/ci.yml)
Windows: [![Build status](https://ci.appveyor.com/api/projects/status/9w0cpb9krc6t4nt7/branch/master?svg=true)](https://ci.appveyor.com/project/RainerKuemmerle/g2o/branch/master)
Linux/Mac: [![CI](https://github.com/RainerKuemmerle/g2o/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/RainerKuemmerle/g2o/actions/workflows/ci.yml)
Windows: [![win64](https://github.com/RainerKuemmerle/g2o/actions/workflows/windows.yml/badge.svg?event=push)](https://github.com/RainerKuemmerle/g2o/actions/workflows/windows.yml)
Windows (AppVeyor): [![Build status](https://ci.appveyor.com/api/projects/status/9w0cpb9krc6t4nt7/branch/master?svg=true)](https://ci.appveyor.com/project/RainerKuemmerle/g2o/branch/master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e87df92948b747d58591372dd425fc59)](https://app.codacy.com/manual/rainer.kuemmerle/g2o?utm_source=github.com&utm_medium=referral&utm_content=RainerKuemmerle/g2o&utm_campaign=Badge_Grade_Dashboard)

g2o is an open-source C++ framework for optimizing graph-based nonlinear error
Expand Down

0 comments on commit b6f7dc6

Please sign in to comment.