-
Notifications
You must be signed in to change notification settings - Fork 10
94 lines (83 loc) · 3.28 KB
/
stack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build with Stack
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc-ver: [9.8.1, 9.6.4]
# Snapshots for 9.4.8, 9.2.8, 9.0.2, 8.10.7 do not have a recent enough base-compat; 0.13 is needed.
# On ubuntu-22.04 the old versions 8.8.4, 8.6.5, 8.4.4, 8.2.2 fail due to HsOpenSSL linking errors.
# They used to work under ubuntu-20.04, but it is not worth the trouble maintaining them.
# Apparently, HsOpenSSL-0.11.6 and older are too old for ubuntu-22.04.
include:
- os: macos-latest
ghc-ver: 9.8.1
- os: windows-latest
ghc-ver: 9.8.1
env:
ARGS: "--stack-yaml=stack-${{ matrix.ghc-ver }}.yaml --no-terminal --system-ghc"
# Needed for Windows to make piping (... >> ...) and evaluation ( $(...) ) work.
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: haskell-setup
with:
ghc-version: ${{ matrix.ghc-ver }}
enable-stack: true
- name: Install the brotli library (Windows)
if: ${{ runner.os == 'Windows' }}
# Andreas Abel, 2022-02-15:
# Stack is packing an old version of MSYS2.
# To work around certification problems, we need to update msys2-keyring.
run: |
stack exec ${{ env.ARGS }} -- pacman --noconfirm -Sy msys2-keyring
stack exec ${{ env.ARGS }} -- pacman --noconfirm -S mingw-w64-x86_64-pkgconf
stack exec ${{ env.ARGS }} -- pacman --noconfirm -S mingw-w64-x86_64-brotli
stack exec ${{ env.ARGS }} -- pacman --noconfirm -S mingw-w64-x86_64-openssl
- name: Install the brotli library (Ubuntu)
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get update
sudo apt-get install libbrotli-dev -qq
- name: Set environment variables based on Haskell setup
run: |
STACK_VER=$(stack --numeric-version)
echo "STACK_VER=${STACK_VER}" >> "${GITHUB_ENV}"
- name: Cache dependencies (restore)
uses: actions/cache/restore@v4
id: cache
with:
path: ${{ steps.haskell-setup.outputs.stack-root }}
# Use a unique primary key (always save new cache); works if caches aren't to big or too many...
key: ${{ runner.os }}-stack-${{ env.STACK_VER }}-ghc-${{ matrix.ghc-ver }}-commit-${{ github.sha }}
restore-keys: ${{ runner.os }}-stack-${{ env.STACK_VER }}-ghc-${{ matrix.ghc-ver }}-
- name: Install dependencies
# if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
stack build ${{ env.ARGS }} --test --only-dependencies
- name: Build hackage-cli
run: |
stack build ${{ env.ARGS }}
- name: Test hackage-cli
run: |
stack test ${{ env.ARGS }}
- name: Cache dependencies (save)
uses: actions/cache/save@v4
if: always()
# # Will fail if we already have a cache with this key (in this case, cache-hit is true).
# if: ${{ steps.cache.outputs.cache-hit != 'true' }}
with:
path: ${{ steps.haskell-setup.outputs.stack-root }}
key: ${{ steps.cache.outputs.cache-primary-key }}