diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 508b8e0..70a6164 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,17 +1,24 @@ -{ - "name": "pull-request", - "on": { - "push": { "branches": "main" }, - "pull_request": { "branches": "main" }, - }, - "jobs": { - "linux": { - "runs-on": "ubuntu-latest", - "container": "vathpela/efi-ci:f36-x64", - "steps": [ - { "uses": "actions/checkout@v2" }, - { "run": "meson build && ninja -C build" }, - ], - }, - }, -} +name: Build and Test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + matrix: + distro: + - fedora + - debian + fail-fast: false + steps: + - uses: actions/checkout@v4 + - run: docker build -t efibootmgr-${{ matrix.distro }} -f ci/Dockerfile-${{ matrix.distro }} . + - run: docker run -t -v `pwd`:/build efibootmgr-${{ matrix.distro }} ./ci/build-${{ matrix.distro }}.sh diff --git a/ci/Dockerfile-debian b/ci/Dockerfile-debian new file mode 100644 index 0000000..7d652d3 --- /dev/null +++ b/ci/Dockerfile-debian @@ -0,0 +1,4 @@ +FROM debian:unstable +RUN apt-get update -qq +RUN apt-get install -yq --no-install-recommends meson ninja-build pkg-config libefivar-dev +WORKDIR /build diff --git a/ci/Dockerfile-fedora b/ci/Dockerfile-fedora new file mode 100644 index 0000000..482f9fb --- /dev/null +++ b/ci/Dockerfile-fedora @@ -0,0 +1,3 @@ +FROM fedora:40 +RUN dnf -y install meson gcc redhat-rpm-config efivar-devel +WORKDIR /build diff --git a/ci/build-debian.sh b/ci/build-debian.sh new file mode 120000 index 0000000..a03d22e --- /dev/null +++ b/ci/build-debian.sh @@ -0,0 +1 @@ +build-fedora.sh \ No newline at end of file diff --git a/ci/build-fedora.sh b/ci/build-fedora.sh new file mode 100755 index 0000000..20d94ff --- /dev/null +++ b/ci/build-fedora.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +export LC_ALL=C.UTF-8 +mkdir -p build && cd build +rm -rf * +meson .. +ninja -v || bash +ninja test -v +DESTDIR=/tmp/install-ninja ninja install +cd ..