Skip to content

Commit 9acba2c

Browse files
committed
GHA: use haskell-actions/setup on Windows
1 parent ea73f54 commit 9acba2c

File tree

1 file changed

+2
-51
lines changed

1 file changed

+2
-51
lines changed

.github/workflows/haskell.yml

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,68 +18,19 @@ jobs:
1818

1919
defaults:
2020
run:
21-
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
21+
shell: 'bash'
2222

2323
steps:
24-
- name: "WIN: Setup MSYS2 and libraries"
25-
if: runner.os == 'Windows'
26-
uses: msys2/setup-msys2@v2
27-
with:
28-
update: true
29-
install: >-
30-
base-devel
31-
autoconf-wrapper
32-
autoconf
33-
automake
34-
libtool
35-
make
36-
git
37-
mingw-w64-x86_64-jq
38-
3924
- name: Set cache version
4025
run: echo "CACHE_VERSION=pu4Aevoo_v1" >> $GITHUB_ENV
4126

42-
- name: "LINUX: Setup Haskell"
27+
- name: "Setup Haskell"
4328
uses: haskell-actions/setup@v2
44-
if: runner.os != 'Windows'
4529
id: setup-haskell
4630
with:
4731
ghc-version: ${{ matrix.ghc }}
4832
cabal-version: "3.10.1.0"
4933

50-
- name: "WIN: Setup Haskell"
51-
id: win-setup-haskell
52-
if: runner.os == 'Windows'
53-
run: |
54-
# see https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/scripts/bootstrap/bootstrap-haskell
55-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | \
56-
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
57-
BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=1 \
58-
BOOTSTRAP_HASKELL_ADJUST_BASHRC=1 \
59-
BOOTSTRAP_HASKELL_GHC_VERSION="${{ matrix.ghc }}" \
60-
BOOTSTRAP_HASKELL_CABAL_VERSION="${{ matrix.cabal }}" \
61-
sh
62-
63-
# MSYS2 doesn't inherit $GITHUB_PATH so this is needed
64-
cat <(echo "source /c/ghcup/env") ~/.bashrc > ~/.bashrc.new
65-
mv ~/.bashrc.new ~/.bashrc
66-
67-
source ~/.bashrc
68-
69-
# There is an issue with crt libraries, fixed by prepending the ghc
70-
# mingw32 libraries directory to every other library directory.
71-
echo "# Original cabal config extra-lib-dirs"
72-
grep extra-lib-dirs /c/cabal/config
73-
74-
sed -i 's/C:\\msys64\\mingw64\\lib/C:\\ghcup\\ghc\\${{matrix.ghc}}\\mingw\\x86_64-w64-mingw32\\lib, C:\\msys64\\mingw64\\lib/g' /c/cabal/config
75-
76-
echo "# Modified cabal config extra-lib-dirs"
77-
grep extra-lib-dirs /c/cabal/config
78-
79-
ghc --version
80-
cabal --version
81-
echo "cabal-store=$(dirname $(cabal --help | tail -1 | tr -d ' '))\\store" >> $GITHUB_OUTPUT
82-
8334
- uses: actions/checkout@v3
8435

8536
- name: "Configure cabal.project.local"

0 commit comments

Comments
 (0)