Skip to content

Commit

Permalink
[ ci ] Make Agda binary distributable hence cachable
Browse files Browse the repository at this point in the history
  • Loading branch information
banacorn committed Nov 21, 2024
1 parent 0e2c17a commit 1eb0625
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ jobs:
cabal-update: false
enable-stack: true

# $DIST is where the binary & its dependencies is placed
- name: 🛠️ Setting variables
run: |
echo "STACK_LOCAL_BIN=$(stack path --local-bin)" >> "$GITHUB_ENV"
echo "DIST=${{ matrix.agda }}-${{ matrix.os }}" >> "$GITHUB_ENV"
- name: 🔍 Reviewing variables
run: |
Expand All @@ -53,7 +55,8 @@ jobs:
echo "stack-path = ${{ steps.haskell-setup.outputs.stack-path }}"
echo "stack-exe = ${{ steps.haskell-setup.outputs.stack-exe }}"
echo "stack-root = ${{ steps.haskell-setup.outputs.stack-root }}"
echo "STACK_LOCAL_BIN = $STACK_LOCAL_BIN"
echo "STACK_LOCAL_BIN = $STACK_LOCAL_BIN"
echo "DIST = $DIST"
# cached stuff to be restored:
- name: 💾 Restore cached stack global package db
Expand Down Expand Up @@ -94,6 +97,23 @@ jobs:
which agda
agda --version
- name: 📦 Move artefacts to ${{ env.DIST }}
continue-on-error: true
run: |
dist=${{ env.DIST }}
if [[ ${{ runner.os }} == "Windows" ]]; then
ls "${{ env.STACK_LOCAL_BIN }}"
cp "${{ env.STACK_LOCAL_BIN }}"/agda "${dist}"/agda
else
cp ${{ env.STACK_LOCAL_BIN }}/agda "${dist}"/agda
strip "${dist}"/agda
fi
ls "${dist}"
file "${dist}"/agda
# things to be cached
- name: 💾 Cache stack global package db
if: always() && env.AGDA_INSTALLED != '0' && steps.stack-global.outputs.cache-hit != 'true'
Expand Down

0 comments on commit 1eb0625

Please sign in to comment.