fix test workflow
All checks were successful
deploy / deploy (push) Successful in 11s
test / smoke-test (push) Successful in 8s

This commit is contained in:
Dusan Vojacek
2026-04-05 18:29:25 +02:00
parent 679777d140
commit caf3f522e2
2 changed files with 22 additions and 4 deletions

View File

@@ -9,11 +9,29 @@ on:
jobs:
smoke-test:
# Stejný label jako deploy.yml — výchozí act_runner má typicky jen `self-hosted`,
# ne `ubuntu-latest` (ten by vyžadoval GITEA_RUNNER_LABELS s docker:// image).
# Stejný label jako deploy.yml — výchozí act_runner má typicky jen `self-hosted`.
runs-on: self-hosted
# Výchozí job image často nemá Node → `actions/checkout@v4` padá na „Cannot find: node“.
# alpine/git je malý a stačí na shallow clone přes token (Gitea = GitHub-kompatibilní kontext).
container:
image: alpine/git:latest
steps:
- uses: actions/checkout@v4
- name: Checkout
env:
TOKEN: ${{ github.token }}
run: |
set -eu
su="${{ github.server_url }}"
case "$su" in
https://*) clone_url="https://oauth2:${TOKEN}@${su#https://}" ;;
http://*) clone_url="http://oauth2:${TOKEN}@${su#http://}" ;;
*) echo "unknown github.server_url: $su"; exit 1 ;;
esac
clone_url="${clone_url}/${{ github.repository }}.git"
git init
git remote add origin "$clone_url"
git fetch --depth=1 origin "${{ github.sha }}"
git checkout -qf FETCH_HEAD
- name: Repo layout
run: |

View File

@@ -127,7 +127,7 @@ Produkční compose mapuje frontend na **`127.0.0.1:8080`**, backend na **`127.0
| Workflow | Účel | Poznámka |
|----------|------|----------|
| `.gitea/workflows/test.yml` | Smoke (soubory, layout) | `runs-on: self-hosted` — stejný runner jako deploy; bez extra labelu `ubuntu-latest` na act_runneru by job s `ubuntu-latest` nikdy nenašel runnera. |
| `.gitea/workflows/test.yml` | Smoke (soubory, layout) | `runs-on: self-hosted` + job `container: alpine/git` a checkout přes `git fetch` (ne `actions/checkout@v4` — ta potřebuje **Node** v job kontejneru, výchozí image act_runneru ho nemá → „Cannot find: node in PATH“). |
| `.gitea/workflows/deploy.yml` | Deploy po pushi na `main` | Job kontejner + mounty + viz sekce 5. |
`workflow_dispatch` na deploy umožňuje ruční opakování bez prázdného commitu.