This repository has been archived by the owner on Jan 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathazure-pipelines.yml
63 lines (57 loc) · 1.65 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
# 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-18.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 js -o ui/daml.js .daml/dist/*.dar
cd ui
yarn install --force --frozen-lockfile
yarn build
#CI=yes yarn workspaces run test --ci --all
displayName: build-and-test-ts