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