Files
dfj 9d809309ac
Lua tests / test (push) Successful in 14s
Fetch the commit archive in CI instead of using git clone
The Gitea server currently corrupts clone/fetch pack responses with
"protocol error: bad pack header" (reproducible with a plain git clone),
which makes actions/checkout fail before any of our steps run. Download
the commit archive via the API instead (with a token, falling back to
anonymous for public repos) and extract it into the workspace.
2026-10-24 16:00:07 +02:00

34 lines
1.1 KiB
YAML

name: Lua tests
# Runs the offline test suite (Amibis/Tests/run.lua) on every push.
# workflow_dispatch also allows a manual run from the Actions tab.
on:
push:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# The server currently corrupts git clone/fetch pack responses
# ("fatal: protocol error: bad pack header"), which breaks
# actions/checkout, so fetch the commit archive from the API instead.
- name: Fetch source archive
env:
TOKEN: ${{ secrets.GITEA_TOKEN }}
URL: ${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/archive/${{ gitea.sha }}.tar.gz
run: |
if ! curl -fsSL -H "Authorization: token $TOKEN" -o "$RUNNER_TEMP/source.tar.gz" "$URL"; then
curl -fsSL -o "$RUNNER_TEMP/source.tar.gz" "$URL"
fi
tar -xzf "$RUNNER_TEMP/source.tar.gz" -C "$GITHUB_WORKSPACE" --strip-components=1
- name: Install Lua 5.4
run: |
sudo apt-get update
sudo apt-get install -y lua5.4
- name: Run offline test suite
run: lua5.4 Amibis/Tests/run.lua