@@ -10,26 +10,36 @@ jobs:
10
10
GHC 8.4 :
11
11
BUILD : stack
12
12
STACK_YAML : stack-ghc-84.yaml
13
+ EXTRA_SUFFIX : " "
13
14
GHC 8.6 :
14
15
BUILD : stack
15
16
STACK_YAML : stack-ghc-86.yaml
17
+ EXTRA_SUFFIX : " "
16
18
GHC 8.8 :
17
19
BUILD : stack
18
20
STACK_YAML : stack-ghc-88.yaml
21
+ EXTRA_SUFFIX : " "
22
+ Alpine :
23
+ BUILD : stack
24
+ STACK_YAML : stack-alpine.yaml
25
+ EXTRA_SUFFIX : " alpine"
26
+ ARGS : --system-ghc --no-install-ghc
19
27
style :
20
28
BUILD : style
29
+ EXTRA_SUFFIX : " "
21
30
pedantic :
22
31
BUILD : pedantic
23
32
STACK_YAML : stack.yaml
33
+ EXTRA_SUFFIX : " "
24
34
steps :
25
35
- script : |
26
36
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
27
37
mkdir -p ~/.local/bin
28
38
curl -f -L "https://github.com/fpco/cache-s3/releases/download/${CACHE_S3_VERSION}/cache-s3-${CACHE_S3_VERSION}-${OS_NAME}-x86_64.tar.gz" -o ~/.local/bin/cache-s3.tar.gz
29
39
tar xzf ~/.local/bin/cache-s3.tar.gz -C ~/.local/bin
30
40
export PATH=$HOME/.local/bin:$PATH;
31
- cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack --base-branch="${BASE_BRANCH}"
32
- cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack work --base-branch="${BASE_BRANCH}"
41
+ cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}${EXTRA_SUFFIX} " restore stack --base-branch="${BASE_BRANCH}"
42
+ cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}${EXTRA_SUFFIX} " restore stack work --base-branch="${BASE_BRANCH}"
33
43
etc/scripts/ci-setup.sh
34
44
case "$BUILD" in
35
45
style)
38
48
;;
39
49
*)
40
50
export PATH=$HOME/.local/bin:$PATH
41
- stack --install-ghc $ARGS test --bench --only-dependencies
51
+ stack $ARGS test --bench --only-dependencies
42
52
;;
43
53
esac
44
54
GHC_OPTIONS="-Werror"
51
61
hlint test/ --cpp-simple
52
62
;;
53
63
stack)
54
- stack test --haddock --no-haddock-deps --ghc-options="$GHC_OPTIONS"
64
+ stack $ARGS test --haddock --no-haddock-deps --ghc-options="$GHC_OPTIONS" --copy-bins --local-bin-path bin
65
+
66
+ # Make sure Alpine actually builds a static exe that works on Ubuntu
67
+ ./bin/stack --version
68
+ ldd ./bin/stack || true # ldd returns exit code 1 on statics, which we don't want to fail for
55
69
;;
56
70
pedantic)
57
71
stack --system-ghc build --pedantic
94
108
export AWS_SECRET_ACCESS_KEY="$(AWS_SECRET_ACCESS_KEY)";
95
109
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
96
110
if [ "$(Build.SourceBranchName)" = "${BASE_BRANCH}" ]; then
97
- cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" save stack;
111
+ cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}${EXTRA_SUFFIX} " save stack;
98
112
fi;
99
- cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" save stack work
113
+ cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}${EXTRA_SUFFIX} " save stack work
100
114
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
101
115
env:
102
116
OS_NAME: ${{ parameters.os }}
0 commit comments