@@ -10,26 +10,35 @@ jobs:
1010 GHC 8.4 :
1111 BUILD : stack
1212 STACK_YAML : stack-ghc-84.yaml
13+ EXTRA_SUFFIX : " "
1314 GHC 8.6 :
1415 BUILD : stack
1516 STACK_YAML : stack-ghc-86.yaml
17+ EXTRA_SUFFIX : " "
1618 GHC 8.8 :
1719 BUILD : stack
1820 STACK_YAML : stack-ghc-88.yaml
21+ EXTRA_SUFFIX : " "
22+ Alpine :
23+ BUILD : stack
24+ STACK_YAML : stack-alpine.yaml
25+ EXTRA_SUFFIX : " alpine"
1926 style :
2027 BUILD : style
28+ EXTRA_SUFFIX : " "
2129 pedantic :
2230 BUILD : pedantic
2331 STACK_YAML : stack.yaml
32+ EXTRA_SUFFIX : " "
2433 steps :
2534 - script : |
2635 export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
2736 mkdir -p ~/.local/bin
2837 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
2938 tar xzf ~/.local/bin/cache-s3.tar.gz -C ~/.local/bin
3039 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}"
3342 etc/scripts/ci-setup.sh
3443 case "$BUILD" in
3544 style)
3847 ;;
3948 *)
4049 export PATH=$HOME/.local/bin:$PATH
41- stack --install-ghc $ARGS test --bench --only-dependencies
50+ stack $ARGS test --bench --only-dependencies
4251 ;;
4352 esac
4453 GHC_OPTIONS="-Werror"
5160 hlint test/ --cpp-simple
5261 ;;
5362 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
5568 ;;
5669 pedantic)
5770 stack --system-ghc build --pedantic
94107 export AWS_SECRET_ACCESS_KEY="$(AWS_SECRET_ACCESS_KEY)";
95108 export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
96109 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;
98111 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
100113 condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
101114 env:
102115 OS_NAME: ${{ parameters.os }}
0 commit comments