summaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:32:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:32:39 +0000
commit56ae875861ab260b80a030f50c4aff9f9dc8fff0 (patch)
tree531412110fc901a5918c7f7442202804a83cada9 /.github/workflows
parentInitial commit. (diff)
downloadicinga2-56ae875861ab260b80a030f50c4aff9f9dc8fff0.tar.xz
icinga2-56ae875861ab260b80a030f50c4aff9f9dc8fff0.zip
Adding upstream version 2.14.2.upstream/2.14.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/authors-file.yml39
-rw-r--r--.github/workflows/docker.yml37
-rwxr-xr-x.github/workflows/linux.bash95
-rw-r--r--.github/workflows/linux.yml56
-rw-r--r--.github/workflows/rpm.yml116
-rw-r--r--.github/workflows/windows.yml53
6 files changed, 396 insertions, 0 deletions
diff --git a/.github/workflows/authors-file.yml b/.github/workflows/authors-file.yml
new file mode 100644
index 0000000..3970aee
--- /dev/null
+++ b/.github/workflows/authors-file.yml
@@ -0,0 +1,39 @@
+name: AUTHORS file
+
+on:
+ pull_request: { }
+
+jobs:
+ authors-file:
+ name: AUTHORS file
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout HEAD
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Check whether ./AUTHORS is up-to-date
+ run: |
+ set -exo pipefail
+ sort -uo AUTHORS AUTHORS
+ git add AUTHORS
+ git log --format='format:%aN <%aE>' "$(
+ git merge-base "origin/$GITHUB_BASE_REF" "origin/$GITHUB_HEAD_REF"
+ )..origin/$GITHUB_HEAD_REF" >> AUTHORS
+ sort -uo AUTHORS AUTHORS
+ git diff AUTHORS >> AUTHORS.diff
+
+ - name: Complain if ./AUTHORS isn't up-to-date
+ run: |
+ if [ -s AUTHORS.diff ]; then
+ cat <<'EOF' >&2
+ There are the following new authors. If the commit author data is correct,
+ either add them to the AUTHORS file or update .mailmap. See gitmailmap(5) or:
+ https://git-scm.com/docs/gitmailmap
+ Don't hesitate to ask us for help if necessary.
+ EOF
+ cat AUTHORS.diff
+ exit 1
+ fi
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
new file mode 100644
index 0000000..dc23459
--- /dev/null
+++ b/.github/workflows/docker.yml
@@ -0,0 +1,37 @@
+name: Docker image
+
+on:
+ pull_request: {}
+ push:
+ branches:
+ - master
+ - 'support/*'
+ release:
+ types:
+ - published
+
+concurrency:
+ group: docker-${{ github.event_name == 'push' && github.sha || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ docker-release:
+ if: github.event_name == 'release'
+ concurrency: docker-release
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Docker image
+ uses: Icinga/docker-icinga2@master
+ with:
+ dockerhub-token: '${{ secrets.DOCKER_HUB_PERSONAL_TOKEN }}'
+
+ docker:
+ if: github.event_name != 'release'
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Docker image
+ uses: Icinga/docker-icinga2@master
+ with:
+ dockerhub-token: '${{ secrets.DOCKER_HUB_PERSONAL_TOKEN }}'
diff --git a/.github/workflows/linux.bash b/.github/workflows/linux.bash
new file mode 100755
index 0000000..fe0e7d5
--- /dev/null
+++ b/.github/workflows/linux.bash
@@ -0,0 +1,95 @@
+#!/bin/bash
+set -exo pipefail
+
+export PATH="/usr/lib/ccache:/usr/lib64/ccache:/opt/rh/devtoolset-11/root/usr/bin:$PATH"
+export CCACHE_DIR=/icinga2/ccache
+export CTEST_OUTPUT_ON_FAILURE=1
+CMAKE_OPTS=''
+
+case "$DISTRO" in
+ amazonlinux:2)
+ amazon-linux-extras install -y epel
+ yum install -y bison ccache cmake3 gcc-c++ flex ninja-build \
+ {libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
+
+ yum install -y bzip2 tar wget
+ wget https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.bz2
+ tar -xjf boost_1_69_0.tar.bz2
+
+ (
+ cd boost_1_69_0
+ ./bootstrap.sh --with-libraries=context,coroutine,date_time,filesystem,iostreams,program_options,regex,system,test,thread
+ ./b2
+ )
+
+ ln -vs /usr/bin/cmake3 /usr/local/bin/cmake
+ ln -vs /usr/bin/ninja-build /usr/local/bin/ninja
+ CMAKE_OPTS='-DBOOST_INCLUDEDIR=/boost_1_69_0 -DBOOST_LIBRARYDIR=/boost_1_69_0/stage/lib'
+ export LD_LIBRARY_PATH=/boost_1_69_0/stage/lib
+ ;;
+
+ amazonlinux:20*)
+ dnf install -y bison cmake flex gcc-c++ ninja-build \
+ {boost,libedit,mariadb1\*,ncurses,openssl,postgresql,systemd}-devel
+ ;;
+
+ centos:*)
+ yum install -y centos-release-scl epel-release
+ yum install -y bison ccache cmake3 devtoolset-11-gcc-c++ flex ninja-build \
+ {boost169,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
+
+ ln -vs /usr/bin/cmake3 /usr/local/bin/cmake
+ ln -vs /usr/bin/ccache /usr/lib64/ccache/g++
+ CMAKE_OPTS='-DBOOST_INCLUDEDIR=/usr/include/boost169 -DBOOST_LIBRARYDIR=/usr/lib64/boost169'
+ ;;
+
+ debian:*|ubuntu:*)
+ apt-get update
+ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-{recommends,suggests} -y bison \
+ ccache cmake flex g++ lib{boost-all,edit,mariadb,ncurses,pq,ssl,systemd}-dev ninja-build tzdata
+ ;;
+
+ fedora:*)
+ dnf install -y bison ccache cmake flex gcc-c++ ninja-build \
+ {boost,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
+ ;;
+
+ opensuse/*)
+ zypper in -y bison ccache cmake flex gcc-c++ ninja {lib{edit,mariadb,openssl},ncurses,postgresql,systemd}-devel \
+ libboost_{context,coroutine,filesystem,iostreams,program_options,regex,system,test,thread}-devel
+ ;;
+
+ rockylinux:*)
+ dnf install -y 'dnf-command(config-manager)' epel-release
+
+ case "$DISTRO" in
+ *:8)
+ dnf config-manager --enable powertools
+ ;;
+ *)
+ dnf config-manager --enable crb
+ ;;
+ esac
+
+ dnf install -y bison ccache cmake gcc-c++ flex ninja-build \
+ {boost,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
+ ;;
+esac
+
+mkdir /icinga2/build
+cd /icinga2/build
+
+cmake \
+ -GNinja \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DICINGA2_UNITY_BUILD=ON \
+ -DUSE_SYSTEMD=ON \
+ -DICINGA2_USER=$(id -un) \
+ -DICINGA2_GROUP=$(id -gn) \
+ $CMAKE_OPTS ..
+
+ninja
+
+ninja test
+ninja install
+icinga2 daemon -C
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
new file mode 100644
index 0000000..6c3c5dd
--- /dev/null
+++ b/.github/workflows/linux.yml
@@ -0,0 +1,56 @@
+name: Linux
+
+on:
+ push:
+ branches:
+ - master
+ - 'support/*'
+ pull_request: {}
+
+concurrency:
+ group: linux-${{ github.event_name == 'push' && github.sha || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ linux:
+ name: ${{ matrix.distro }}
+ runs-on: ubuntu-latest
+
+ strategy:
+ fail-fast: false
+ max-parallel: 2
+ matrix:
+ distro:
+ - amazonlinux:2
+ - amazonlinux:2023
+ - centos:7 # and RHEL 7
+ - debian:10
+ - debian:11 # and Raspbian 11
+ - debian:12 # and Raspbian 12
+ - fedora:37
+ - fedora:38
+ - fedora:39
+ - opensuse/leap:15.3 # SLES 15.3
+ - opensuse/leap:15.4 # and SLES 15.4
+ - opensuse/leap:15.5 # and SLES 15.5
+ - rockylinux:8 # RHEL 8
+ - rockylinux:9 # RHEL 9
+ - ubuntu:20.04
+ - ubuntu:22.04
+ - ubuntu:23.04
+ - ubuntu:23.10
+
+ steps:
+ - name: Checkout HEAD
+ uses: actions/checkout@v3
+
+ - name: Restore/backup ccache
+ uses: actions/cache@v3
+ with:
+ path: ccache
+ key: ccache/${{ matrix.distro }}
+
+ - name: Build
+ run: >-
+ docker run --rm -v "$(pwd):/icinga2" -e DISTRO=${{ matrix.distro }}
+ ${{ matrix.distro }} /icinga2/.github/workflows/linux.bash
diff --git a/.github/workflows/rpm.yml b/.github/workflows/rpm.yml
new file mode 100644
index 0000000..5cf8b10
--- /dev/null
+++ b/.github/workflows/rpm.yml
@@ -0,0 +1,116 @@
+name: .rpm
+
+on:
+ push:
+ branches:
+ - master
+ - 'support/*'
+ pull_request: {}
+
+concurrency:
+ group: rpm-${{ github.event_name == 'push' && github.sha || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ rpm:
+ name: .rpm (${{ matrix.distro.name }}, ${{ matrix.distro.release }})
+
+ strategy:
+ fail-fast: false
+ max-parallel: 1
+ matrix:
+ distro:
+ - name: sles
+ release: '12.5'
+ subscription: true
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Vars
+ id: vars
+ env:
+ GITLAB_RO_TOKEN: '${{ secrets.GITLAB_RO_TOKEN }}'
+ run: |
+ if [ ${{ matrix.distro.subscription }} = true ]; then
+ if [ "$(tr -d '\n' <<<"$GITLAB_RO_TOKEN" |wc -c)" -eq 0 ]; then
+ echo '::set-output name=CAN_BUILD::false'
+ echo '::set-output name=NEED_LOGIN::false'
+ else
+ echo '::set-output name=CAN_BUILD::true'
+ echo '::set-output name=NEED_LOGIN::true'
+ fi
+ else
+ echo '::set-output name=CAN_BUILD::true'
+ echo '::set-output name=NEED_LOGIN::false'
+ fi
+
+ - name: Checkout HEAD
+ if: "steps.vars.outputs.CAN_BUILD == 'true'"
+ uses: actions/checkout@v1
+
+ - name: Login
+ if: "steps.vars.outputs.NEED_LOGIN == 'true'"
+ env:
+ GITLAB_RO_TOKEN: '${{ secrets.GITLAB_RO_TOKEN }}'
+ run: |
+ docker login registry.icinga.com -u github-actions --password-stdin <<<"$GITLAB_RO_TOKEN"
+
+ - name: rpm-icinga2
+ if: "steps.vars.outputs.CAN_BUILD == 'true' && !matrix.distro.subscription"
+ run: |
+ set -exo pipefail
+ git clone https://git.icinga.com/packaging/rpm-icinga2.git
+ chmod o+w rpm-icinga2
+
+ - name: subscription-rpm-icinga2
+ if: "steps.vars.outputs.CAN_BUILD == 'true' && matrix.distro.subscription"
+ env:
+ GITLAB_RO_TOKEN: '${{ secrets.GITLAB_RO_TOKEN }}'
+ run: |
+ set -exo pipefail
+ git config --global credential.helper store
+ cat <<EOF >~/.git-credentials
+ https://github-actions:${GITLAB_RO_TOKEN}@git.icinga.com
+ EOF
+ git clone https://git.icinga.com/packaging/subscription-rpm-icinga2.git rpm-icinga2
+ chmod o+w rpm-icinga2
+
+ - name: Restore/backup ccache
+ if: "steps.vars.outputs.CAN_BUILD == 'true'"
+ id: ccache
+ uses: actions/cache@v1
+ with:
+ path: rpm-icinga2/ccache
+ key: |-
+ ${{ matrix.distro.name }}/${{ matrix.distro.release }}-ccache-${{ hashFiles('rpm-icinga2/ccache') }}
+
+ - name: Binary
+ if: "steps.vars.outputs.CAN_BUILD == 'true'"
+ run: |
+ set -exo pipefail
+ git checkout -B master
+ if [ -e rpm-icinga2/ccache ]; then
+ chmod -R o+w rpm-icinga2/ccache
+ fi
+ docker run --rm \
+ -v "$(pwd)/rpm-icinga2:/rpm-icinga2" \
+ -v "$(pwd)/.git:/icinga2.git:ro" \
+ -w /rpm-icinga2 \
+ -e ICINGA_BUILD_PROJECT=icinga2 \
+ -e ICINGA_BUILD_TYPE=snapshot \
+ -e UPSTREAM_GIT_URL=file:///icinga2.git \
+ registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.release }} \
+ icinga-build-package
+
+ - name: Test
+ if: "steps.vars.outputs.CAN_BUILD == 'true'"
+ run: |
+ set -exo pipefail
+ docker run --rm \
+ -v "$(pwd)/rpm-icinga2:/rpm-icinga2" \
+ -w /rpm-icinga2 \
+ -e ICINGA_BUILD_PROJECT=icinga2 \
+ -e ICINGA_BUILD_TYPE=snapshot \
+ registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.release }} \
+ icinga-build-test
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
new file mode 100644
index 0000000..18d8e57
--- /dev/null
+++ b/.github/workflows/windows.yml
@@ -0,0 +1,53 @@
+name: Windows
+
+on:
+ push:
+ branches:
+ - master
+ - 'support/*'
+ pull_request: {}
+
+concurrency:
+ group: windows-${{ github.event_name == 'push' && github.sha || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ windows:
+ name: Windows
+
+ strategy:
+ fail-fast: false
+ max-parallel: 1
+ matrix:
+ bits: [32, 64]
+
+ runs-on: windows-2019
+
+ env:
+ BITS: '${{ matrix.bits }}'
+ ICINGA_BUILD_TYPE: snapshot
+ UPSTREAM_GIT_URL: file://D:/a/icinga2/icinga2/.git
+
+ steps:
+ - name: Checkout HEAD
+ uses: actions/checkout@v1
+
+ - name: windows-icinga2
+ run: |
+ git clone https://git.icinga.com/packaging/windows-icinga2.git
+
+ - name: Build tools
+ run: |
+ & .\doc\win-dev.ps1
+
+ - name: Source
+ run: |
+ git checkout -B master
+ cd windows-icinga2
+ & .\source.ps1
+
+ - name: Binary
+ working-directory: windows-icinga2
+ run: |
+ New-Item -ItemType Directory -Path 'C:\Program Files\Icinga2\WillBeRemoved' -ErrorAction SilentlyContinue
+ & .\build.ps1