Compile and run tests for Ignition libraries.
Add the following file to an Ignition repository:
.github/workflows/ci-bionic.yml
name: Ubuntu Bionic CI
on: [push, pull_request]
jobs:
bionic-ci:
runs-on: ubuntu-latest
name: Ubuntu Bionic CI
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Bionic CI
id: ci
uses: ignition-tooling/ubuntu-bionic-ci-action@v1
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
cmake-args: '-DBUILD_TESTING=1'
Be sure to declare all apt-installable dependencies in the following files, one package per line.
.github/ci/packages.apt
: Installed for all versions..github/ci/packages-<system version>.apt
: where<system version>
can be bionic, focal, etc. Use these if you need to install different dependencies according to the distribution.
The
apt-dependencies
input is deprecated.
If you need to install dependencies from source, add a Vcstool yaml file to:
.github/ci/dependencies.yaml
: Installed for all versions.github/ci-<system version>/dependencies.yaml
: where<system version>
can be bionic, focal, etc. Use these if you need to install different dependencies according to the distribution.
Dependencies will be built using colcon
. Be sure to add the apt dependencies
of dependencies build from source to apt-dependencies
.
Create a secret on the repository with Codecov's token, called CODECOV_TOKEN
.
You can add optional scripts to be run at specific times of the build. They can
be either in .github/ci
or /github/ci-<system version>
as needed.
before_cmake.sh
: Runs before thecmake
callbetween_cmake_make.sh
: Runs after thecmake
and beforemake
after_make.sh
: Runs aftermake
and beforemake test
after_make_test.sh
: Runs aftermake test
All scripts are sourced inside the build folder. Be sure to move back to the build folder before exiting the script.
The cmake-args
can be used to pass additional CMake arguments to the build.
If building with codecov is enabled, it is not possible to override the build type,
which will always be CMAKE_BUILD_TYPE=coverage
.