mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-11 21:26:44 +00:00
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
122 lines
3.2 KiB
YAML
122 lines
3.2 KiB
YAML
name: "💬 Test: DNS"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
distros:
|
|
description: "Space-separated distro list (e.g. 'arch debian ubuntu')"
|
|
required: false
|
|
default: "debian"
|
|
type: string
|
|
|
|
workflow_call:
|
|
inputs:
|
|
distros:
|
|
description: "Space-separated distro list"
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
|
|
env:
|
|
INFINITO_IMAGE_TAG: ci-${{ github.sha }}
|
|
|
|
jobs:
|
|
prepare:
|
|
name: 🧮 Build matrix
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.out.outputs.matrix }}
|
|
owner: ${{ steps.vars.outputs.owner }}
|
|
repo_name: ${{ steps.vars.outputs.repo_name }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Resolve image coordinates
|
|
id: vars
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
owner="$(scripts/meta/resolve/repository/owner.sh)"
|
|
repo_name="${{ github.repository }}"
|
|
repo_name="${repo_name#*/}"
|
|
repo_name="${repo_name,,}"
|
|
echo "owner=${owner}" >> "$GITHUB_OUTPUT"
|
|
echo "repo_name=${repo_name}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: 📦 Install jq
|
|
shell: bash
|
|
run: ./scripts/install/apt.sh jq
|
|
|
|
- name: Compute matrix JSON
|
|
id: out
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
distros="${{ inputs.distros }}"
|
|
json="$(scripts/github/runner/distros_matrix.sh "${distros:-debian}")"
|
|
echo "matrix=${json}" >> "$GITHUB_OUTPUT"
|
|
echo "Using matrix: ${json}"
|
|
|
|
dns:
|
|
name: 🌐 DNS (${{ matrix.distro }})
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
needs: prepare
|
|
env:
|
|
NIX_CONFIG: |
|
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
|
INFINITO_IMAGE_TAG: ci-${{ github.sha }}
|
|
# Use the prebuilt CI image directly instead of the :latest fallback from env/all.sh.
|
|
INFINITO_IMAGE: ghcr.io/${{ needs.prepare.outputs.owner }}/${{ needs.prepare.outputs.repo_name }}/${{ matrix.distro }}:ci-${{ github.sha }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
distro: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install dnsutils (dig)
|
|
shell: bash
|
|
run: ./scripts/install/apt.sh dnsutils
|
|
|
|
- name: Start stack (coredns + infinito) for distro
|
|
shell: bash
|
|
env:
|
|
INFINITO_DISTRO: ${{ matrix.distro }}
|
|
run: |
|
|
set -euo pipefail
|
|
make compose-up
|
|
|
|
- name: DNS test suite
|
|
shell: bash
|
|
env:
|
|
INFINITO_DISTRO: ${{ matrix.distro }}
|
|
run: |
|
|
set -euo pipefail
|
|
scripts/tests/dns.sh
|
|
|
|
- name: Dump CoreDNS logs on failure
|
|
if: failure()
|
|
shell: bash
|
|
run: |
|
|
docker ps -a || true
|
|
docker logs infinito-coredns --tail=200 || true
|
|
|
|
- name: Dump infinito logs on failure
|
|
if: failure()
|
|
shell: bash
|
|
env:
|
|
INFINITO_DISTRO: ${{ matrix.distro }}
|
|
run: |
|
|
set -euo pipefail
|
|
# shellcheck source=scripts/meta/env/load.sh
|
|
source scripts/meta/env/load.sh
|
|
docker logs "${INFINITO_CONTAINER}" --tail=200 || true
|