@@ -15,27 +15,51 @@ jobs:
1515 matrix :
1616 os : [ubuntu-latest, macOS-latest, windows-latest]
1717 plan :
18- - {resolver: lts-18.28}
1918 - {resolver: lts-19.33}
2019 - {resolver: lts-20.26}
2120 - {resolver: lts-21.25}
22- - {resolver: lts-22.18}
23- - {resolver: lts-23.5}
24- - {resolver: nightly, stack-yaml: '--stack-yaml=nightly-stack.yaml'}
21+ - {resolver: lts-22.44}
22+ - {resolver: lts-23.28}
23+ - {resolver: lts-24.17}
24+ - {resolver: nightly, stack-yaml: nightly-stack.yaml}
2525 exclude :
26- - os : macOS-latest
27- plan : {resolver: lts-18.28}
2826 - os : macOS-latest
2927 plan : {resolver: lts-19.33}
28+ include :
29+ - os : macOS-latest
30+ brew : openssl
31+ - os : windows-latest
32+ choco : openssl
3033
3134 runs-on : ${{ matrix.os }}
3235
3336 steps :
34- # - name: Install ${{ matrix.os }} Packages
35- # uses: delgurth/get -package@v6.0.0
36- # with:
37+ - name : Install ${{ matrix.os }} Packages
38+ uses : amitie10g/install -package@v1.2.5
39+ with :
3740 # apt-get: ${{ matrix.apt-get }}
38- # brew: ${{ matrix.brew }}
41+ brew : ${{ matrix.brew }}
42+ msystem : mingw64
43+ choco : ${{ matrix.choco }}
44+
45+ - name : Set extra directories (macOS)
46+ if : runner.os == 'macOS'
47+ run : |
48+ PREFIX="$(brew --prefix openssl)"
49+ cat <<EOF >> "$GITHUB_ENV"
50+ EXTRA_INCLUDE_DIRS=${PREFIX}/include
51+ EXTRA_LIB_DIRS=${PREFIX}/lib
52+ EOF
53+
54+ - name : Set extra directories (Windows)
55+ if : runner.os == 'Windows'
56+ shell : bash
57+ run : |
58+ PREFIX="$(cygpath -m '/c/Program Files/OpenSSL')"
59+ cat <<EOF >> "$GITHUB_ENV"
60+ EXTRA_INCLUDE_DIRS=${PREFIX}/include
61+ EXTRA_LIB_DIRS=C:/mingw64/opt/lib
62+ EOF
3963
4064 - uses : actions/checkout@v4
4165
@@ -86,45 +110,37 @@ jobs:
86110 enable-stack : true
87111 stack-no-global : true
88112
89- - name : Install dependencies on unix
113+ - name : Install dependencies
114+ shell : bash
90115 run : |
91116 set -ex
92117 # shellcheck disable=SC2086
93- stack --no-terminal --install-ghc $RES $YML test --bench --only-dependencies
118+ stack --no-terminal --install-ghc \
119+ ${EXTRA_INCLUDE_DIRS:+--extra-include-dirs="$EXTRA_INCLUDE_DIRS"} \
120+ ${EXTRA_LIB_DIRS:+--extra-lib-dirs="$EXTRA_LIB_DIRS"} \
121+ ${RESOLVER:+--resolver="$RESOLVER"} \
122+ ${STACK_YML:+--stack-yaml="$STACK_YML"} \
123+ test --bench --only-dependencies
94124 set +ex
95125 env :
96- RES : " --resolver=${{ matrix.plan.resolver }}"
97- YML : " ${{ matrix.plan.stack-yaml }}"
98- if : contains(matrix.os, 'windows') == false
99-
100- - name : Install dependencies on windows
101- shell : powershell
102- run : |
103- stack --no-terminal -j 1 --install-ghc ${env:RES} ${env:YML} test --bench --only-dependencies
104- env :
105- RES : " --resolver=${{ matrix.plan.resolver }}"
106- YML : " ${{ matrix.plan.stack-yaml }}"
107- if : contains(matrix.os, 'windows')
126+ RESOLVER : ${{ matrix.plan.resolver }}
127+ STACK_YML : ${{ matrix.plan.stack-yaml }}
108128
109- - name : Build on unix
129+ - name : Build and test
130+ shell : bash
110131 run : |
111132 set -ex
112133 # shellcheck disable=SC2086
113- stack --no-terminal --install-ghc test $RES $YML --coverage --bench --no-run-benchmarks --haddock --no-haddock-deps
134+ stack --no-terminal --install-ghc \
135+ ${EXTRA_INCLUDE_DIRS:+--extra-include-dirs="$EXTRA_INCLUDE_DIRS"} \
136+ ${EXTRA_LIB_DIRS:+--extra-lib-dirs="$EXTRA_LIB_DIRS"} \
137+ ${RESOLVER:+--resolver="$RESOLVER"} \
138+ ${STACK_YML:+--stack-yaml="$STACK_YML"} \
139+ test --coverage --bench --no-run-benchmarks --haddock --no-haddock-deps
114140 set +ex
115141 env :
116- RES : " --resolver=${{ matrix.plan.resolver }}"
117- YML : " ${{ matrix.plan.stack-yaml }}"
118- if : contains(matrix.os, 'windows') == false
119-
120- - name : Build on windows
121- shell : powershell
122- run : |
123- stack --no-terminal --install-ghc test ${env:RES} ${env:YML} --coverage --bench --no-run-benchmarks --haddock --no-haddock-deps
124- env :
125- RES : " --resolver=${{ matrix.plan.resolver }}"
126- YML : " ${{ matrix.plan.stack-yaml }}"
127- if : contains(matrix.os, 'windows')
142+ RESOLVER : ${{ matrix.plan.resolver }}
143+ STACK_YML : ${{ matrix.plan.stack-yaml }}
128144
129145 - name : Cache ~/.stack
130146 uses : actions/cache/save@v4
0 commit comments