Revamp the docs, build with meson and in CI #103
Workflow file for this run
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 Test | |
on: | |
push: | |
branches: [master, ci-test] | |
pull_request: | |
branches: [master] | |
schedule: | |
- cron: "30 2 * * 0" | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
container: | |
- 'ubuntu:22.04' | |
- 'ubuntu:24.04' | |
- 'archlinux:base-devel' | |
- 'fedora:latest' | |
- 'alpine:latest' | |
- 'debian:unstable' | |
build: | |
- 'meson' | |
- 'autotools' | |
container: | |
image: ${{ matrix.container }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
sparse-checkout: .github | |
- uses: ./.github/actions/setup-ubuntu | |
if: ${{ startsWith(matrix.container, 'ubuntu') }} | |
- uses: ./.github/actions/setup-archlinux | |
if: ${{ startsWith(matrix.container, 'archlinux') }} | |
- uses: ./.github/actions/setup-fedora | |
if: ${{ startsWith(matrix.container, 'fedora') }} | |
- uses: ./.github/actions/setup-alpine | |
if: ${{ startsWith(matrix.container, 'alpine') }} | |
- uses: ./.github/actions/setup-debian | |
if: ${{ startsWith(matrix.container, 'debian') }} | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set the environment | |
run: | | |
git config --global --add safe.directory '*' | |
for moddir in /usr/lib/modules /lib/modules; do | |
if [ -e "$moddir" ]; then | |
kernel=$(find "$moddir" -maxdepth 1 -mindepth 1 -type d -exec basename {} \;) | |
break | |
fi | |
done | |
# There should be one entry - the kernel we installed | |
if [ $(echo "$kernel" | wc -l) -ne 1 ]; then | |
echo >&2 "Error: exactly one kernel must be installed" | |
fi | |
echo "KDIR=$moddir/$kernel/build" >> "$GITHUB_ENV" | |
if [ ${{ startsWith(matrix.container, 'alpine') }} == 'true' ]; then | |
echo "test=false" >> "$GITHUB_ENV" | |
else | |
echo "test=true" >> "$GITHUB_ENV" | |
fi | |
- name: configure (meson) | |
if: ${{ matrix.build == 'meson' }} | |
run: mkdir build && cd build && ../meson.sh c -D build-tests=$test | |
- name: configure (autotools) | |
if: ${{ matrix.build == 'autotools' }} | |
run: mkdir build && cd build && ../autogen.sh c | |
- name: build (meson) | |
if: ${{ matrix.build == 'meson' }} | |
run: cd build && meson compile | |
- name: build (autotools) | |
if: ${{ matrix.build == 'autotools' }} | |
run: cd build && make -j$(nproc) | |
- name: test (meson) | |
if: ${{ env.test == 'true' && matrix.build == 'meson' }} | |
run: cd build && meson test | |
- name: test (autotools) | |
if: ${{ env.test == 'true' && matrix.build == 'autotools' }} | |
run: cd build && make -j$(nproc) check | |
- name: install (meson) | |
if: ${{ matrix.build == 'meson' }} | |
run: cd build && DESTDIR=$PWD/inst meson install | |
- name: install (autotools) | |
if: ${{ matrix.build == 'autotools' }} | |
run: cd build && DESTDIR=$PWD/inst make install | |
- name: distcheck (meson) | |
if: ${{ env.test == 'true' && matrix.build == 'meson' }} | |
run: cd build && meson dist | |
- name: distheck (autotools) | |
if: ${{ env.test == 'true' && matrix.build == 'autotools' }} | |
run: cd build && make distcheck |