name: test on: push: branches: - main - feature/** pull_request: jobs: smoke-test: # 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: - 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: | test -f docker-compose.yml test -f deploy/docker-compose.yml test -x deploy/deploy.sh - name: Runner info run: | uname -a pwd ls -la