-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
76 lines (68 loc) · 2.32 KB
/
azure-pipelines.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
67
68
69
70
71
72
73
74
75
76
# Enable builds on all branches
trigger:
branches:
include:
- master
# Enable PR triggers that target the master branch
pr:
autoCancel: true # cancel previous builds on push
branches:
include:
- master
jobs:
- job: build_and_test
timeoutInMinutes: 120
pool:
vmImage: "Ubuntu-16.04"
steps:
- checkout: self
# Install DAML SDK, possibly from cache
- bash: |
set -euo pipefail
cat daml.yaml | grep -oP '(?<=sdk-version: ).*' > /tmp/SDK_VERSION
- task: CacheBeta@1
inputs:
key: /tmp/SDK_VERSION
path: /tmp/daml
cacheHitVar: DAML_CACHE_HIT
- bash: |
set -euo pipefail
DIR=$(pwd)
# Install DAML SDK
SDK_VERSION=$(cat /tmp/SDK_VERSION)
curl https://get.daml.com | sh -s $SDK_VERSION
mkdir -p /tmp/daml
cd $HOME/.daml
tar czf /tmp/daml/sdk.tar.gz *
condition: ne(variables.DAML_CACHE_HIT, 'true')
displayName: daml-cache-miss
- bash: |
set -euo pipefail
mkdir -p $HOME/.daml
cd $HOME/.daml
tar xzf /tmp/daml/sdk.tar.gz
condition: eq(variables.DAML_CACHE_HIT, 'true')
displayName: daml-cache-hit
# Build and test TypeScript
- bash: |
set -euo pipefail
yarn --version
export PATH=$HOME/.daml/bin:$PATH
daml build
daml codegen ts -o daml2ts -p package.json .daml/dist/*.dar
yarn install
yarn workspaces run build
yarn workspaces run lint
#CI=yes yarn workspaces run test --ci --all
displayName: build-and-test-ts
#- bash: |
# set -euo pipefail
# # FIXME: where should notifications go for this project?
# MESSAGE=$(git log --pretty=format:%s -n1)
# curl -XPOST \
# -i \
# -H 'Content-type: application/json' \
# --data "{\"text\":\"<!here> *FAILED* $(Agent.JobName) ($(Build.SourceBranchName)): <https://dev.azure.com/digitalasset/create-daml-app/_build/results?buildId=$(Build.BuildId)|$MESSAGE>\n\"}" \
# $(Slack.URL)
# condition: and(false,failed(), in(variables['Build.SourceBranchName'], 'direct-messaging', 'master'))
# displayName: tell-slack-if-failed