Files
univTypes/.gitea/workflows/typecheck.yml
T
JKFandClaude Opus 5.5 ad545360a3
Typecheck / agda (push) Successful in 1m3s
CI: fix Agda binary path and set Agda_datadir
The release tarball unpacks to Agda-<version>/{bin,data}, and the binary
needs Agda_datadir to find its primitive modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 19:10:47 +01:00

64 lines
2.6 KiB
YAML

name: Typecheck
on:
push:
pull_request:
jobs:
agda:
runs-on: ubuntu-latest
env:
AGDA_VERSION: v2.7.0.1
STDLIB_VERSION: v2.2
steps:
# The modules are named `univTypes.…` and there is no .agda-lib,
# so the checkout directory must be called `univTypes`.
- uses: actions/checkout@v4
with:
path: univTypes
- name: Cache Agda and stdlib (incl. its interface files)
uses: actions/cache@v4
with:
path: |
~/agda-bin
~/stdlib
key: agda-${{ env.AGDA_VERSION }}-stdlib-${{ env.STDLIB_VERSION }}
- name: Install Agda and stdlib
run: |
# The release tarball contains Agda-<version>/{bin,data}.
if [ ! -x ~/agda-bin/bin/agda ]; then
mkdir -p ~/agda-bin
curl -fsSL "https://github.com/agda/agda/releases/download/${AGDA_VERSION}/Agda-${AGDA_VERSION}-linux.tar.xz" \
| tar xJ -C ~/agda-bin --strip-components=1
fi
if [ ! -d ~/stdlib ]; then
git -c advice.detachedHead=false clone --depth 1 --branch "${STDLIB_VERSION}" https://github.com/agda/agda-stdlib ~/stdlib
fi
echo "$HOME/agda-bin/bin" >> "$GITHUB_PATH"
echo "Agda_datadir=$HOME/agda-bin/data" >> "$GITHUB_ENV"
mkdir -p ~/.config/agda
echo "$HOME/stdlib/standard-library.agda-lib" > ~/.config/agda/libraries
echo "standard-library" > ~/.config/agda/defaults
Agda_datadir=~/agda-bin/data ~/agda-bin/bin/agda --version
- name: Check that Everything.agda imports every module
working-directory: univTypes
run: |
find . -name '*.agda' -not -path './.git/*' -not -name Everything.agda \
| sed 's|^\./||; s|\.agda$||; s|/|.|g; s|^|univTypes.|' | LC_ALL=C sort > expected
sed -n 's/^import //p' Everything.agda | LC_ALL=C sort > actual
diff -u expected actual || { echo "Everything.agda is out of date"; exit 1; }
- name: Check that Axioms.agda contains the only postulates
working-directory: univTypes
run: |
bad=$(grep -rlE '^\s*postulate|TERMINATING|NO_POSITIVITY_CHECK|NO_UNIVERSE_CHECK|trustMe' \
--include='*.agda' . | grep -v 'SubjectReduction/Specification/Axioms\.agda$' || true)
if [ -n "$bad" ]; then echo "Unsafe constructs found in:"; echo "$bad"; exit 1; fi
# Run from the parent directory: Agda resolves `univTypes.…` relative to it.
- name: Typecheck
run: agda univTypes/Everything.agda