Skip to content

Commit

Permalink
[ci/packaging] Enable GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gergondet committed Dec 2, 2019
1 parent 33f6b29 commit f3f5451
Show file tree
Hide file tree
Showing 29 changed files with 519 additions and 111 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/Tasks.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# git-build-recipe format 0.4 deb-version {debversion}+{time}+{git-commit}
https://github.com/jrl-umi3218/Tasks @REF@
run git submodule update --init
88 changes: 88 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI of Tasks

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:

clang-format:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Install clang-format-6.0
run: |
sudo apt-get -qq update
sudo apt-get -qq remove clang-6.0 libclang1-6.0 libclang-common-6.0-dev libllvm6.0
sudo apt-get -qq install clang-format-6.0 clang-format
- name: Run clang-format-check
run: |
./.clang-format-check.sh
build:
needs: clang-format
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, ubuntu-18.04, macos-latest, windows-latest]
build-type: [Debug, RelWithDebInfo]
compiler: [gcc, clang]
exclude:
# Only default compiler on macos-latest and windows-latest
- os: macos-latest
compiler: clang
- os: windows-latest
compiler: clang

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Install dependencies
uses: jrl-umi3218/github-actions/install-dependencies@master
with:
compiler: ${{ matrix.compiler }}
build-type: ${{ matrix.build-type }}
ubuntu: |
apt: cython cython3 python-nose python3-nose python-numpy python3-numpy python-coverage python3-coverage python-setuptools python3-setuptools libeigen3-dev doxygen doxygen-latex libboost-all-dev
macos: |
cask: gfortran
brew: eigen boost
pip: Cython coverage nose numpy
windows: |
pip: Cython coverage nose numpy
github:
- path: eigenteam/eigen-git-mirror
ref: 3.3.7
github: |
- path: jrl-umi3218/Eigen3ToPython
- path: jrl-umi3218/SpaceVecAlg
- path: jrl-umi3218/sch-core
- path: jrl-umi3218/eigen-qld
- path: jrl-umi3218/sch-core-python
- path: jrl-umi3218/RBDyn
- name: Build and test
uses: jrl-umi3218/github-actions/build-cmake-project@master
with:
compiler: ${{ matrix.compiler }}
build-type: ${{ matrix.build-type }}
- name: Upload documentation
# Only run on master branch and for one configuration
if: matrix.os == 'ubuntu-18.04' && matrix.build-type == 'RelWithDebInfo' && matrix.compiler == 'gcc' && github.ref == 'refs/heads/master'
uses: jrl-umi3218/github-actions/upload-documentation@master
with:
GH_USER: gergondet
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
- name: Slack Notification
if: failure()
uses: archive/github-actions-slack@master
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: '#ci'
slack-text: >
[Tasks] Build *${{ matrix.os }}/${{ matrix.build-type }}* failed on ${{ github.ref }}
148 changes: 148 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: Package Tasks

# This workflow only runs when pushing to master or pushing a tag
#
# On master, it will:
# - Build packages for selected Debian/Ubuntu distro
# - Upload the packages to https://dl.bintray.com/gergondet/multi-contact-head
#
# On tagged versions it will:
# - Create a GitHub release draft
# - Attach the sources to the release
# - Build packages for selected Debian/Ubuntu distro
# - Upload the packages to https://dl.bintray.com/gergondet/multi-contact
# - Finalize the release

on:
push:
branches:
- master
tags:
- v*

