Skip to content

selftest: Let job ids name the checks #15

selftest: Let job ids name the checks

selftest: Let job ids name the checks #15

Workflow file for this run

name: Selftest
# Exercises dkms-build.yml against the fixtures on this repo's
# selftest/* branches and asserts the artifact sets: a plain version on
# selftest/upstream + selftest/recipe, a semver pre-release on the
# selftest/*-pre pair. Sign and publish have no selftest.
#
# Also replays dkms-version-guard.yml over scratch repo fixtures, see
# tests/version-guard-cases.sh.
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
uses: ./.github/workflows/dkms-build.yml
with:
# Fixture branches pair like a caller's main and debian/latest.
# Repos default to the caller, this repo, so the selftest depends
# on no external state.
recipe-ref: selftest/recipe
upstream-ref: selftest/upstream
# Pre-release form: hyphen semver in dkms.conf, tilde in the recipe.
build-pre:
uses: ./.github/workflows/dkms-build.yml
with:
recipe-ref: selftest/recipe-pre
upstream-ref: selftest/upstream-pre
version-guard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Replay guard cases
run: bash tests/version-guard-cases.sh
assert:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.build.outputs.artifact }}
path: artifacts/
- name: Check expected build products
run: |
set -euo pipefail
cd artifacts
ls -la
ok=1
for pattern in '*.deb' '*.dsc' '*.orig.tar.gz' '*.changes' '*.buildinfo'; do
# shellcheck disable=SC2086
set -- $pattern
[ -e "$1" ] || { echo "::error::Missing ${pattern}."; ok=0; }
done
[ "$ok" -eq 1 ]
echo "OK: full artifact set present."
assert-pre:
needs: build-pre
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ needs.build-pre.outputs.artifact }}
path: artifacts/
- name: Check expected build products
run: |
set -euo pipefail
cd artifacts
ls -la
ok=1
for pattern in '*~*.deb' '*.dsc' '*.orig.tar.gz' '*.changes' '*.buildinfo'; do
# shellcheck disable=SC2086
set -- $pattern
[ -e "$1" ] || { echo "::error::Missing ${pattern}."; ok=0; }
done
[ "$ok" -eq 1 ]
echo "OK: full pre-release artifact set present, tilde in .deb name."