Commit af22f9dc2217692b612786f9f24eba44976909db

Adrian Perez de Castro 2019-08-06T16:24:43

CI: Make Autotools and Meson builds parallel This splits the steps for installing dependencies into a new template file, as well as the build steps for Autotools. Both gets used to define two jobs which can run in parallel for both build systems.

diff --git a/.azure-pipelines/steps/autotools.yml b/.azure-pipelines/steps/autotools.yml
new file mode 100644
index 0000000..3de1e32
--- /dev/null
+++ b/.azure-pipelines/steps/autotools.yml
@@ -0,0 +1,23 @@
+---
+parameters:
+  options: ""
+  workdir: "autotools-build"
+
+steps:
+  - bash: |
+      mkdir '${{ parameters.workdir }}' && cd "$_"
+      ../autogen.sh ${{ parameters.options }}
+    displayName: 'Configuration (Autotools)'
+  - bash: make -j$(nproc)
+    displayName: 'Build (Autotools)'
+    workingDirectory: ${{ parameters.workdir }}
+  - bash: make check
+    displayName: 'Tests (Autotools)'
+    workingDirectory: ${{ parameters.workdir }}
+  - bash: |
+      shopt -s nullglob
+      for file in "$(pwd)"/*.log ; do
+        echo "##vso[task.uploadfile]${file}"
+      done
+    displayName: 'Save Results (Autotools)'
+    condition: always()
diff --git a/.azure-pipelines/steps/dependencies-linux.yml b/.azure-pipelines/steps/dependencies-linux.yml
new file mode 100644
index 0000000..c572cc6
--- /dev/null
+++ b/.azure-pipelines/steps/dependencies-linux.yml
@@ -0,0 +1,13 @@
+---
+steps:
+  - task: UsePythonVersion@0
+    inputs:
+      versionSpec: '3.7'
+    displayName: 'Use Python 3.7'
+  - bash: |
+      python -m pip install --upgrade pip meson
+      sudo apt update -y
+      sudo env DEBIAN_FRONTEND=noninteractive apt install -y \
+        xutils-dev doxygen libxcb-xkb-dev valgrind meson libwayland-dev \
+        wayland-protocols bison valgrind
+    displayName: 'Dependencies (GNU/Linux)'
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 8833e82..ca9bff5 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -1,27 +1,21 @@
+---
 trigger:
   - ci-azure
 
 jobs:
-  - job: 'Ubuntu_16_04'
+  - job: 'Meson'
+    dependsOn: []
     pool:
       vmImage: 'ubuntu-16.04'
     steps:
-      - task: UsePythonVersion@0
-        inputs:
-          versionSpec: '3.7'
-        displayName: 'Use Python 3.7'
-      - script: |
-          python -m pip install --upgrade pip meson
-          sudo apt update -y
-          sudo env DEBIAN_FRONTEND=noninteractive apt install -y \
-            xutils-dev doxygen libxcb-xkb-dev valgrind meson libwayland-dev \
-            wayland-protocols bison valgrind
-        displayName: 'Install dependencies'
-      - script: |
-          mkdir autotools-build && pushd autotools-build
-          ../autogen.sh && make -j$(nproc) && make check
-          popd
-        displayName: 'Autotools'
+      - template: .azure-pipelines/steps/dependencies-linux.yml
       - template: .azure-pipelines/steps/meson.yml
         parameters:
           options: -Denable-wayland=false
+  - job: 'Autotools'
+    dependsOn: []
+    pool:
+      vmImage: 'ubuntu-16.04'
+    steps:
+      - template: .azure-pipelines/steps/dependencies-linux.yml
+      - template: .azure-pipelines/steps/autotools.yml