summaryrefslogtreecommitdiff
path: root/azure-pipelines-ci.yml
blob: ea7f355141d047d051a1137437ca3e9b8eb1299c (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
trigger:
- master
pr:
- master

jobs:
- job: windows
  displayName: 'Windows'
  pool:
    vmImage: 'VS2017-Win2016'

  strategy:
    matrix:
      Win32:
        BuildPlatform: 'Win32'
      Win64:
        BuildPlatform: 'x64'

  steps:
  # Rebase to origin/master for every PR. This means users don't have to
  # rebase every time master changes. As long as the PR applies cleanly, we
  # will validate it.
  - script: |
      git config user.email 'info@openttd.org'
      git config user.name 'OpenTTD CI'
      git rebase origin/master
    displayName: 'Rebase to master'
  - bash: |
      set -ex
      curl -L https://github.com/OpenTTD/OpenTTD-CF/releases/download/latest/windows-dependencies.zip > windows-dependencies.zip
      unzip windows-dependencies.zip
      rm -f windows-dependencies.zip
    displayName: 'Download dependencies'
    workingDirectory: $(Build.ArtifactStagingDirectory)
  - script: $(Build.ArtifactStagingDirectory)\windows-dependencies\vcpkg.exe integrate install
    displayName: 'Install dependencies'
  - task: VSBuild@1
    displayName: 'Build'
    inputs:
      solution: 'projects/openttd_vs141.sln'
      platform: $(BuildPlatform)
      configuration: Release
      maximumCpuCount: true
  # Running the regression is currently not possibe via MSVC (console is not redirected)

- job: linux
  displayName: 'Linux'
  pool:
    vmImage: 'ubuntu-16.04'

  strategy:
    matrix:
      commit-checker: {}
      linux-amd64-clang-3.8: {}
      linux-amd64-gcc-6: {}
      linux-i386-gcc-6: {}

  steps:
  # Rebase to origin/master for every PR. This means users don't have to
  # rebase every time master changes. As long as the PR applies cleanly, we
  # will validate it.
  - script: |
      git config user.email 'info@openttd.org'
      git config user.name 'OpenTTD CI'
      git rebase origin/master
    displayName: 'Rebase to master'
  - task: Docker@1
    displayName: 'Build and test'
    inputs:
      command: 'Run an image'
      imageName: openttd/compile-farm-ci:$(Agent.JobName)
      volumes: '$(Build.SourcesDirectory):$(Build.SourcesDirectory)'
      workingDirectory: '$(Build.SourcesDirectory)'
      runInBackground: false

- job: macos
  displayName: 'MacOS'
  pool:
    vmImage: 'macOS-10.13'

  steps:
  # Rebase to origin/master for every PR. This means users don't have to
  # rebase every time master changes. As long as the PR applies cleanly, we
  # will validate it.
  - script: |
      git config user.email 'info@openttd.org'
      git config user.name 'OpenTTD CI'
      git rebase origin/master
    displayName: 'Rebase to master'
  - script: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config lzo xz libpng
    displayName: 'Install dependencies'
  - bash: |
      set -ex
      mkdir -p ~/Documents/OpenTTD/baseset
      cd ~/Documents/OpenTTD/baseset
      wget https://binaries.openttd.org/extra/opengfx/0.5.2/opengfx-0.5.2-all.zip
      unzip opengfx-0.5.2-all.zip
      rm -f opengfx-0.5.2-all.zip
    displayName: 'Install OpenGFX'
  - script: './configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig --enable-static'
    displayName: 'Configure'
  - script: 'make -j2'
    displayName: 'Build'
  - script: 'make regression'
    displayName: 'Test'