Skip to content

Add baseline .gitignore hygiene block #34

Add baseline .gitignore hygiene block

Add baseline .gitignore hygiene block #34

name: Determinism Check
on:
push:
pull_request:
jobs:
determinism:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare temp workdir (no workspace writes)
shell: bash
run: |
set -euo pipefail
TMPDIR="$(mktemp -d "${RUNNER_TEMP:-/tmp}/archicustos-work-XXXXXXXX")"
echo "TMPDIR=$TMPDIR" >> "$GITHUB_ENV"
WORK="$TMPDIR/work"
mkdir -p "$WORK"
rsync -a --exclude ".git" . "$WORK"/
echo "WORK=$WORK" >> "$GITHUB_ENV"
- name: Test empty stdin → deterministic INVALID
shell: bash
run: |
set -euo pipefail
cd "$WORK"
chmod +x ./archicustos.sh
EXIT_CODE=0
./archicustos.sh < /dev/null > output.txt 2>&1 || EXIT_CODE=$?
if [ "$EXIT_CODE" -eq 0 ]; then
echo "FAIL: Empty stdin should not succeed"
exit 1
fi
echo "PASS: Empty stdin rejected with exit code $EXIT_CODE"
- name: Test determinism (run twice)
shell: bash
run: |
set -euo pipefail
cd "$WORK"
chmod +x ./archicustos.sh
echo "test input" | ./archicustos.sh > output1.txt 2>&1 || true
echo $? > exit1.txt
echo "test input" | ./archicustos.sh > output2.txt 2>&1 || true
echo $? > exit2.txt
diff output1.txt output2.txt
diff exit1.txt exit2.txt
echo "PASS: determinism verified"
- name: Test no state mutation
shell: bash
run: |
set -euo pipefail
TMP="$(mktemp -d "${RUNNER_TEMP:-/tmp}/archicustos-mut-XXXXXXXX")"
cp -f "$WORK/archicustos.sh" "$TMP/"
cd "$TMP"
chmod +x ./archicustos.sh
BEFORE="$(mktemp)"; AFTER="$(mktemp)"
find . -maxdepth 1 -type f | LC_ALL=C sort >"$BEFORE"
echo "test input" | ./archicustos.sh >/dev/null 2>&1 || true
find . -maxdepth 1 -type f | LC_ALL=C sort >"$AFTER"
diff "$BEFORE" "$AFTER"
echo "PASS: no state mutation"
- name: Test env isolation
shell: bash
run: |
set -euo pipefail
cd "$WORK"
chmod +x ./archicustos.sh
env | LC_ALL=C sort > env_before.txt
echo "test input" | ./archicustos.sh >/dev/null 2>&1 || true
env | LC_ALL=C sort > env_after.txt
diff env_before.txt env_after.txt
echo "PASS: no env mutation"
version-lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify VERSION is locked at v0.0.0
shell: bash
run: |
set -euo pipefail
VERSION="$(head -1 VERSION)"
test "$VERSION" = "v0.0.0"
echo "PASS: VERSION locked at v0.0.0"