@@ -84,22 +84,39 @@ jobs:
8484 with :
8585 submodules : recursive
8686
87- - name : Install Idris2
87+ - name : Cache pack
88+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
89+ with :
90+ path : |
91+ ~/.pack
92+ ~/.idris2
93+ key : ${{ runner.os }}-idris2-pack-${{ hashFiles('**/pack.toml', '**/*.ipkg') }}
94+ restore-keys : |
95+ ${{ runner.os }}-idris2-pack-
96+
97+ - name : Install Idris2 via pack
8898 run : |
89- # Idris2 is not in Ubuntu repos; install from release or container.
90- # Placeholder: use pack or nix. For now, skip gracefully if not available.
91- if ! command -v idris2 >/dev/null 2>&1; then
92- echo "::warning::Idris2 not installed in this job; skipping (add pack-install step when ready)"
99+ set -e
100+ if command -v idris2 >/dev/null 2>&1; then
101+ echo "idris2 already present: $(idris2 --version)"
93102 exit 0
94103 fi
104+ # Bootstrap: install pack, which installs idris2.
105+ sudo apt-get update
106+ sudo apt-get install -y build-essential libgmp-dev chezscheme
107+ # Clone pack bootstrap
108+ git clone --depth 1 https://github.com/stefan-hoeck/idris2-pack.git "$HOME/idris2-pack"
109+ cd "$HOME/idris2-pack"
110+ # Use the bootstrap script in non-interactive mode
111+ bash install.bash </dev/null || echo "::warning::pack install had warnings"
112+ echo "$HOME/.pack/bin" >> "$GITHUB_PATH"
113+ export PATH="$HOME/.pack/bin:$PATH"
114+ pack install-api idris2
95115 idris2 --version
96116
97117 - name : Type-check A2ML.Proofs
98118 run : |
99- if ! command -v idris2 >/dev/null 2>&1; then
100- echo "skipping — idris2 missing"
101- exit 0
102- fi
119+ export PATH="$HOME/.pack/bin:$PATH"
103120 cd a2ml
104121 idris2 --check src/A2ML/Proofs.idr 2>&1 | tee ../idris2-a2ml.log
105122
@@ -121,20 +138,36 @@ jobs:
121138 with :
122139 submodules : recursive
123140
124- - name : Install Idris2
141+ - name : Cache pack
142+ uses : actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
143+ with :
144+ path : |
145+ ~/.pack
146+ ~/.idris2
147+ key : ${{ runner.os }}-idris2-pack-${{ hashFiles('**/pack.toml', '**/*.ipkg') }}
148+ restore-keys : |
149+ ${{ runner.os }}-idris2-pack-
150+
151+ - name : Install Idris2 via pack
125152 run : |
126- if ! command -v idris2 >/dev/null 2>&1; then
127- echo "::warning::Idris2 not installed in this job; skipping"
153+ set -e
154+ if command -v idris2 >/dev/null 2>&1; then
155+ echo "idris2 already present: $(idris2 --version)"
128156 exit 0
129157 fi
158+ sudo apt-get update
159+ sudo apt-get install -y build-essential libgmp-dev chezscheme
160+ git clone --depth 1 https://github.com/stefan-hoeck/idris2-pack.git "$HOME/idris2-pack"
161+ cd "$HOME/idris2-pack"
162+ bash install.bash </dev/null || echo "::warning::pack install had warnings"
163+ echo "$HOME/.pack/bin" >> "$GITHUB_PATH"
164+ export PATH="$HOME/.pack/bin:$PATH"
165+ pack install-api idris2
130166 idris2 --version
131167
132168 - name : Type-check AVOW proofs
133169 run : |
134- if ! command -v idris2 >/dev/null 2>&1; then
135- echo "skipping — idris2 missing"
136- exit 0
137- fi
170+ export PATH="$HOME/.pack/bin:$PATH"
138171 cd avow-protocol/avow-lib
139172 for f in src/abi/Consent.idr src/abi/Unsubscribe.idr src/abi/Types.idr; do
140173 if [ -f "$f" ]; then
0 commit comments