Skip to content

Commit a78d142

Browse files
committed
github actions: download stylish-haskell
1 parent 54c33ff commit a78d142

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/haskell.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ jobs:
122122
stylish-haskell:
123123
runs-on: ubuntu-22.04
124124

125+
env:
126+
STYLISH_HASKELL_VERSION: "0.14.4.0"
127+
125128
steps:
126129
- name: Set cache version
127130
run: |
@@ -156,16 +159,15 @@ jobs:
156159
path: ~/.cabal/bin/stylish-haskell
157160
key: cabal-path-${{ env.STYLISH_HASKELL_VERSION }}
158161

159-
# Install stylish-haskell unless the right version is already available
160-
# from the cache
161-
- name: "Install `stylish-haskell`"
162+
- name: Download stylish-haskell
162163
run: |
163-
if [[ -x $(which stylish-haskell) && $(stylish-haskell --version) == "stylish-haskell ${{ env.STYLISH_HASKELL_VERSION }}" ]];
164-
then
165-
echo "Using cached `stylish-haskell`"
166-
else
167-
cabal install --overwrite-policy=always stylish-haskell-${{ env.STYLISH_HASKELL_VERSION }}
168-
fi
164+
version="${{ env.STYLISH_HASKELL_VERSION }}"
165+
166+
curl -sL \
167+
"https://github.com/haskell/stylish-haskell/releases/download/v$version/stylish-haskell-v$version-linux-x86_64.tar.gz" \
168+
| tar -C "/tmp" -xz
169+
170+
echo "PATH=/tmp/stylish-haskell-v$version-linux-x86_64:$PATH" >> $GITHUB_ENV
169171
170172
- name: "`stylish-haskell` version"
171173
run: |

0 commit comments

Comments
 (0)