Fix CI by registering standard-library .agda-lib on runner #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Agda | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| pull_request: | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Agda and standard library | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y agda agda-stdlib | |
| - name: Locate Agda standard library | |
| id: stdlib | |
| run: | | |
| STDLIB_DIR="$( | |
| find /usr/share /usr/lib -type f -path '*/Data/Nat/Base.agda' 2>/dev/null \ | |
| | head -n 1 \ | |
| | sed 's#/Data/Nat/Base.agda##' | |
| )" | |
| if [ -z "$STDLIB_DIR" ]; then | |
| echo "Could not locate Agda standard library directory" | |
| exit 1 | |
| fi | |
| echo "stdlib_dir=$STDLIB_DIR" >> "$GITHUB_OUTPUT" | |
| - name: Register standard library for Agda | |
| run: | | |
| mkdir -p "$HOME/.agda" | |
| STDLIB_LIB="$RUNNER_TEMP/standard-library.agda-lib" | |
| cat > "$STDLIB_LIB" <<EOF | |
| name: standard-library | |
| include: ${{ steps.stdlib.outputs.stdlib_dir }} | |
| EOF | |
| printf '%s\n' "$STDLIB_LIB" > "$HOME/.agda/libraries" | |
| printf '%s\n' "standard-library" > "$HOME/.agda/defaults" | |
| - name: Typecheck full suite | |
| run: agda -i proofs/agda proofs/agda/All.agda |