Skip to content

add gcovr to coverage bundle #37

add gcovr to coverage bundle

add gcovr to coverage bundle #37

Workflow file for this run

---
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2026 SUSE LLC
#
# Author: Daniel Wagner <dwagner@suse.de>
name: "Build"
on:
push:
branches:
- main
tags:
- '*.*'
permissions:
packages: write
contents: write
jobs:
# ------------------------
# Step 1: define the matrix
# ------------------------
distro_matrix:
runs-on: ubuntu-latest
outputs:
distros: ${{ steps.set_matrix.outputs.distros }}
steps:
- name: Set matrix of distros
id: set_matrix
run: |
echo 'distros=["debian","fedora","tumbleweed","alpine"]' >> $GITHUB_OUTPUT
# ------------------------
# Step 2: Build staging images
# ------------------------
build_staging:
runs-on: ubuntu-latest
needs:
- distro_matrix
strategy:
matrix:
distro: ${{ fromJSON(needs.distro_matrix.outputs.distros) }}
name: Build staging container
steps:
- name: Check out repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Get release version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=" >> $GITHUB_ENV
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Login to ghcr.io
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build staging image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
file: staging/Dockerfile.${{ matrix.distro }}
platforms: linux/amd64
push: true
provenance: false
tags: |
ghcr.io/linux-nvme/${{ matrix.distro }}.staging:next
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/{0}.staging:main', matrix.distro) || '' }}
# ------------------------
# Step 3: Build tools using staging containers
# ------------------------
build_tools:
runs-on: ubuntu-latest
needs:
- distro_matrix
- build_staging
strategy:
matrix:
distro: ${{ fromJSON(needs.distro_matrix.outputs.distros) }}
name: Build samurai and muon
container:
image: ghcr.io/linux-nvme/${{ matrix.distro }}.staging:next
steps:
- name: Check out repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Build tools
run: scripts/build-muon.sh
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
with:
name: samu-muon-${{ matrix.distro }}
path: bin
# ------------------------
# Step 4: Deploy final containers
# ------------------------
deploy_containers:
runs-on: ubuntu-latest
needs:
- distro_matrix
- build_tools
strategy:
matrix:
distro: ${{ fromJSON(needs.distro_matrix.outputs.distros) }}
name: Deploy final containers
steps:
- name: Check out repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Get release version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=" >> $GITHUB_ENV
fi
- name: Download artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8
with:
name: samu-muon-${{ matrix.distro }}
path: bin
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Login to ghcr.io
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build final image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
context: .
file: main/Dockerfile.${{ matrix.distro }}
platforms: linux/amd64
push: true
provenance: false
tags: |
ghcr.io/linux-nvme/${{ matrix.distro }}:next
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/{0}:{1}', matrix.distro, env.RELEASE_VERSION) || '' }}
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/{0}:latest', matrix.distro) || '' }}
deploy_cross_containers:
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- armhf
- ppc64le
- s390x
name: ubuntu cross container
steps:
- name: Check out repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Get release version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=" >> $GITHUB_ENV
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Login to ghcr.io
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
file: main/Dockerfile.ubuntu.${{ matrix.arch }}
platforms: linux/amd64
push: true
provenance: false
tags: |
ghcr.io/linux-nvme/ubuntu-cross-${{ matrix.arch }}:next
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/ubuntu-cross-{0}:{1}', matrix.arch, env.RELEASE_VERSION) || '' }}
${{ env.RELEASE_VERSION && format('ghcr.io/linux-nvme/ubuntu-cross-{0}:latest', matrix.arch) || '' }}