Merge pull request #9 from CESNET/devel #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and tests | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
image: ['ubuntu:18.04', 'ubuntu:19.04', 'ubuntu:20.04', 'debian:stretch', 'debian:buster', 'debian:bullseye', 'centos:7', 'centos:8', 'fedora:29', 'fedora:30', 'fedora:31'] | |
name: Build on ${{ matrix.image }} | |
container: ${{ matrix.image }} | |
steps: | |
- uses: actions/checkout@v1 | |
# Dependencies --------------------------------------------------------------------------- | |
- name: Install dependencies (Ubuntu/Debian) | |
if: startsWith(matrix.image, 'ubuntu') || startsWith(matrix.image, 'debian') | |
run: | | |
apt-get update | |
apt-get -y install git gcc g++ cmake make libxml2-dev liblz4-dev libzstd-dev | |
- name: Install dependencies (CentOS) | |
if: startsWith(matrix.image, 'centos') | |
run: | | |
yum -y install epel-release | |
yum -y install git gcc gcc-c++ cmake make libxml2-devel lz4-devel libzstd-devel | |
- name: Install depedencies (Fedora) | |
if: startsWith(matrix.image, 'fedora') | |
run: dnf -y install git gcc gcc-c++ cmake make libxml2-devel lz4-devel libzstd-devel | |
# Build ---------------------------------------------------------------------------------- | |
# Note: Unit tests are disabled on CentOS7 due to outdated GCC version | |
- name: Build the project | |
run: | | |
mkdir build && cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTS=$TESTS | |
make && make install | |
env: | |
TESTS: ${{ startsWith(matrix.image, 'centos:7') != true }} | |
- name: Run tests | |
if: startsWith(matrix.image, 'centos:7') != true | |
run: cd build && make test |