mirror of
https://github.com/reanimate/reanimate.git
synced 2026-09-12 00:23:08 +00:00
Azure pipeline builds on linux, mac, and windows, with lts-13, lts-12, and lts-11. (#6)
Former-commit-id: 6601430ad697969649cebdc333481e09aec9569d
This commit is contained in:
parent
fc69131217
commit
f3ae9dd158
6 changed files with 280 additions and 45 deletions
115
.azure/azure-linux-template.yml
Normal file
115
.azure/azure-linux-template.yml
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
jobs:
|
||||
- job: ${{ parameters.name }}
|
||||
variables:
|
||||
STACK_ROOT: $(Build.SourcesDirectory)/.stack-root
|
||||
pool:
|
||||
vmImage: ${{ parameters.vmImage }}
|
||||
strategy:
|
||||
matrix:
|
||||
stack:
|
||||
BUILD: stack
|
||||
STACK_YAML: stack.yaml
|
||||
ARGS: --resolver lts-13.14
|
||||
stack-lts-12:
|
||||
BUILD: stack
|
||||
STACK_YAML: stack-lts-12.yaml
|
||||
stack-lts-11:
|
||||
BUILD: stack
|
||||
STACK_YAML: stack-lts-11.yaml
|
||||
maxParallel: 6
|
||||
steps:
|
||||
- task: CacheBeta@0
|
||||
inputs:
|
||||
key: ${{ parameters.name }} | ${{ parameters.vmImage }} | $(STACK_YAML) | stack-root | $(Agent.OS) | version4
|
||||
path: $(STACK_ROOT)
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: Cache stack root
|
||||
- bash: |
|
||||
echo REMOVE ME ONCE THIS IS FIXED https://github.com/microsoft/azure-pipelines-tasks/issues/10841
|
||||
cd "$(STACK_ROOT)"
|
||||
if [ -f "executable.txt" ]; then chmod +x $(cat executable.txt); fi
|
||||
condition: and(succeeded(), ne(variables['CACHE_RESTORED'], 'false'))
|
||||
- script: |
|
||||
mkdir -p ~/.local/bin
|
||||
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
||||
case "$BUILD" in
|
||||
style)
|
||||
PACKAGE=hlint
|
||||
echo "Downloading $PACKAGE now ..."
|
||||
|
||||
RELEASES=$(curl --silent https://github.com/ndmitchell/$PACKAGE/releases)
|
||||
URL=https://github.com/$(echo "$RELEASES" | grep -o '\"[^\"]*-x86_64-linux\.tar\.gz\"' | sed s/\"//g | head -n1)
|
||||
VERSION=$(echo "$URL" | sed -e 's/.*-\([\.0-9]\+\)-x86_64-linux\.tar\.gz/\1/')
|
||||
|
||||
curl --progress-bar --location -o"$PACKAGE.tar.gz" "$URL"
|
||||
tar -xzf "$PACKAGE.tar.gz" -C .
|
||||
mv "$PACKAGE-$VERSION" "$PACKAGE"
|
||||
export PATH="$(pwd)"/hlint:$PATH
|
||||
;;
|
||||
cabal)
|
||||
sudo add-apt-repository -y ppa:hvr/ghc
|
||||
sudo apt-get update
|
||||
sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
|
||||
# See note here: https://github.com/haskell-CI/haskell-ci#alex--happy-with-ghc--78
|
||||
if [ "$GHCVER" = "head" ] || [ "${GHCVER%.*}" = "7.8" ] || [ "${GHCVER%.*}" = "7.10" ]; then
|
||||
sudo apt-get install happy-1.19.4 alex-3.1.3
|
||||
export PATH=/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:$PATH
|
||||
else
|
||||
sudo apt-get install happy alex
|
||||
fi
|
||||
export PATH=$HOME/.local/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
|
||||
cabal --version
|
||||
cabal update
|
||||
PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@')
|
||||
cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
|
||||
;;
|
||||
*)
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
stack --install-ghc $ARGS test --only-dependencies
|
||||
;;
|
||||
esac
|
||||
set -ex
|
||||
case "$BUILD" in
|
||||
style)
|
||||
hlint src/
|
||||
;;
|
||||
cabal)
|
||||
cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES
|
||||
|
||||
ORIGDIR=$(pwd)
|
||||
for dir in $PACKAGES
|
||||
do
|
||||
cd $dir
|
||||
cabal check || [ "$CABALVER" == "1.16" ]
|
||||
cabal sdist
|
||||
PKGVER=$(cabal info . | awk '{print $2;exit}')
|
||||
SRC_TGZ=$PKGVER.tar.gz
|
||||
cd dist
|
||||
tar zxfv "$SRC_TGZ"
|
||||
cd "$PKGVER"
|
||||
cabal configure --enable-tests --ghc-options -O0
|
||||
cabal build
|
||||
if [ "$CABALVER" = "1.16" ] || [ "$CABALVER" = "1.18" ]; then
|
||||
cabal test
|
||||
else
|
||||
cabal test --show-details=streaming
|
||||
fi
|
||||
cd $ORIGDIR
|
||||
done
|
||||
;;
|
||||
*)
|
||||
stack $ARGS test
|
||||
;;
|
||||
esac
|
||||
set +ex
|
||||
env:
|
||||
OS_NAME: ${{ parameters.os }}
|
||||
displayName: 'Installation ${{parameters.os}} & Test'
|
||||
- bash: |
|
||||
echo REMOVE ME ONCE THIS IS FIXED https://github.com/microsoft/azure-pipelines-tasks/issues/10841
|
||||
cd "$(STACK_ROOT)"
|
||||
rm executable.txt
|
||||
find . -perm +111 >> executable.txt
|
||||
find . -executable >> executable.txt
|
||||
cat executable.txt
|
||||
displayName: Save list of files with executable bit set
|
||||
48
.azure/azure-osx-template.yml
Normal file
48
.azure/azure-osx-template.yml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
jobs:
|
||||
- job: ${{ parameters.name }}
|
||||
variables:
|
||||
STACK_ROOT: $(Build.SourcesDirectory)/.stack-root
|
||||
pool:
|
||||
vmImage: ${{ parameters.vmImage }}
|
||||
strategy:
|
||||
matrix:
|
||||
stack:
|
||||
BUILD: stack
|
||||
STACK_YAML: stack.yaml
|
||||
stack-lts-12:
|
||||
BUILD: stack
|
||||
STACK_YAML: stack-lts-12.yaml
|
||||
stack-lts-11:
|
||||
BUILD: stack
|
||||
STACK_YAML: stack-lts-11.yaml
|
||||
maxParallel: 6
|
||||
steps:
|
||||
- task: CacheBeta@0
|
||||
inputs:
|
||||
key: ${{ parameters.name }} | "${{ parameters.vmImage }}" | $(STACK_YAML) | stack-root | $(Agent.OS)
|
||||
path: $(STACK_ROOT)
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: Cache stack root
|
||||
- bash: |
|
||||
echo REMOVE ME ONCE THIS IS FIXED https://github.com/microsoft/azure-pipelines-tasks/issues/10841
|
||||
cd "$(STACK_ROOT)"
|
||||
if [ -f "executable.txt" ]; then chmod +x $(cat executable.txt); fi
|
||||
condition: and(succeeded(), ne(variables['CACHE_RESTORED'], 'false'))
|
||||
- script: |
|
||||
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
|
||||
mkdir -p ~/.local/bin
|
||||
curl -skL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin;
|
||||
export PATH=$HOME/.local/bin:$PATH
|
||||
stack --install-ghc $ARGS test --only-dependencies
|
||||
stack $ARGS test
|
||||
env:
|
||||
OS_NAME: ${{ parameters.os }}
|
||||
displayName: 'Installation ${{parameters.os}} & Test'
|
||||
- bash: |
|
||||
echo REMOVE ME ONCE THIS IS FIXED https://github.com/microsoft/azure-pipelines-tasks/issues/10841
|
||||
cd "$(STACK_ROOT)"
|
||||
rm executable.txt
|
||||
find . -perm +111 >> executable.txt
|
||||
find . -executable >> executable.txt
|
||||
cat executable.txt
|
||||
displayName: Save list of files with executable bit set
|
||||
47
.azure/azure-windows-template.yml
Normal file
47
.azure/azure-windows-template.yml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
jobs:
|
||||
- job: ${{ parameters.name }}
|
||||
variables:
|
||||
STACK_ROOT: $(Build.SourcesDirectory)/.stack-root
|
||||
pool:
|
||||
vmImage: ${{ parameters.vmImage }}
|
||||
strategy:
|
||||
matrix:
|
||||
stack:
|
||||
BUILD: stack
|
||||
STACK_YAML: stack.yaml
|
||||
stack-lts-12:
|
||||
BUILD: stack
|
||||
STACK_YAML: stack-lts-12.yaml
|
||||
stack-lts-11:
|
||||
BUILD: stack
|
||||
STACK_YAML: stack-lts-11.yaml
|
||||
maxParallel: 6
|
||||
steps:
|
||||
- task: CacheBeta@0
|
||||
inputs:
|
||||
key: ${{ parameters.name }} | ${{ parameters.vmImage }} | $(STACK_YAML) | stack-root | $(Agent.OS)
|
||||
path: $(STACK_ROOT)
|
||||
cacheHitVar: CACHE_RESTORED
|
||||
displayName: Cache stack root
|
||||
- bash: |
|
||||
echo REMOVE ME ONCE THIS IS FIXED https://github.com/microsoft/azure-pipelines-tasks/issues/10841
|
||||
cd "$(STACK_ROOT)"
|
||||
if [ -f "executable.txt" ]; then chmod +x $(cat executable.txt); fi
|
||||
condition: and(succeeded(), ne(variables['CACHE_RESTORED'], 'false'))
|
||||
- bash: |
|
||||
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
|
||||
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
|
||||
unzip -o /usr/bin/stack.zip -d /usr/bin/
|
||||
stack --install-ghc $ARGS test --only-dependencies
|
||||
stack $ARGS test
|
||||
env:
|
||||
OS_NAME: ${{ parameters.os }}
|
||||
displayName: 'Installation ${{parameters.os}} & Test'
|
||||
- bash: |
|
||||
echo REMOVE ME ONCE THIS IS FIXED https://github.com/microsoft/azure-pipelines-tasks/issues/10841
|
||||
cd "$(STACK_ROOT)"
|
||||
rm executable.txt
|
||||
find . -perm +111 >> executable.txt
|
||||
find . -executable >> executable.txt
|
||||
cat executable.txt
|
||||
displayName: Save list of files with executable bit set
|
||||
Loading…
Reference in a new issue