Merge pull request #9668 from Icinga/gha2137

Update GHA
This commit is contained in:
Alexander Aleksandrovič Klimov 2023-02-15 11:13:16 +01:00 committed by GitHub
commit ba12f348c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 170 additions and 282 deletions

View File

@ -1,119 +0,0 @@
name: .deb
on:
push:
branches:
- master
- 'support/*'
pull_request: {}
jobs:
deb:
name: .deb
strategy:
fail-fast: false
matrix:
distro:
- name: debian
codename: bullseye
has32bit: true
- name: debian
codename: buster
has32bit: true
- name: ubuntu
codename: jammy
has32bit: false
- name: ubuntu
codename: focal
has32bit: false
runs-on: ubuntu-latest
steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout HEAD
uses: actions/checkout@v1
- name: deb-icinga2
run: |
set -exo pipefail
git clone https://git.icinga.com/packaging/deb-icinga2.git
chmod o+w deb-icinga2
- name: Source
run: |
set -exo pipefail
git checkout -B master
docker run --rm \
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
-v "$(pwd)/.git:/icinga2.git:ro" \
-w /deb-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.codename }} \
icinga-build-deb-source
- name: Restore/backup ccache
id: ccache
uses: actions/cache@v1
with:
path: deb-icinga2/ccache
key: |-
${{ matrix.distro.name }}/${{ matrix.distro.codename }}-ccache-${{ hashFiles('deb-icinga2/ccache') }}
- name: Binary x64
run: |
set -exo pipefail
if [ -e deb-icinga2/ccache ]; then
chmod -R o+w deb-icinga2/ccache
fi
docker run --rm \
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
-w /deb-icinga2 \
-e ICINGA_BUILD_PROJECT=icinga2 \
-e ICINGA_BUILD_TYPE=snapshot \
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.codename }} \
icinga-build-deb-binary
- name: Binary x86
if: matrix.distro.has32bit
run: |
set -exo pipefail
docker run --rm \
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
-w /deb-icinga2 \
-e ICINGA_BUILD_PROJECT=icinga2 \
-e ICINGA_BUILD_TYPE=snapshot \
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.codename }}:x86 \
icinga-build-deb-binary
- name: Test x64
run: |
set -exo pipefail
docker run --rm \
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
-w /deb-icinga2 \
-e ICINGA_BUILD_PROJECT=icinga2 \
-e ICINGA_BUILD_TYPE=snapshot \
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.codename }} \
icinga-build-test
- name: Test x86
if: matrix.distro.has32bit
run: |
set -exo pipefail
docker run --rm \
-v "$(pwd)/deb-icinga2:/deb-icinga2" \
-w /deb-icinga2 \
-e ICINGA_BUILD_PROJECT=icinga2 \
-e ICINGA_BUILD_TYPE=snapshot \
registry.icinga.com/build-docker/${{ matrix.distro.name }}/${{ matrix.distro.codename }}:x86 \
icinga-build-test

View File

@ -10,20 +10,28 @@ on:
types:
- published
concurrency:
group: docker-${{ github.ref }}
cancel-in-progress: true
jobs:
docker:
docker-release:
if: github.event_name == 'release'
concurrency: docker-release
runs-on: ubuntu-latest
steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Docker image
uses: Icinga/docker-icinga2@master
env:
INPUT_TOKEN: '${{ github.token }}'
DOCKER_HUB_PASSWORD: '${{ secrets.DOCKER_HUB_PERSONAL_TOKEN }}'
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 }}'

90
.github/workflows/linux.bash vendored Executable file
View File

