-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Azure nightly integration support and bindists generation * Fix failing integration tests
- Loading branch information
Showing
8 changed files
with
198 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
jobs: | ||
- job: ${{ parameters.name }} | ||
timeoutInMinutes: 180 | ||
variables: | ||
- group: AWS_Keys | ||
pool: | ||
vmImage: ${{ parameters.vmImage }} | ||
strategy: | ||
matrix: | ||
stack: | ||
BUILD: stack | ||
maxParallel: 1 | ||
steps: | ||
- script: | | ||
export AWS_ACCESS_KEY_ID="$(AWS_ACCESS_KEY_ID)"; | ||
export AWS_SECRET_ACCESS_KEY="$(AWS_SECRET_ACCESS_KEY)"; | ||
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; | ||
echo $STACK_ROOT | ||
mkdir -p ~/.local/bin | ||
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 | ||
tar xzf ~/.local/bin/cache-s3.tar.gz -C ~/.local/bin | ||
export PATH=$HOME/.local/bin:$PATH; | ||
cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack --base-branch="${BASE_BRANCH}" | ||
cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack work --base-branch="${BASE_BRANCH}" | ||
./.travis-setup.sh | ||
brew install mercurial | ||
export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/happy/1.19.5/bin:/opt/alex/3.1.7/bin:$PATH | ||
set -ex | ||
stack --no-terminal install cabal-install | ||
set +ex | ||
env: | ||
OS_NAME: ${{ parameters.os }} | ||
displayName: 'Installation ${{parameters.os}}' | ||
- script: | | ||
curl https://nixos.org/nix/install | sh | ||
. ~/.nix-profile/etc/profile.d/nix.sh | ||
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; | ||
export PATH=$HOME/.local/bin:$PATH; | ||
set -ex | ||
stack test --flag stack:integration-tests stack:test:stack-integration-test | ||
set +ex | ||
displayName: Integration Test | ||
- script: | | ||
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; | ||
export PATH=$HOME/.local/bin:$PATH; | ||
stack install stack --local-bin-path $(Build.ArtifactStagingDirectory) | ||
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues', 'Failed') | ||
displayName: Gzip Stack | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
artifactName: stack-osx | ||
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues', 'Failed') | ||
- script: | | ||
export PATH=$HOME/.local/bin:$PATH; | ||
export AWS_ACCESS_KEY_ID="$(AWS_ACCESS_KEY_ID)"; | ||
export AWS_SECRET_ACCESS_KEY="$(AWS_SECRET_ACCESS_KEY)"; | ||
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; | ||
if [ "$(Build.SourceBranchName)" = "${BASE_BRANCH}" ]; then | ||
cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" save stack; | ||
fi; | ||
cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" save stack work | ||
env: | ||
OS_NAME: ${{ parameters.os }} | ||
displayName: 'Cache data' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
jobs: | ||
- job: ${{ parameters.name }} | ||
timeoutInMinutes: 180 | ||
variables: | ||
- group: AWS_Keys | ||
pool: | ||
vmImage: ${{ parameters.vmImage }} | ||
strategy: | ||
matrix: | ||
stack: | ||
BUILD: stack | ||
maxParallel: 1 | ||
steps: | ||
- powershell: | | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
Invoke-WebRequest -Uri "https://github.com/fpco/cache-s3/releases/download/$env:CACHE_S3_VERSION/cache-s3-$env:CACHE_S3_VERSION-$env:OS_NAME-x86_64.zip" -OutFile $env:TEMP\cache-s3.zip | ||
Expand-Archive $env:TEMP\cache-s3.zip -DestinationPath $env:TEMP\ | ||
env: | ||
OS_NAME: ${{ parameters.os }} | ||
displayName: Download binaries | ||
- bash: | | ||
export AWS_ACCESS_KEY_ID="$(AWS_ACCESS_KEY_ID)"; | ||
export AWS_SECRET_ACCESS_KEY="$(AWS_SECRET_ACCESS_KEY)"; | ||
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; | ||
export PATH=$PATH:"/C/Program Files/Mercurial/" | ||
export TMP=/D/tmp | ||
choco install hg -y | ||
/tmp/cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack --base-branch="${BASE_BRANCH}" | ||
/tmp/cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" restore stack work --base-branch="${BASE_BRANCH}" | ||
curl -sSkL http://www.stackage.org/stack/windows-i386 -o /usr/bin/stack.zip | ||
unzip -o /usr/bin/stack.zip -d /usr/bin/ | ||
stack setup | ||
stack --no-terminal install cabal-install | ||
stack --version | ||
env: | ||
OS_NAME: ${{ parameters.os }} | ||
displayName: 'Installation ${{parameters.os}}' | ||
- bash: | | ||
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; | ||
export PATH=$PATH:"/C/Program Files/Mercurial/" | ||
export TMP=/D/tmp | ||
set -ex | ||
stack test --flag stack:integration-tests stack:test:stack-integration-test | ||
set +ex | ||
displayName: Integration Test | ||
- powershell: | | ||
$env:STACK_ROOT = "$(Build.SourcesDirectory)\.stack-root" | ||
$env:PATH += ";$env:HOME\.local\bin" | ||
stack install stack --local-bin-path $(Build.ArtifactStagingDirectory) | ||
displayName: Gzip Stack | ||
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues', 'Failed') | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
artifactName: stack-windows | ||
condition: in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues', 'Failed') | ||
- bash: | | ||
export AWS_ACCESS_KEY_ID="$(AWS_ACCESS_KEY_ID)"; | ||
export AWS_SECRET_ACCESS_KEY="$(AWS_SECRET_ACCESS_KEY)"; | ||
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root; | ||
export PATH=$HOME/.local/bin:$PATH; | ||
if [ "$(Build.SourceBranchName)" = "${BASE_BRANCH}" ]; then | ||
/tmp/cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" save stack; | ||
fi; | ||
/tmp/cache-s3 --prefix="${CACHE_S3_PREFIX}" --git-branch="$(Build.SourceBranchName)" --suffix="${OS_NAME}" save stack work | ||
env: | ||
OS_NAME: ${{ parameters.os }} | ||
displayName: 'Cache data' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
import Control.Monad (unless) | ||
import StackTest | ||
import Data.Set | ||
import Data.List (dropWhileEnd) | ||
import Data.Char (isSpace) | ||
|
||
main :: IO () | ||
main = do | ||
stackCheckStdout ["freeze"] $ \stdOut -> do | ||
let expected = unlines | ||
[ "resolver:" | ||
, " size: 527165" | ||
, " url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/11/19.yaml" | ||
, " sha256: 0116ad1779b20ad2c9d6620f172531f13b12bb69867e78f4277157e28865dfd4" | ||
, "extra-deps:" | ||
, "- hackage: a50-0.5@sha256:b8dfcc13dcbb12e444128bb0e17527a2a7a9bd74ca9450d6f6862c4b394ac054,1491" | ||
, " pantry-tree:" | ||
, " size: 409" | ||
, " sha256: a7c6151a18b04afe1f13637627cad4deff91af51d336c4f33e95fc98c64c40d3" | ||
] | ||
unless (stdOut == expected) $ | ||
error $ concat [ "Expected: " | ||
, show expected | ||
, "\nActual: " | ||
, show stdOut | ||
let contents = fromList [ | ||
"resolver:", | ||
"size: 527165", | ||
"url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/11/19.yaml", | ||
"sha256: 0116ad1779b20ad2c9d6620f172531f13b12bb69867e78f4277157e28865dfd4", | ||
"extra-deps:", | ||
"pantry-tree:", | ||
"hackage: a50-0.5@sha256:b8dfcc13dcbb12e444128bb0e17527a2a7a9bd74ca9450d6f6862c4b394ac054,1491", | ||
"size: 409", | ||
"sha256: a7c6151a18b04afe1f13637627cad4deff91af51d336c4f33e95fc98c64c40d3" | ||
] | ||
isLeadingYamlSymbol c = c == '-' | ||
trim str = dropWhileEnd isSpace $ dropWhile (\x -> isSpace x || isLeadingYamlSymbol x) str | ||
let stdOutLines = fromList $ Prelude.map trim (lines stdOut) | ||
unless (stdOutLines == contents) $ | ||
error $ concat [ "Expected: " | ||
, show contents | ||
, "\nActual: " | ||
, show stdOutLines | ||
] |