Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GitHub Actions ensure that cronie keeps compiling without errors on Linux (fixes #174) #175

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2024 Sebastian Pipping <[email protected]>
# Licensed under GPL v2 or later

version: 2
updates:

- package-ecosystem: "github-actions"
commit-message:
include: "scope"
prefix: "Actions"
directory: "/"
labels:
- "enhancement"
schedule:
interval: "weekly"
99 changes: 99 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Copyright (c) 2024 Sebastian Pipping <[email protected]>
# Licensed under GPL v2 or later

name: Build on Linux

on:
pull_request:
push:
schedule:
- cron: '0 3 * * 5' # Every Friday at 3am
workflow_dispatch:

# Minimum permissions for security
permissions:
contents: read

jobs:
linux:
name: Build (${{ matrix.cc }})
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- cc: gcc-13
cxx: g++-13
clang_major_version: null
clang_repo_suffix: null
runs-on: ubuntu-22.04
- cc: clang-17
cxx: clang++-17
clang_major_version: 17
clang_repo_suffix: -17
runs-on: ubuntu-22.04
steps:
- name: Checkout Git branch
uses: actions/checkout@v4

- name: Add Clang/LLVM repositories
if: "${{ contains(matrix.cc, 'clang') }}"
run: |-
set -x
source /etc/os-release
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http:https://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}${{ matrix.clang_repo_suffix }} main"

- name: Install build dependencies
run: |-
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
libaudit-dev \
libpam0g-dev \
libselinux1-dev

- name: Install build dependency Clang ${{ matrix.clang_major_version }}
if: "${{ contains(matrix.cc, 'clang') }}"
run: |-
sudo apt-get install --yes --no-install-recommends -V \
clang-${{ matrix.clang_major_version }}

- name: 'Bootstrap'
run: |-
./autogen.sh

- name: 'Configure'
env:
CFLAGS: '-std=gnu99 -Wall -Wextra -pedantic -O1 -pipe'
LDFLAGS: '-Wl,--as-needed'
run: |-
set -x
mkdir build
cd build
configure_args=(
# Make build logs better explain themselves
--disable-silent-rules

# Enable more optional features to increase coverage
--enable-syscrontab
--with-audit
--with-inotify
--with-pam
--with-selinux
)
../configure "${configure_args[@]}"

- name: 'Make'
run: |-
make -C build -j$(nproc)

- name: 'Install'
run: |-
set -x -o pipefail
make -C build install DESTDIR="${PWD}"/ROOT/
find ROOT/ | sort | xargs ls -ld

- name: 'Distcheck'
run: |-
set -x
make -C build distcheck