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

Migrate from Travis CI to Github workflows #196

Merged
merged 8 commits into from
Oct 8, 2020
Merged
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
48 changes: 29 additions & 19 deletions .ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,61 @@ git clone --depth 1 -b $DEPS_BRANCH https://github.com/robotology/ycm.git
cd ycm
mkdir build && cd build
cmake .. \
-G"$TRAVIS_CMAKE_GENERATOR" \
-G"$CMAKE_GENERATOR" \
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE
cmake --build . --target install

# Install Yarp
# Install YARP
cd $HOME/git
git clone --depth 1 -b $DEPS_BRANCH https://github.com/robotology/yarp.git
git clone --depth 1 https://github.com/robotology/yarp.git
cd yarp
mkdir build && cd build
cmake .. \
-G"$TRAVIS_CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE \
-DCREATE_LIB_MATH=ON
cmake --build . --config $TRAVIS_BUILD_TYPE --target install
-G"$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE
cmake --build . --config $CMAKE_BUILD_TYPE --target install

# Install icub-main
cd $HOME/git
git clone --depth 1 -b $DEPS_BRANCH https://github.com/robotology/icub-main.git
git clone --depth 1 -b $DEPS_BRANCH https://github.com/robotology/icub-main.git
cd icub-main
mkdir build && cd build
cmake .. \
-G"$TRAVIS_CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE \
-G"$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE
cmake --build . --config $TRAVIS_BUILD_TYPE --target install $CMAKE_BUILD_OPTIONS
cmake --build . --config $CMAKE_BUILD_TYPE --target install $CMAKE_BUILD_OPTIONS

# Install iDynTree
cd $HOME/git
git clone --depth 1 -b $DEPS_BRANCH https://github.com/robotology/idyntree.git
cd idyntree
mkdir build && cd build
cmake .. \
-G"$TRAVIS_CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE \
-G"$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE
cmake --build . --config $CMAKE_BUILD_TYPE --target install $CMAKE_BUILD_OPTIONS

# Install QpOASES
cd $HOME/git
git clone --depth 1 https://github.com/robotology-dependencies/qpOASES.git
cd qpOASES
mkdir build && cd build
cmake .. \
-G"$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE
cmake --build . --config $TRAVIS_BUILD_TYPE --target install $CMAKE_BUILD_OPTIONS
cmake --build . --config $CMAKE_BUILD_TYPE --target install $CMAKE_BUILD_OPTIONS

# Install BlockFactory
cd $HOME/git
git clone --depth 1 https://github.com/robotology/blockfactory
git clone --depth 1 -b $DEPS_BRANCH https://github.com/robotology/blockfactory
cd blockfactory
mkdir build && cd build
cmake .. \
-G"$TRAVIS_CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$TRAVIS_BUILD_TYPE \
-G"$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=$DEPS_CACHE
cmake --build . --config $TRAVIS_BUILD_TYPE --target install $CMAKE_BUILD_OPTIONS
cmake --build . --config $CMAKE_BUILD_TYPE --target install $CMAKE_BUILD_OPTIONS
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI

on:
push:
pull_request:

jobs:

ci:
name: '${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest

steps:

- uses: actions/checkout@master
- run: git fetch --prune --unshallow

- name: 'Ubuntu: System Dependencies'
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libace-dev libeigen3-dev libgsl-dev libedit-dev \
python3-numpy libxml2-dev coinor-libipopt-dev \
ninja-build

- name: 'MacOS: System Dependencies'
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: Install dependencies
run: |
export DEPS_CACHE=$HOME/deps
export PATH=$PATH:$DEPS_CACHE/bin
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEPS_CACHE
./.ci/install.sh || false
env:
CMAKE_GENERATOR: Ninja
CMAKE_BUILD_TYPE: Debug

- name: Build
run: |
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: Ninja
CMAKE_BUILD_TYPE: Debug
96 changes: 96 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Website

on:
push:
pull_request:
branches:
- master
- devel

jobs:
website:
name: Build and Deploy
runs-on: ubuntu-20.04

steps:

- uses: actions/checkout@master
with:
persist-credentials: false

- run: git fetch --prune --unshallow

- name: Inspect Environment
run: |
env | grep ^GITHUB
cat ${GITHUB_EVENT_PATH}

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
architecture: x64

- name: Install website dependecies
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz texlive-font-utils
pip install "tornado<6.0" mkdocs Pygments mkdocs-material

- name: Generate documentation
run: |
mkdir build
cd build
cmake .. -G"Unix Makefiles" -DWBT_BUILD_DOCS:BOOL=TRUE
make dox
make mkdocs

- name: Clone gh-pages
run: |
git ls-remote --heads --exit-code https://github.com/robotology/wb-toolbox gh-pages
git clone -b gh-pages https://github.com/robotology/wb-toolbox ${GH_PAGES_ROOTDIR}
echo "GH_PAGES_ROOTDIR=${GH_PAGES_ROOTDIR}" >> $GITHUB_ENV
env:
GH_PAGES_ROOTDIR: build/ghpages

- name: Select deploy folder [master]
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 "DEPLOY_FOLDER=${GH_PAGES_ROOTDIR}" >> $GITHUB_ENV

- name: Select deploy folder [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 "DEPLOY_FOLDER=${GH_PAGES_ROOTDIR}/devel" >> $GITHUB_ENV

- name: Prepare deploy folder
run: |
mkdir -p $DEPLOY_FOLDER
cd $GH_PAGES_ROOTDIR
touch .nojekyll
git config push.default simple

- name: Populate deploy folder
run: |
rm -rf $DEPLOY_FOLDER/mkdocs
rm -rf $DEPLOY_FOLDER/doxygen
mv $MKDOCS_INPUT_FOLDER $DEPLOY_FOLDER/mkdocs
mv $DOXYGEN_INPUT_FOLDER/html $DEPLOY_FOLDER/doxygen
env:
MKDOCS_INPUT_FOLDER: build/doc/mkdocs
DOXYGEN_INPUT_FOLDER: build/doc/doxygen

- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
if: |
github.event_name == 'push' &&
github.repository == 'robotology/wb-toolbox' &&
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/devel')
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: build/ghpages
CLEAN: true
CLEAN_EXCLUDE: '[".gitignore", ".nojekyll", "index.html"]'
Loading