Files
wibosim/.github/workflows/ci.yml
T
db9979andClaude Opus 5.5 4df0926455 0.92.0: Stufen 1–10, Aufgaben passend zu Wochenende und Feiertagen, Diagnose-Export
- CI rot behoben: Freundes-Vorschläge ohne Gleichstand (häufige Gegner vor Clan-Mitgliedern), Test war zufallsabhängig
- Firmware-Workflows: pio über den PATH aufrufen (pipx legt es auf GitHub-Rechnern nicht nach ~/.local/bin)
- Changelog 0.92.0, Version

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018i4GUhQVoPUusUzxgxLWkK
2026-12-06 09:20:27 +00:00

116 lines
4.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: npm
cache-dependency-path: server/package-lock.json
- run: npm ci
- run: npm test
smoke:
# Browser-Smoketest (scripts/smoke.mjs): eigener Job, läuft parallel zu „test“ und bremst ihn nicht.
# Playwright ist kein Teil der Abhängigkeiten – hier nur für diesen Lauf installiert, Chromium wird zwischengespeichert.
runs-on: ubuntu-latest
timeout-minutes: 6
defaults:
run:
working-directory: server
env:
PLAYWRIGHT_VERSION: 1.63.0
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: npm
cache-dependency-path: server/package-lock.json
- run: npm ci
- run: npm install --no-save --no-audit --no-fund playwright@${{ env.PLAYWRIGHT_VERSION }}
- id: pwcache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ env.PLAYWRIGHT_VERSION }}-chromium-shell
- if: steps.pwcache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps --only-shell chromium
- if: steps.pwcache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- run: node scripts/smoke.mjs --shots smoke-shots
- if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: smoke-screenshots
path: server/smoke-shots
retention-days: 7
image:
# Multi-Arch-Image (amd64 + arm64 für den Raspberry Pi) nach ghcr.io – nur nach erfolgreichen Tests und Smoketest auf main/Tags
needs: [test, smoke]
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Infomonitor-Firmware (firmware/xteink-x3) bauen und ins Image legen: Web-Flasher und OTA vom eigenen Server
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.platformio
key: pio-${{ runner.os }}-6.2.0-${{ hashFiles('firmware/xteink-x3/platformio.ini') }}
- name: Firmware bauen
continue-on-error: true # ein Fehler beim Firmware-Bau darf das Spiel-Image nicht aufhalten
run: |
pipx install "platformio==6.2.0"
(cd firmware/xteink-x3 && pio run -e x3)
cp firmware/xteink-x3/dist/x3/* server/firmware/xteink-x3/
- id: built
run: echo "at=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT"
- id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,format=short
type=semver,pattern={{version}}
- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VERSION=${{ github.sha }}
BUILT_AT=${{ steps.built.outputs.at }}
cache-from: type=gha
cache-to: type=gha,mode=max