Skip to content

Commit

Permalink
[ ci ] Check if Agda binary already exist before trying to install it
Browse files Browse the repository at this point in the history
  • Loading branch information
banacorn committed Nov 20, 2024
1 parent 46341a8 commit 0e2c17a
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ jobs:
echo "stack-root = ${{ steps.haskell-setup.outputs.stack-root }}"
echo "STACK_LOCAL_BIN = $STACK_LOCAL_BIN"
# # cached stuff to be restored:
# - name: 💾 Restore cached stack global package db
# id: stack-global
# uses: actions/cache/restore@v4
# with:
# path: ${{ steps.haskell-setup.outputs.stack-root }}
# key: ${{ runner.os }}-stack-global-${{ matrix.agda }}
# restore-keys: |
# ${{ runner.os }}-stack-global
# cached stuff to be restored:
- name: 💾 Restore cached stack global package db
id: stack-global
uses: actions/cache/restore@v4
with:
path: ${{ steps.haskell-setup.outputs.stack-root }}
key: ${{ runner.os }}-stack-global-${{ matrix.agda }}
restore-keys: |
${{ runner.os }}-stack-global
- name: 💾 Restore stack-installed binaries in ~/.local/bin
id: stack-binaries
Expand All @@ -87,25 +87,20 @@ jobs:
continue-on-error: true
run: which agda

# - name: ✅ Verify Agda is ready
# if: ${{ steps.check-agda.outcome == 'success'}}
# run: echo "Agda already installed, skipping installation"

- name: ⏬ Install Agda because it has not been installed
- name: ⏬ Install Agda
if: ${{ steps.check-agda.outcome == 'failure'}}
run: |
stack install --resolver=lts-20.26 ${{ matrix.agda }}
which agda
agda --version
# # things to be cached

# - name: 💾 Cache stack global package db
# if: always() && env.AGDA_INSTALLED != '0' && steps.stack-global.outputs.cache-hit != 'true'
# uses: actions/cache/save@v4
# with:
# path: ${{ steps.haskell-setup.outputs.stack-root }}
# key: ${{ steps.stack-global.outputs.cache-primary-key }}
# things to be cached
- name: 💾 Cache stack global package db
if: always() && env.AGDA_INSTALLED != '0' && steps.stack-global.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ steps.haskell-setup.outputs.stack-root }}
key: ${{ steps.stack-global.outputs.cache-primary-key }}

- name: 💾 Cache stack-installed binaries
if: always() && env.AGDA_INSTALLED != '0' && steps.stack-binaries.outputs.cache-hit != 'true'
Expand Down

0 comments on commit 0e2c17a

Please sign in to comment.