Skip to content

Commit e7250ae

Browse files
authored
Merge pull request #4961 from input-output-hk/newhoggy/use-officially-released-binary-for-stylish-haskell
Use officially released binary for stylish-haskell
2 parents a51c64c + f211baa commit e7250ae

File tree

1 file changed

+6
-76
lines changed

1 file changed

+6
-76
lines changed

.github/workflows/stylish-haskell.yml

+6-76
Original file line numberDiff line numberDiff line change
@@ -47,86 +47,16 @@ jobs:
4747
cardano-submit-api
4848
4949
steps:
50-
- name: Workaround runner image issue
50+
- name: Download stylish-haskell
5151
if: runner.os == 'Linux'
52-
# https://github.com/actions/runner-images/issues/7061
53-
run: sudo chown -R $USER /usr/local/.ghcup
54-
55-
- name: Install Haskell
56-
uses: input-output-hk/setup-haskell@v1
57-
id: setup-haskell
58-
with:
59-
ghc-version: 9.2.7
60-
cabal-version: 3.8.1.0
61-
62-
- name: Cabal update
63-
run: cabal update
64-
65-
- name: Get stylish-haskell
66-
run: cabal get "stylish-haskell-$STYLISH_HASKELL_VERSION"
67-
68-
- name: Build dry run for stylish-haskell
6952
run: |
70-
cd "stylish-haskell-$STYLISH_HASKELL_VERSION"
71-
cabal build all --dry-run
72-
73-
# For users who fork cardano-node and want to define a writable cache, then can set up their own
74-
# S3 bucket then define in their forked repository settings the following secrets:
75-
#
76-
# AWS_ACCESS_KEY_ID
77-
# AWS_SECRET_ACCESS_KEY
78-
# BINARY_CACHE_URI
79-
# BINARY_CACHE_REGION
80-
- name: Cabal cache over S3
81-
uses: action-works/cabal-cache-s3@v1
82-
env:
83-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
84-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
85-
with:
86-
region: ${{ secrets.BINARY_CACHE_REGION }}
87-
dist-dir: stylish-haskell-${{ env.STYLISH_HASKELL_VERSION }}/dist-newstyle
88-
store-path: ${{ steps.setup-haskell.outputs.cabal-store }}
89-
threads: 16
90-
archive-uri: ${{ secrets.BINARY_CACHE_URI }}/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}
91-
skip: "${{ secrets.BINARY_CACHE_URI == '' }}"
92-
93-
# It's important to ensure that people who fork this repository can not only successfully build in
94-
# CI by default, but also have meaning cabal store caching.
95-
#
96-
# Because syncing with S3 requires credentials, we cannot rely on S3 for this. For this reason a
97-
# https fallback is used. The https server mirrors the content of the S3 bucket. The https cabal
98-
# store archive is read-only for security reasons.
99-
#
100-
# Users who fork this repository who want to have a writable cabal store archive are encouraged
101-
# to set up their own S3 bucket.
102-
- name: Cabal cache over HTTPS
103-
uses: action-works/cabal-cache-s3@v1
104-
with:
105-
dist-dir: stylish-haskell-${{ env.STYLISH_HASKELL_VERSION }}/dist-newstyle
106-
store-path: ${{ steps.setup-haskell.outputs.cabal-store }}
107-
threads: 16
108-
archive-uri: https://iohk.cache.haskellworks.io/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}
109-
skip: "${{ secrets.BINARY_CACHE_URI != '' }}"
110-
enable-save: false
111-
112-
- name: Build stylish-haskell
113-
run: |
114-
cd "stylish-haskell-$STYLISH_HASKELL_VERSION"
115-
cabal build all
116-
117-
- name: Install stylish-haskell
118-
run: |
119-
cd "stylish-haskell-$STYLISH_HASKELL_VERSION"
120-
cabal install exe:stylish-haskell
121-
122-
- name: Remove stylish-haskell build directory
123-
run: rm -rf "stylish-haskell-$STYLISH_HASKELL_VERSION"
53+
version="${{ env.STYLISH_HASKELL_VERSION }}"
12454
125-
- name: stylish-haskell installation directory
126-
run: find . -name stylish-haskell
55+
curl -sL \
56+
"https://github.com/haskell/stylish-haskell/releases/download/v$version/stylish-haskell-v$version-linux-x86_64.tar.gz" \
57+
| tar -C "/tmp" -xz
12758
128-
- name: Add installation directory to path
129-
run: echo "PATH=$HOME/.cabal/bin:$PATH" >> $GITHUB_ENV
59+
echo "PATH=/tmp/stylish-haskell-v$version-linux-x86_64:$PATH" >> $GITHUB_ENV
13060
13161
- uses: actions/checkout@v2
13262

0 commit comments

Comments
 (0)