@ -0,0 +1,90 @@
#!/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:*)
amazon-linux-extras install -y epel
yum install -y bison ccache cmake 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/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
;;
centos:*)
yum install -y centos-release-scl epel-release
yum install -y bison ccache cmake devtoolset-11-gcc-c++ flex ninja-build \
{boost169,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
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 ..
ccache -z
ninja
ccache -s
ninja test
ninja install
icinga2 daemon -C

51
.github/workflows/linux.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: Linux
on:
push:
branches:
- master
- 'support/*'
pull_request: {}
concurrency:
group: linux-${{ 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
- centos:7 # and RHEL 7
- debian:10
- debian:11 # and Raspbian 11
- fedora:36
- fedora:37
- opensuse/leap:15.3 # and SLES 15.3
- opensuse/leap:15.4 # and SLES 15.4
- rockylinux:8 # RHEL 8
- rockylinux:9 # RHEL 9
- ubuntu:20.04
- ubuntu:22.04
- ubuntu:22.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

View File

@ -1,90 +0,0 @@
name: Raspbian
on:
push:
branches:
- master
- 'support/*'
pull_request: {}
jobs:
raspbian:
name: Raspbian
strategy:
fail-fast: false
matrix:
codename:
- buster
- bullseye
runs-on: ubuntu-22.04 # revert back to ubuntu-latest once that is 22.04 or later
steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout HEAD
uses: actions/checkout@v1
- name: qemu-user-static
run: |
set -exo pipefail
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y qemu-user-static
- name: raspbian-icinga2
run: |
set -exo pipefail
git clone https://git.icinga.com/packaging/raspbian-icinga2.git
chmod o+w raspbian-icinga2
- name: Restore/backup ccache
id: ccache
uses: actions/cache@v1
with:
path: raspbian-icinga2/ccache
key: |-
raspbian/${{ matrix.codename }}-ccache-${{ hashFiles('raspbian-icinga2/ccache') }}
- name: Binary
run: |
set -exo pipefail
git checkout -B master
if [ -e raspbian-icinga2/ccache ]; then
chmod -R o+w raspbian-icinga2/ccache
fi
docker run --rm \
-v "$(pwd)/raspbian-icinga2:/raspbian-icinga2" \
-v "$(pwd)/.git:/icinga2.git:ro" \
-w /raspbian-icinga2 \
-e ICINGA_BUILD_PROJECT=icinga2 \
-e ICINGA_BUILD_TYPE=snapshot \
-e UPSTREAM_GIT_URL=file:///icinga2.git \
-e ICINGA_BUILD_DEB_DEFAULT_ARCH=armhf \
registry.icinga.com/build-docker/raspbian/${{ matrix.codename }} \
icinga-build-package
# Setting up icinga2-bin (2.12.0+rc1.25.g5d1c82a3d.20200526.0754+buster-0) ...
# enabling default icinga2 features
# qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6015c75c
# qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6015c75c
# qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x600016ea
# dpkg: error processing package icinga2-bin (--configure):
# installed icinga2-bin package post-installation script subprocess returned error exit status 127
#
# - name: Test
# run: |
# set -exo pipefail
# docker run --rm \
# -v "$(pwd)/raspbian-icinga2:/raspbian-icinga2" \
# -w /raspbian-icinga2 \
# -e ICINGA_BUILD_PROJECT=icinga2 \
# -e ICINGA_BUILD_TYPE=snapshot \
# -e ICINGA_BUILD_DEB_DEFAULT_ARCH=armhf \
# registry.icinga.com/build-docker/raspbian/${{ matrix.codename }} \
# icinga-build-test

View File

@ -7,58 +7,26 @@ on:
- 'support/*'
pull_request: {}
concurrency:
group: rpm-${{ 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: rhel
release: 8
subscription: true
- name: rhel
release: 7
subscription: true
- name: centos
release: 7
subscription: false
- name: amazon-linux
release: al2:x86_64
subscription: true
- name: fedora
release: 36
subscription: false
- name: fedora
release: 35
subscription: false
- name: sles
release: '15.4'
subscription: true
- name: sles
release: '15.3'
subscription: true
- name: sles
release: '12.5'
subscription: true
- name: opensuse
release: '15.4'
subscription: false
- name: opensuse
release: '15.3'
subscription: false
runs-on: ubuntu-latest
steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Vars
id: vars
env:

View File

@ -7,12 +7,17 @@ on:
- 'support/*'
pull_request: {}
concurrency:
group: windows-${{ github.ref }}
cancel-in-progress: true
jobs:
windows:
name: Windows
strategy:
fail-fast: false
max-parallel: 1
matrix:
bits: [32, 64]

View File

@ -362,31 +362,6 @@ The release body should contain a short changelog, with links
into the roadmap, changelog and blogpost.
## Docker <a id="docker"></a>
> Only for final versions (not for RCs).
Once the release has been published on GitHub, wait for its
[GitHub actions](https://github.com/Icinga/icinga2/actions) to complete.
```bash
VERSION=2.12.1
TAGS=(2.12)
#TAGS=(2.12 2 latest)
docker pull icinga/icinga2:$VERSION
for t in "${TAGS[@]}"; do
docker tag icinga/icinga2:$VERSION icinga/icinga2:$t
done
for t in "${TAGS[@]}"; do
docker push icinga/icinga2:$t
done
```
## Post Release <a id="post-release"></a>
### Online Documentation <a id="online-documentation"></a>