@@ -12,17 +12,70 @@ jobs:
12
12
ghc : ["8.10.7", "9.2.2"]
13
13
os : [ubuntu-latest, macos-latest, windows-latest]
14
14
15
+ defaults :
16
+ run :
17
+ shell : ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
18
+
15
19
steps :
20
+ - name : " WIN: Setup MSYS2 and libraries"
21
+ if : runner.os == 'Windows'
22
+ uses : msys2/setup-msys2@v2
23
+ with :
24
+ update : true
25
+ install : >-
26
+ base-devel
27
+ autoconf-wrapper
28
+ autoconf
29
+ automake
30
+ libtool
31
+ make
32
+ git
33
+ mingw-w64-x86_64-jq
34
+
16
35
- name : Set cache version
17
36
run : echo "CACHE_VERSION=pu4Aevoo" >> $GITHUB_ENV
18
37
19
- - name : " Setup Haskell"
38
+ - name : " LINUX: Setup Haskell"
20
39
uses : haskell/actions/setup@v1
40
+ if : runner.os != 'Windows'
21
41
id : setup-haskell
22
42
with :
23
43
ghc-version : ${{ matrix.ghc }}
24
44
cabal-version : 3.6.2.0
25
45
46
+ - name : " WIN: Setup Haskell"
47
+ id : win-setup-haskell
48
+ if : runner.os == 'Windows'
49
+ run : |
50
+ # see https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/scripts/bootstrap/bootstrap-haskell
51
+ curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | \
52
+ BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
53
+ BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=1 \
54
+ BOOTSTRAP_HASKELL_ADJUST_BASHRC=1 \
55
+ BOOTSTRAP_HASKELL_GHC_VERSION="${{ matrix.ghc }}" \
56
+ BOOTSTRAP_HASKELL_CABAL_VERSION="3.6.2.0" \
57
+ sh
58
+
59
+ # MSYS2 doesn't inherit $GITHUB_PATH so this is needed
60
+ cat <(echo "source /c/ghcup/env") ~/.bashrc > ~/.bashrc.new
61
+ mv ~/.bashrc.new ~/.bashrc
62
+
63
+ source ~/.bashrc
64
+
65
+ # There is an issue with crt libraries, fixed by prepending the ghc
66
+ # mingw32 libraries directory to every other library directory.
67
+ echo "# Original cabal config extra-lib-dirs"
68
+ grep extra-lib-dirs /c/cabal/config
69
+
70
+ sed -i 's/C:\\msys64\\mingw64\\lib/C:\\ghcup\\ghc\\8.10.7\\mingw\\x86_64-w64-mingw32\\lib, C:\\msys64\\mingw64\\lib/g' /c/cabal/config
71
+
72
+ echo "# Modified cabal config extra-lib-dirs"
73
+ grep extra-lib-dirs /c/cabal/config
74
+
75
+ ghc --version
76
+ cabal --version
77
+ echo "::set-output name=cabal-store::$(dirname $(cabal --help | tail -1 | tr -d ' '))\\store"
78
+
26
79
- uses : actions/checkout@v2
27
80
28
81
- name : " Configure cabal.project.local"
0 commit comments