aboutsummaryrefslogtreecommitdiffhomepage
path: root/azure-pipelines.yml
blob: 6c5282ea15a9b7c448a15aa1fe445e219aaf0482 (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
# Avoid lengthy LLVM rebuilds on each newly pushed branch. Pull requests will
# be built anyway.
trigger:
- release
- dev

jobs:
- job: Build
  timeoutInMinutes: 240 # 4h
  pool:
    vmImage: 'VS2017-Win2016'
  steps:
    - task: GoTool@0
      inputs:
        version: '1.16'
    - checkout: self
      fetchDepth: 1
    - task: Cache@2
      displayName: Cache LLVM source
      inputs:
        key: llvm-source-11-windows-v1
        path: llvm-project
    - task: Bash@3
      displayName: Download LLVM source
      inputs:
        targetType: inline
        script: make llvm-source
    - task: CacheBeta@0
      displayName: Cache LLVM build
      inputs:
        key: llvm-build-11-windows-v4
        path: llvm-build
    - task: Bash@3
      displayName: Build LLVM
      inputs:
        targetType: inline
        script: |
          if [ ! -f llvm-build/lib/liblldELF.a ]
          then
            # install dependencies
            choco install ninja
            # hack ninja to use fewer jobs
            echo -e 'C:\\ProgramData\\Chocolatey\\bin\\ninja -j4 %*' > /usr/bin/ninja.bat
            # build!
            make llvm-build
          fi
    - task: Bash@3
      displayName: Install QEMU
      inputs:
        targetType: inline
        script: choco install qemu --version=2020.06.12
    - task: CacheBeta@0
      displayName: Cache wasi-libc sysroot
      inputs:
        key: wasi-libc-sysroot-v4
        path: lib/wasi-libc/sysroot
    - task: Bash@3
      displayName: Build wasi-libc
      inputs:
        targetType: inline
        script: PATH=/usr/bin:$PATH make wasi-libc
    - task: Bash@3
      displayName: Test TinyGo
      inputs:
        targetType: inline
        script: |
          export PATH="$PATH:./llvm-build/bin:/c/Program Files/qemu"
          unset GOROOT
          make test
    - task: Bash@3
      displayName: Build TinyGo release tarball
      inputs:
        targetType: inline
        script: |
          export PATH="$PATH:./llvm-build/bin:/c/Program Files/qemu"
          unset GOROOT
          make build/release -j4
    - publish: $(System.DefaultWorkingDirectory)/build/release/tinygo
      displayName: Publish zip as artifact
      artifact: tinygo
    - task: Bash@3
      displayName: Smoke tests
      inputs:
        targetType: inline
        script: |
          export PATH="$PATH:./llvm-build/bin:/c/Program Files/qemu"
          unset GOROOT
          make smoketest TINYGO=build/tinygo AVR=0 XTENSA=0