forked from psibi/fb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-linux-template.yml
66 lines (66 loc) · 2.21 KB
/
azure-linux-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
jobs:
- job: ${{ parameters.name }}
timeoutInMinutes: 180
pool:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
GHC 8.4:
ARGS: "--resolver lts-12"
GHC 8.6:
ARGS: "--resolver lts-14"
GHC 8.8:
ARGS: "--resolver lts-15"
nightly:
ARGS: "--resolver nightly"
steps:
- checkout: self
submodules: true
- script: |
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
export PATH=$HOME/.local/bin:$PATH
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'
env:
OS_NAME: ${{ parameters.os }}
displayName: 'Stack Installation'
- script: |
export CACHE_STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
export PATH=$HOME/.local/bin:$PATH
export CACHE_STACK_PROGRAMS=$(stack path --programs 2> /dev/null);
export CACHE_STACK_WORK="$(Build.SourcesDirectory)"/.stack-work
echo "##vso[task.setvariable variable=CACHE_ROOT]$CACHE_STACK_ROOT"
echo "##vso[task.setvariable variable=CACHE_WORK]$CACHE_STACK_WORK"
echo "##vso[task.setvariable variable=CACHE_PROGRAMS]$CACHE_STACK_PROGRAMS"
displayName: 'Set Cache Variables'
- task: Cache@2
inputs:
key: "stack-root $(Agent.OS) | $(ARGS) | stack.yaml"
restoreKeys: |
"stack-root $(Agent.OS) | $(ARGS)"
"stack-root $(Agent.OS)"
path: $(CACHE_ROOT)
displayName: Cache Stack root
- task: Cache@2
inputs:
key: "stack-work $(Agent.OS) | $(ARGS) | stack.yaml"
restoreKeys: |
"stack-work $(Agent.OS) | $(ARGS)"
"stack-work $(Agent.OS)"
path: $(CACHE_WORK)
displayName: Cache Stack work
- task: Cache@2
inputs:
key: "stack-programs $(Agent.OS) | $(ARGS) | stack.yaml"
restoreKeys: |
"stack-programs $(Agent.OS) | $(ARGS)"
"stack-programs $(Agent.OS)"
path: $(CACHE_PROGRAMS)
displayName: Cache Stack programs
- script: |
export STACK_ROOT="$(Build.SourcesDirectory)"/.stack-root;
export PATH=$HOME/.local/bin:$PATH
stack $ARGS build
env:
OS_NAME: ${{ parameters.os }}
displayName: 'Build and Test'