Files
mpq-packager/.gitea/workflows/ci.yml
T
paste c615a5fb92
CI / build-and-smoke (push) Failing after 36s
CI: clone manually with /git base instead of actions/checkout
The instance generates clone URLs without its /git subpath, so
actions/checkout 404s. Manual clone against the correct base is the
reliable workaround until the server ROOT_URL is corrected.
2026-06-25 22:43:42 -05:00

51 lines
1.9 KiB
YAML

# CI for the packager itself: build the Docker image and smoke-test that it
# produces a non-empty patch-Z.mpq from the test fixture.
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
build-and-smoke:
runs-on: ubuntu-latest
steps:
# octowow.st is served under /git, but Gitea generates clone URLs without
# it (ROOT_URL/proxy misconfig), so actions/checkout 404s. Clone manually
# against the correct base. Remove once the server ROOT_URL is fixed.
- name: Checkout
run: |
git init -q .
git remote add origin "https://gitea:${{ secrets.GITHUB_TOKEN }}@octowow.st/git/${{ github.repository }}.git"
git fetch -q --depth 1 origin "${{ github.ref }}"
git checkout -q FETCH_HEAD
- name: Build image
run: docker build -t mpq-packager:ci .
- name: Package the fixture
run: |
set -euo pipefail
docker run --rm \
-e INPUT_MANIFEST=mpq.yaml \
-e INPUT_VERSION=v0.0.0-ci \
-e INPUT_OUT_DIR=/work/dist \
-e GITHUB_WORKSPACE=/work \
-v "$PWD/test:/work" \
mpq-packager:ci
- name: Assert archive is valid and contains the expected file
run: |
set -euo pipefail
test -s test/dist/patch-Z.mpq
echo "size: $(stat -c%s test/dist/patch-Z.mpq) bytes"
# Read the archive back with StormLib (mpqpack --list/--cat).
docker run --rm --entrypoint mpqpack -v "$PWD/test:/work" mpq-packager:ci \
--list /work/dist/patch-Z.mpq | tee /tmp/list.txt
grep -q 'Interface\\AddOns\\Fixture\\Hello.lua' /tmp/list.txt
docker run --rm --entrypoint mpqpack -v "$PWD/test:/work" mpq-packager:ci \
--cat /work/dist/patch-Z.mpq 'Interface\AddOns\Fixture\Hello.lua' \
| grep -q 'VERSION = "v0.0.0-ci"'
echo "OK: archive valid, path + substitution confirmed"