summaryrefslogtreecommitdiff
path: root/azure-pipelines.yml
blob: 87eed89d15480c948fd1756efa3ac02a4052bf09 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
pr: none # comment out this line if you need to test this file on PR
trigger:
  - master
jobs:
- job: Linux
  pool:
    vmImage: 'ubuntu-16.04'
  strategy:
    matrix:
      bundled_gems:
        task: test-bundled-gems
      bundler:
        task: test-bundler
  steps:
  - task: UseRubyVersion@0
    inputs:
      versionSpec: '2.5.1'
  - script: |
      set -x
      sudo sed /etc/apt/sources.list -e "s/^# deb-src/deb-src/g" -i
      sudo apt-get update
      sudo apt-get build-dep ruby2.3
    displayName: "Install dependencies"
  - checkout: self
    fetchDepth: 10
  - script: |
      autoconf
      ./configure
      make
    displayName: 'make'
  - script: |
      make $(task) TRAVIS=1 TEST_BUNDLED_GEMS_ALLOW_FAILURES=minitest
    displayName: "test"
    continueOnError: true # test-bundler is failing on Linux. TODO: fix it and remove this line.

- job: macOS
  pool:
    vmImage: 'macos-10.13'
  strategy:
    matrix:
#      test:
#        task: test test-all
#      spec:
#        task: test-spec
      bundled_gems:
        task: test-bundled-gems
      bundler:
        task: test-bundler
  steps:
  - script: brew update && brew install autoconf bison openssl
    displayName: "Install dependencies"
  - checkout: self
    fetchDepth: 10
  - script: |
      autoconf
      ./configure --with-openssl-dir=/usr/local/opt/openssl
      make
    displayName: 'make'
  - script: |
      make $(task) TEST_BUNDLED_GEMS_ALLOW_FAILURES=minitest
    displayName: "test"

# - job: vs2015
#   pool:
#     vmImage: "vs2015-win2012r2"
#   strategy:
#     matrix:
#       test:
#         task: test test-all
#       spec:
#         task: test-spec
#       bundled_gems:
#         task: test-bundled-gems
#       bundler:
#         task: test-bundler
#   steps:
#   - script: vcpkg --triplet x64-windows install openssl readline zlib
#   - script: |
#       call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
#       cinst winflexbison
#       win32/configure.bat --without-ext=+,dbm,gdbm --enable-bundled-libffi --with-opt-dir=C:/vcpkg/installed/x64-windows
#     displayName: 'configure'
#   - script: |
#       call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
#       set YACC=win_bison
#       nmake up
#       nmake
#       set TRAVIS=1
#       nmake $(task)
#     displayName: "nmake"

- job: vs2017
  pool:
    vmImage: 'vs2017-win2016'
#  strategy:
#    matrix:
#      test:
#        task: test test-all
#      spec:
#        task: test-spec
#      bundled_gems:
#        task: test-bundled-gems
#      bundler:
#        task: test-bundler
  steps:
  # FIXME: Refactor this. Note that %errorlevel% does not work in for loop.
  - script: |
      vcpkg --triplet x64-windows install %dependencies% || (
        sleep 4 && vcpkg --triplet x64-windows install %dependencies%
      ) || (
        sleep 25 && vcpkg --triplet x64-windows install %dependencies%
      )
    env:
      dependencies: openssl readline zlib
    displayName: "Install dependencies"
  - checkout: self
    fetchDepth: 10
  - script: |
      call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
      cinst winflexbison
      win32/configure.bat --without-ext=+,dbm,gdbm --enable-bundled-libffi --with-opt-dir=C:/vcpkg/installed/x64-windows
    displayName: 'configure'
  - script: |
      call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
      set YACC=win_bison
      nmake up
      nmake
#      set TRAVIS=1
#      nmake $(task)
    displayName: "nmake"

- job: vs2019
  pool:
    vmImage: "windows-2019"
#   strategy:
#     matrix:
#       test:
#         task: test test-all
#       spec:
#         task: test-spec
#       bundled_gems:
#         task: test-bundled-gems
#       bundler:
#         task: test-bundler
  steps:
#   - script: vcpkg --triplet x64-windows install openssl readline zlib
  - checkout: self
    fetchDepth: 10
  - script: |
      call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Auxiliary\Build\vcvars64.bat"
      cinst winflexbison
      win32/configure.bat --without-ext=+,dbm,gdbm --enable-bundled-libffi --with-opt-dir=C:/vcpkg/installed/x64-windows
    displayName: 'configure'
    continueOnError: true # this started to fail after the vs2019 launch. TODO: fix it and remove this line.
  - script: |
      call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Auxiliary\Build\vcvars64.bat"
      set YACC=win_bison
      nmake up
      nmake
#       set TRAVIS=1
#       nmake $(task)
    displayName: "nmake"
    continueOnError: true # TODO: make 'configure' functional and remove this line.