Skip to content

Commit

Permalink
Merge pull request #201 from grml/zeha/gha-run
Browse files Browse the repository at this point in the history
GHA: run grml-live in test-build workflow
  • Loading branch information
zeha authored Dec 10, 2024
2 parents 43fd61f + d5ad645 commit e717692
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 18 deletions.
60 changes: 42 additions & 18 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
schedule:
- cron: '30 3 * * 2'
- cron: "30 3 * * 2"

concurrency:
group: "${{ github.ref }}"
Expand All @@ -16,25 +16,49 @@ jobs:
fail-fast: false
matrix:
host_release:
- unstable
- trixie
- bookworm
- unstable
- trixie
- bookworm

# We want a working shell, qemu, python and docker. Specific version should not matter (much).
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- run: ./test/gha-build-deb.sh
name: "Build .deb for ${{matrix.host_release}}"
env:
HOST_RELEASE: ${{matrix.host_release}}

- name: Archive built .deb
uses: actions/upload-artifact@v4
with:
name: deb-${{matrix.host_release}}
if-no-files-found: error
path: |
*.deb
- uses: actions/checkout@v4

- run: ./test/gha-build-deb.sh
name: "Build .deb for ${{matrix.host_release}}"
env:
HOST_RELEASE: ${{matrix.host_release}}

- name: Archive built .deb
uses: actions/upload-artifact@v4
with:
name: deb-${{matrix.host_release}}
if-no-files-found: error
path: |
*.deb
build-iso:
strategy:
fail-fast: false
matrix:
host_release:
- bookworm

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: ./test/gha-build-iso.sh
name: "Build ISO on ${{matrix.host_release}}"
env:
HOST_RELEASE: ${{matrix.host_release}}

- name: Archive built ISO
uses: actions/upload-artifact@v4
with:
name: grml-live-build-result-${{matrix.host_release}}
if-no-files-found: error
path: |
results/*
30 changes: 30 additions & 0 deletions test/gha-build-iso.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Entrypoint for GitHub Actions to build an ISO with a minimal setup,
# just to validate grml-live itself.

set -euxo pipefail

cat >build-gha-ci-test-config <<EOT
---
last_release: "2024.02"
EOT

# Install as little Debian packages as possible,
# we do not want to test *Debian*.
cat > etc/grml/fai/config/package_config/GRML_GHACI <<EOT
PACKAGES install AMD64
linux-image-amd64
PACKAGES install ARM64
linux-image-arm64
EOT

# Note: file ownership inside docker is "wrong", and then git will fail.
# As a workaround we set safe.directory to ignore the ownership issues.

docker run -i --rm --volume "${PWD}:/source" -e SKIP_SOURCES=1 -e DO_DAILY_UPLOAD=0 -w /source debian:"$HOST_RELEASE" bash -c \
"apt-get update -qq && apt-get satisfy -q -y --no-install-recommends 'git, ca-certificates' && git config --global --add safe.directory /source && /source/build-driver/build /source daily /source/build-gha-ci-test-config ghaci amd64 testing"

sudo chmod -R a+rX results

0 comments on commit e717692

Please sign in to comment.