Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add Windows support and add periodic build #198

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ci/install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/bin/sh
set -e

echo "Creating $HOME/git"
mkdir $HOME/git
export CXXFLAGS="-Wno-unused-command-line-argument"

# Install YCM
echo "Moving to $HOME/git"
cd $HOME/git
echo "Running git clone --depth 1 -b $DEPS_BRANCH https://github.com/robotology/ycm.git"
git clone --depth 1 -b $DEPS_BRANCH https://github.com/robotology/ycm.git
cd ycm
mkdir build && cd build
Expand Down
67 changes: 54 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name: CI
on:
push:
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build at 2 AM UTC
- cron: '0 2 * * *'

env:
VCPKG_INSTALLATION_ROOT: C:\robotology\vcpkg

jobs:

Expand All @@ -14,6 +21,7 @@ jobs:
os:
- ubuntu-latest
- macos-latest
- windows-latest

steps:

Expand All @@ -33,19 +41,23 @@ jobs:
if: matrix.os == 'macos-latest'
run: brew install ace assimp eigen tinyxml gsl ipopt ninja

- name: Setup dependencies branch [master]
if: |
github.ref == 'refs/heads/master' ||
(github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'refs/heads/master')
run: echo "DEPS_BRANCH=master" >> $GITHUB_ENV

- name: Setup dependencies branch [other]
if: |
(github.event_name == 'push' && github.ref != 'refs/heads/master') ||
(github.event_name == 'pull_request' && github.event.pull_request.head.ref != 'refs/heads/master')
run: echo "DEPS_BRANCH=devel" >> $GITHUB_ENV
- name: 'Windows: System Dependencies'
if: contains(matrix.os, 'windows')
run: |
# To avoid spending a huge time compiling vcpkg dependencies, we download a root that comes precompiled with all the ports that we need
choco install -y wget unzip
# To avoid problems with non-relocatable packages, we unzip the archive exactly in the same C:/robotology/vcpkg
# that has been used to create the pre-compiled archive
cd C:/
wget https://github.com/robotology/robotology-superbuild-dependencies-vcpkg/releases/download/v0.6.0/vcpkg-robotology.zip
unzip vcpkg-robotology.zip -d C:/
rm vcpkg-robotology.zip

- name: Install dependencies
- name: Setup dependencies branch
run: echo "DEPS_BRANCH=master" >> $GITHUB_ENV

- name: Install dependencies (Ubuntu and macOS)
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
run: |
export DEPS_CACHE=$HOME/deps
export PATH=$PATH:$DEPS_CACHE/bin
Expand All @@ -55,7 +67,8 @@ jobs:
CMAKE_GENERATOR: Ninja
CMAKE_BUILD_TYPE: Debug

- name: Build
- name: Build (Ubuntu and macOS)
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
run: |
export DEPS_CACHE=$HOME/deps
export PATH=$PATH:$DEPS_CACHE/bin
Expand All @@ -68,3 +81,31 @@ jobs:
env:
CMAKE_GENERATOR: Ninja
CMAKE_BUILD_TYPE: Debug

- name: Install dependencies (Windows)
if: contains(matrix.os, 'windows')
shell: bash
run: |
source /c/robotology/scripts/setup-deps.sh
export DEPS_CACHE=$HOME/deps
export PATH=$PATH:$DEPS_CACHE/bin
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEPS_CACHE
bash ./.ci/install.sh || false
env:
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_BUILD_TYPE: Release

- name: Build
run: |
source /c/robotology/scripts/setup-deps.sh
export DEPS_CACHE=$HOME/deps
export PATH=$PATH:$DEPS_CACHE/bin
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEPS_CACHE
mkdir build && cd build
cmake ..\
-G"$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE
cmake --build . --config $CMAKE_BUILD_TYPE
env:
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_BUILD_TYPE: Release