mirror of
https://github.com/kmod-project/kmod.git
synced 2026-01-26 07:37:54 +00:00
This concludes the files, I'm planning to reuse in usbutils so I'll stop before it gets too annoying :-D Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Link: https://github.com/kmod-project/kmod/pull/151 Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
121 lines
3.8 KiB
YAML
121 lines
3.8 KiB
YAML
# SPDX-FileCopyrightText: 2024 Emil Velikov <emil.l.velikov@gmail.com>
|
|
# SPDX-FileCopyrightText: 2024 Lucas De Marchi <lucas.de.marchi@gmail.com>
|
|
#
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
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:
|
|
fail-fast: false
|
|
matrix:
|
|
build: ['meson', 'autotools']
|
|
container:
|
|
- name: 'ubuntu:22.04'
|
|
multilib: 'true'
|
|
- name: 'ubuntu:24.04'
|
|
multilib: 'true'
|
|
- name: 'archlinux:base-devel'
|
|
multilib: 'true'
|
|
- name: 'fedora:latest'
|
|
- name: 'alpine:latest'
|
|
meson_setup: '-D docs=false'
|
|
- name: 'debian:unstable'
|
|
multilib: 'true'
|
|
|
|
container:
|
|
image: ${{ matrix.container.name }}
|
|
|
|
steps:
|
|
- name: Sparse checkout the local actions
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
with:
|
|
sparse-checkout: .github
|
|
|
|
- uses: ./.github/actions/setup-ubuntu
|
|
if: ${{ startsWith(matrix.container.name, 'ubuntu') }}
|
|
- uses: ./.github/actions/setup-archlinux
|
|
if: ${{ startsWith(matrix.container.name, 'archlinux') }}
|
|
- uses: ./.github/actions/setup-fedora
|
|
if: ${{ startsWith(matrix.container.name, 'fedora') }}
|
|
- uses: ./.github/actions/setup-alpine
|
|
if: ${{ startsWith(matrix.container.name, 'alpine') }}
|
|
- uses: ./.github/actions/setup-debian
|
|
if: ${{ startsWith(matrix.container.name, 'debian') }}
|
|
|
|
- name: Checkout the whole project
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
|
|
- name: Set the environment
|
|
run: |
|
|
# The second checkout above claims to set safe.directory, yet it
|
|
# doesn't quite work. Perhaps our double/sparse checkout is to blame?
|
|
git config --global --add safe.directory '*'
|
|
|
|
.github/print-kdir.sh >> "$GITHUB_ENV"
|
|
|
|
- name: configure (meson)
|
|
if: ${{ matrix.build == 'meson' }}
|
|
run: mkdir build && cd build && meson setup --native-file ../build-dev.ini ${{ matrix.container.meson_setup }} . ..
|
|
|
|
- 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: ${{ matrix.build == 'meson' }}
|
|
run: cd build && meson test
|
|
|
|
- name: test (autotools)
|
|
if: ${{ 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: ${{ matrix.build == 'meson' }}
|
|
run: cd build && meson dist
|
|
|
|
- name: distcheck (autotools)
|
|
if: ${{ matrix.build == 'autotools' }}
|
|
run: cd build && make distcheck
|
|
|
|
- name: configure (32bit) (meson)
|
|
if: ${{ matrix.build == 'meson' && matrix.container.multilib == 'true' }}
|
|
run: mkdir build32 && cd build32 && CC='gcc -m32' meson setup . ..
|
|
|
|
- name: build (32bit) (meson)
|
|
if: ${{ matrix.build == 'meson' && matrix.container.multilib == 'true' }}
|
|
run: cd build32 && meson compile
|
|
|
|
- name: test (32bit) (meson)
|
|
if: ${{ matrix.build == 'meson' && matrix.container.multilib == 'true' }}
|
|
run: cd build32 && meson test
|