jobs:
# For a given tag vX.Y.Z, this checks:
# - set(PROJECT_VERSION X.Y.Z) in CMakeLists.txt
# - version X.Y.Z in debian/changelog
# If these checks fail, the tag is automatically deleted
#
# This job does not run on the master branch
check-tag:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
if: github.ref != 'refs/heads/master'
- name: Check version coherency
run: |
set -x
export VERSION=`echo ${{ github.ref }} | sed -e 's@refs/tags/v@@'`
echo "::set-env name=REJECTION::PROJECT_VERSION in CMakeLists.txt does not match tag"
grep -q "set(PROJECT_VERSION ${VERSION})" CMakeLists.txt
echo "::set-env name=REJECTION::Upstream version in debian/changelog does not match tag"
head -n 1 debian/changelog | grep -q "tasks (${VERSION}"
echo "::set-env name=REJECTION::"
export TAG=`echo ${{ github.ref }} | sed -e 's@refs/tags/@@'`
echo "::set-env name=RELEASE_TAG::${TAG}"
if: github.ref != 'refs/heads/master'
- name: Delete tag
run: |
set -x
curl --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X DELETE https://api.github.com/repos/${{ github.repository }}/git/${{ github.ref }}
if: failure()
- name: Notify tag deletion
uses: archive/github-actions-slack@master
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: '#ci'
slack-text: >
Tag *${{ github.ref }}* in *${{ github.repository }}* was deleted:
${{ env.REJECTION}}
if: failure()
- name: Create release
uses: jrl-umi3218/github-actions/create-release@master
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.RELEASE_TAG }}
if: github.ref != 'refs/heads/master'
# This job build binary packages for Ubuntu
build-packages:
needs: check-tag
strategy:
fail-fast: false
matrix:
dist: [xenial, bionic, focal]
arch: [i386, amd64]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Prepare recipe
run: |
set -x
cp .github/workflows/Tasks.recipe /tmp/Tasks.recipe
export REF=`echo ${{ github.ref }} | sed -e 's@refs/[a-z]*/@@'`
sed -i "s#@REF@#${REF}#" /tmp/Tasks.recipe
if [ $REF == "master" ]
then
echo "::set-env name=EXTRA_MIRROR::https://dl.bintray.com/gergondet/multi-contact-head"
else
echo "::set-env name=EXTRA_MIRROR::https://dl.bintray.com/gergondet/multi-contact-release"
fi
echo "Prepared recipe"
echo "###############"
cat /tmp/Tasks.recipe
- name: Build package
uses: jrl-umi3218/github-actions/build-package@master
with:
dist: ${{ matrix.dist }}
arch: ${{ matrix.arch }}
recipe: /tmp/Tasks.recipe
other-mirrors: ${{ env.EXTRA_MIRROR }}
other-gpg-keys: "0x892EA6EE273707C6495A6FB6220D644C64666806"
- uses: actions/upload-artifact@v1
with:
name: packages-${{ matrix.dist }}-${{ matrix.arch }}
path: /tmp/packages-${{ matrix.dist }}-${{ matrix.arch }}/
# This job upload binary packages for Ubuntu
upload-packages:
needs: build-packages
strategy:
max-parallel: 1
fail-fast: false
matrix:
dist: [xenial, bionic, focal]
arch: [i386, amd64]
runs-on: ubuntu-18.04
steps:
- name: Set upload parameters
run: |
export REF=`echo ${{ github.ref }} | sed -e 's@refs/[a-z]*/@@'`
if [ $REF == "master" ]
then
echo "::set-env name=BINTRAY_REPO::multi-contact-head"
echo "::set-env name=BINTRAY_VERSION::HEAD"
else
echo "::set-env name=BINTRAY_REPO::multi-contact-release"
echo "::set-env name=BINTRAY_VERSION::${REF}"
fi
- name: Download packages
uses: actions/download-artifact@v1
with:
name: packages-${{ matrix.dist }}-${{ matrix.arch }}
- name: Upload
uses: jrl-umi3218/github-actions/upload-package@master
with:
dist: ${{ matrix.dist }}
arch: ${{ matrix.arch }}
subject: gergondet
repo: ${{ env.BINTRAY_REPO }}
package: |
name: Tasks
desc: "Real-time contorl for kinematics tree and list of kinematics tree"
licenses: [BSD 2-Clause]
vcs_url: https://github.com/jrl-umi3218/Tasks
version: ${{ env.BINTRAY_VERSION }}
path: packages-${{ matrix.dist }}-${{ matrix.arch }}
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "cmake"]
path = cmake
url = https://github.com/jrl-umi3218/jrl-cmakemodules
[submodule ".travis"]
path = .travis
url = https://github.com/jrl-umi3218/jrl-travis
1 change: 0 additions & 1 deletion .travis
Submodule .travis deleted from 62b07d
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ Tasks
=====

[![License](https://img.shields.io/badge/License-BSD%202--Clause-green.svg)](https://opensource.org/licenses/BSD-2-Clause)
[![Build Status](https://travis-ci.org/jrl-umi3218/Tasks.svg?branch=master)](https://travis-ci.org/jrl-umi3218/Tasks)
[![AppVeyor status](https://ci.appveyor.com/api/projects/status/kteqpch13y0ac3wq/branch/master?svg=true)](https://ci.appveyor.com/project/gergondet/tasks/branch/master)
[ ![Download](https://api.bintray.com/packages/gergondet/multi-contact/Tasks%3Agergondet/images/download.svg) ](https://bintray.com/gergondet/multi-contact/Tasks%3Agergondet/_latestVersion)
[![CI](https://github.com/jrl-umi3218/Tasks/workflows/CI%20of%20Tasks/badge.svg?branch=master)](https://github.com/jrl-umi3218/Tasks/actions?query=workflow%3A%22CI+of+Tasks%22)
[![Documentation](https://img.shields.io/badge/doxygen-online-brightgreen?logo=read-the-docs&style=flat)](http://jrl-umi3218.github.io/Tasks/doxygen/HEAD/index.html)

Tasks is library for real time control of robots and kinematic trees using constrained optimization.
Expand Down Expand Up @@ -38,13 +37,21 @@ An online documentation can be found [online](https://jrl-umi3218.github.io/Task
Installing
----------

## Ubuntu LITS (14.04, 16.04, 18.04): PPA
## Ubuntu LTS (16.04, 18.04, 20.04)

Use the [multi-contact-unstable](https://launchpad.net/~pierre-gergondet+ppa/+archive/ubuntu/multi-contact-unstable) ppa:
```bash
sudo add-apt-repository ppa:pierre-gergondet+ppa/multi-contact-unstable
sudo apt-get update
sudo apt-get install libtasks-dev libtasks-qld-doc python-tasks-qld python3-tasks-qld
# Make sure you have required tools
sudo apt install apt-transport-https lsb-release ca-certificates gnupg
# Add our key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key 892EA6EE273707C6495A6FB6220D644C64666806
# Add our repository (stable versions)
sudo sh -c 'echo "deb https://dl.bintray.com/gergondet/multi-contact-release $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/multi-contact.list'
# Use this to setup the HEAD version
# sudo sh -c 'echo "deb https://dl.bintray.com/gergondet/multi-contact-head $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/multi-contact.list'
# Update packages list
sudo apt update
# Install packages
sudo apt install libtasks-dev python-tasks python3-tasks
```

## Homebrew OS X install
Expand Down
50 changes: 0 additions & 50 deletions appveyor.yml

This file was deleted.

Loading

0 comments on commit f3f5451

Please sign in to comment.