From: Emma Foley Date: Mon, 4 Oct 2021 09:32:28 +0000 (+0100) Subject: Replace travis CI with GHA (#3913) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60d57ca5238ef26acd47a3a9530e4ae16a9dfc99;p=thirdparty%2Fcollectd.git Replace travis CI with GHA (#3913) * [githubactions] Use collectd-ci container to run tests Uses containers for collectd provided by collectd/ci-docker [1] Repeats what travis was using for building collectd * checks out branch * installs dependencies (already in containers) * runs the script commands from travis (pkg-config, confgure, make) [1] https://github.com/collectd/ci-docker [githubactions] Add config flags to builds * [githubactions] Add a job for experimental OSes * [GHA] update actions for new distro containers in collectd/ci-docker * Mark ``make check`` as optional for now it is not passing reliably, and is being marked as optional until it is Co-authored-by: BarometerExperimental --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30c3de27f..f544465e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,21 +6,105 @@ on: pull_request: branches: [ main ] +defaults: + run: + shell: bash + jobs: build: - runs-on: ubuntu-latest - + container: collectd/ci:${{ matrix.container_tag }} + continue-on-error: ${{ matrix.allow_failures }} + strategy: + fail-fast: false + matrix: + # for tasks that are optional, use the continue-on-error option, to prevent a workflow from failing when the task fails + allow_failures: [ false ] + container_tag: + # debian family + - bullseye_amd64 + - buster_amd64 + - stretch_amd64 + - stretch_i386 + - trusty_amd64 + - xenial_amd64 + # RedHat family + - el8_x86_64 + - el7_x86_64 + - fedora34_x86_64 + - fedora28_x86_64 + config_flags: [''] + env: + MAKEFLAGS: "-j 2" + CONFIGURE_FLAGS: ${{ matrix.config_flags }} steps: - uses: actions/checkout@v2 + - run: type pkg-config + - run: pkg-config --list-all | sort -u - name: Generate configure script run: ./build.sh - name: configure - run: ./configure + run: ./configure $CONFIGURE_FLAGS + - name: Make + run: make + - name: make check + continue-on-error: true + run: make check + - name: install bzip2 + continue-on-error: true + run: | + yum install -y bzip2 || apt install -y bzip2 - name: make + continue-on-error: true + run: | + make distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-dependency-tracking --enable-debug" + + experimental: + runs-on: ubuntu-20.04 + container: collectd/ci:${{ matrix.container_tag }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + # for tasks that are optional, use the continue-on-error option, to prevent a workflow from failing when the task fails + container_tag: + - sid_amd64 + - fedora_rawhide_x86_64 + # Add additional per-distro vars here. + include: + - container_tag: sid_amd64 + config_flags: "--disable-dpdkstat --disable-dpdkevents --disable-virt" + - container_tag: fedora_rawhide_x86_64 + cflags: "-fPIE -Wno-deprecated-declarations" + cppflags: "-fPIE -Wno-deprecated-declarations" + config_flags: "--disable-dpdkstat --disable-dpdkevents --disable-virt --disable-xmms" + env: + MAKEFLAGS: "-j 2" + CFLAGS: ${{ matrix.cflags }} + CPPFLAGS: ${{ matrix.cppflags }} + CONFIGURE_FLAGS: ${{ matrix.config_flags }} + steps: + - uses: actions/checkout@v2 + - run: type pkg-config + - run: pkg-config --list-all | sort -u + - name: Generate configure script + run: + ./build.sh + - name: configure + run: ./configure $CONFIGURE_FLAGS + - name: Make run: make - name: make check + # Make check is failing on a few newer distros, temporarily mark it as optional until that is resolved + continue-on-error: true run: make check + - name: install bzip2 + continue-on-error: true + run: | + yum install -y bzip2 || apt install -y bzip2 - name: make distcheck - run: make distcheck + continue-on-error: true + run: | + make distcheck DISTCHECK_CONFIGURE_FLAGS="--disable-dependency-tracking --enable-debug" +