Files
computer-playbook/.github/workflows/test-deploy-local.yml
T
kevinveenbirkenbachandClaude Opus 4.7 915c7d4894 ci(workflows): enable pip cache and pin python 3.12 everywhere
Adds cache: pip + cache-dependency-path: pyproject.toml to every
setup-python step across .github/workflows/ and bumps the python-version
pin on every workflow that still declared 3.11 to 3.12 so the project's
declared >=3.11 range collapses to a single interpreter version in CI.

Cold runs hit pyproject.toml-keyed pip cache; subsequent runs skip the
full install pull and warm-restore in seconds. Highest impact on the
test-deploy-* and test-code-* matrices that ran make install fresh on
every PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 21:06:34 +02:00

143 lines
4.3 KiB
YAML

name: "📦 Test: Deploy (local)"
on:
workflow_dispatch:
inputs:
test_deploy_type:
description: "server | universal | workstation"
required: false
default: "server"
type: string
distros:
description: "Space-separated distro list"
required: false
default: "debian"
type: string
whitelist:
description: "Optional space-separated whitelist of app ids"
required: false
type: string
default: ""
permissions:
contents: read
packages: read
# IMPORTANT:
# - For local `act`, prefer overriding via `--env`.
# - For GitHub UI dispatch, inputs are used as fallback.
env:
INFINITO_DEPLOY_TYPE: "server"
INFINITO_DISTROS: "debian"
NIX_CONFIG: ""
INFINITO_IMAGE_TAG: "latest"
INFINITO_PLAYWRIGHT_KEEP: ${{ vars.INFINITO_PLAYWRIGHT_KEEP }}
INFINITO_APP_DISCOVERY_RUNNER: host
jobs:
discover:
name: 🔎 Discover apps (local)
runs-on: ubuntu-latest
timeout-minutes: 60
outputs:
apps: ${{ steps.discover.outputs.apps }}
test_deploy_type: ${{ steps.vars.outputs.test_deploy_type }}
distros: ${{ steps.vars.outputs.distros }}
whitelist: ${{ steps.vars.outputs.whitelist }}
steps:
- uses: actions/checkout@v6
- name: Resolve effective inputs/env
id: vars
shell: bash
env:
INPUT_TEST_DEPLOY_TYPE: ${{ inputs.test_deploy_type }}
INPUT_DISTROS: ${{ inputs.distros }}
INPUT_WHITELIST: ${{ inputs.whitelist }}
run: |
set -euo pipefail
scripts/meta/resolve/input.sh
- name: Install deps (jq + envsubst)
shell: bash
run: ./scripts/install/apt.sh jq gettext-base
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install project (host venv)
shell: bash
run: make install
- name: Discover apps
id: discover
shell: bash
env:
INFINITO_WHITELIST: ${{ inputs.whitelist }}
run: ./scripts/github/resolve/output_apps.sh
deploy:
name: 🚀 Deploy ${{ needs.discover.outputs.test_deploy_type }} app (${{ matrix.apps }})
if: needs.discover.outputs.apps != '' && needs.discover.outputs.apps != '[]'
runs-on: ubuntu-latest
timeout-minutes: 360
needs: discover
strategy:
fail-fast: false
max-parallel: 1 # immer linear
matrix:
apps: ${{ fromJson(needs.discover.outputs.apps) }}
steps:
# Reclaim runner space before Docker pulls start. Deploy jobs otherwise
# compete with the default Ubuntu image payload for limited root space.
# Option rationale: docs/contributing/artefact/files/github/workflow.md
- name: 🧹 Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- uses: actions/checkout@v6
# Replace the default ~4 GB runner swap with a larger file so transient
# memory spikes (e.g. peertube plugin install, issue #162) don't trip
# the host OOM-killer. Script picks / or /mnt based on live free space.
- name: 💾 Enlarge swap space
shell: bash
run: ./scripts/github/runner/enlarge_swap.sh
- name: Install deps (jq + envsubst)
shell: bash
run: ./scripts/install/apt.sh jq gettext-base
- name: 🚀 Deploy app (same as CI logic)
shell: bash
env:
INFINITO_DEPLOY_TYPE: ${{ needs.discover.outputs.test_deploy_type }}
INFINITO_DISTROS: ${{ needs.discover.outputs.distros }}
apps: ${{ matrix.apps }}
ANSIBLE_LOG_PATH: /tmp/ansible-${{ matrix.apps }}.log
run: ./scripts/tests/deploy/ci/all.sh
- name: 📊 Role runtimes
if: always()
shell: bash
run: python3 utils/github/profile/role_summary.py /tmp/ansible-${{ matrix.apps }}.log
- name: 🩺 Dump runner state (on failure)
if: failure()
shell: bash
run: ./scripts/github/runner/dump_state.sh "post-deploy failure (${{ matrix.apps }})"