CI: Make Autotools and Meson builds parallel
authorAdrian Perez de Castro <aperez@igalia.com>
Tue, 6 Aug 2019 13:24:43 +0000 (16:24 +0300)
committerRan Benita <ran234@gmail.com>
Fri, 9 Aug 2019 20:01:27 +0000 (23:01 +0300)
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.

.azure-pipelines/steps/autotools.yml [new file with mode: 0644]
.azure-pipelines/steps/dependencies-linux.yml [new file with mode: 0644]
azure-pipelines.yml

diff --git a/.azure-pipelines/steps/autotools.yml b/.azure-pipelines/steps/autotools.yml
new file mode 100644 (file)
index 0000000..3de1e32
--- /dev/null
@@ -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 (file)
index 0000000..c572cc6
--- /dev/null
@@ -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)'
index 8833e82..ca9bff5 100644 (file)
@@ -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