Commit 510cbdd243e5402f8970a6e540fc56adad37cbca

Adrian Perez de Castro 2019-08-06T16:55:41

CI: Enable a macOS job

diff --git a/.azure-pipelines/steps/dependencies-macos.yml b/.azure-pipelines/steps/dependencies-macos.yml
new file mode 100644
index 0000000..a7efc4a
--- /dev/null
+++ b/.azure-pipelines/steps/dependencies-macos.yml
@@ -0,0 +1,9 @@
+---
+steps:
+  - bash: |
+      brew install meson doxygen bison
+      brew link bison --force
+    displayName: 'Dependencies (macOS)'
+    env:
+      HOMEBREW_NO_AUTO_UPDATE: 1
+      HOMEBREW_NO_INSTALL_CLEANUP: 1
diff --git a/.azure-pipelines/steps/meson.yml b/.azure-pipelines/steps/meson.yml
index b2a44c5..bb25197 100644
--- a/.azure-pipelines/steps/meson.yml
+++ b/.azure-pipelines/steps/meson.yml
@@ -1,10 +1,15 @@
 ---
 parameters:
   options: ""
+  wrapper: ""
   workdir: "meson-build"
 
 steps:
-  - bash: meson setup '${{ parameters.workdir }}' ${{ parameters.options }}
+  - bash: |
+      if [[ -x /usr/local/opt/bison/bin/bison ]] ; then
+        export PATH="/usr/local/opt/bison/bin:${PATH}"
+      fi
+      meson setup '${{ parameters.workdir }}' ${{ parameters.options }}
     displayName: 'Configuration (Meson)'
   - bash: ninja
     displayName: 'Build (Meson)'
@@ -12,8 +17,7 @@ steps:
     env:
       TERM: dumb
   - bash: |
-      meson test --print-errorlogs \
-        --wrap='valgrind --leak-check=full --track-origins=yes --error-exitcode=99'
+      meson test --print-errorlogs --wrap='${{ parameters.wrapper }}'
     displayName: 'Tests (Meson)'
     workingDirectory: ${{ parameters.workdir }}
   - bash: |
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index ca9bff5..70b4881 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -12,6 +12,7 @@ jobs:
       - template: .azure-pipelines/steps/meson.yml
         parameters:
           options: -Denable-wayland=false
+          wrapper: valgrind --leak-check=full --track-origins=yes --error-exitcode=99
   - job: 'Autotools'
     dependsOn: []
     pool:
@@ -19,3 +20,12 @@ jobs:
     steps:
       - template: .azure-pipelines/steps/dependencies-linux.yml
       - template: .azure-pipelines/steps/autotools.yml
+  - job: 'macOS'
+    dependsOn: []
+    pool:
+      vmImage: 'macos-10.13'
+    steps:
+      - template: .azure-pipelines/steps/dependencies-macos.yml
+      - template: .azure-pipelines/steps/meson.yml
+        parameters:
+          options: -Denable-wayland=false -Denable-x11=false