CI: some tweaks [ran: extracted generic bits from Windows commit.] Signed-off-by: Ran Benita <ran@unusedvar.com>
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
diff --git a/.azure-pipelines/steps/dependencies-linux.yml b/.azure-pipelines/steps/dependencies-linux.yml
index 76ef5be..6d6bcce 100644
--- a/.azure-pipelines/steps/dependencies-linux.yml
+++ b/.azure-pipelines/steps/dependencies-linux.yml
@@ -4,7 +4,9 @@ steps:
inputs:
versionSpec: '3.7'
displayName: 'Use Python 3.7'
+
- bash: |
+ set -euo pipefail
python -m pip install --upgrade pip meson
sudo apt update -y
sudo env DEBIAN_FRONTEND=noninteractive apt install -y \
diff --git a/.azure-pipelines/steps/dependencies-macos.yml b/.azure-pipelines/steps/dependencies-macos.yml
index a7efc4a..387d56c 100644
--- a/.azure-pipelines/steps/dependencies-macos.yml
+++ b/.azure-pipelines/steps/dependencies-macos.yml
@@ -1,6 +1,7 @@
---
steps:
- bash: |
+ set -euo pipefail
brew install meson doxygen bison
brew link bison --force
displayName: 'Dependencies (macOS)'
diff --git a/.azure-pipelines/steps/meson.yml b/.azure-pipelines/steps/meson.yml
index e9ec6dd..5348cbe 100644
--- a/.azure-pipelines/steps/meson.yml
+++ b/.azure-pipelines/steps/meson.yml
@@ -1,45 +1,34 @@
---
parameters:
- compiler: ""
+ compiler: "cc"
options: ""
wrapper: ""
- workdir: "meson-build"
+ prepare: ""
steps:
- - bash: |
- if [[ -x /usr/local/opt/bison/bin/bison ]] ; then
- export PATH="/usr/local/opt/bison/bin:${PATH}"
- fi
- export COMPILER=${{ parameters.compiler }}
- case ${COMPILER:-default} in
- clang ) export CC=clang CXX=clang++ ;;
- gcc ) export CC=gcc CXX=g++ ;;
- esac
- meson setup '${{ parameters.workdir }}' ${{ parameters.options }}
- displayName: 'Configuration (Meson)'
- - bash: ninja
- displayName: 'Build (Meson)'
- workingDirectory: ${{ parameters.workdir }}
+ - script: |
+ ${{ parameters.prepare }}
+ meson setup ${{ parameters.options }} build
+ displayName: 'Setup'
+ env:
+ CC: ${{ parameters.compiler }}
+
+ - script: |
+ ${{ parameters.prepare }}
+ ninja -C build
+ displayName: 'Build'
env:
TERM: dumb
+
- bash: |
- meson test --print-errorlogs --wrap='${{ parameters.wrapper }}'
- displayName: 'Tests (Meson)'
- workingDirectory: ${{ parameters.workdir }}
- - bash: |
- shopt -s nullglob
- for file in "$(pwd)"/meson-logs/* ; do
- echo "##vso[task.uploadfile]${file}"
- done
- for file in "$(pwd)"/meson-logs/*.json ; do
- python3 ../scripts/meson-junit-report.py --project-name=xkbcommon \
- --job-id='$(Build.BuildId)' --branch='$(Build.SourceBranch)' \
- --output="${file}-junit.xml" "${file}"
- done
- displayName: 'Process Results (Meson)'
- workingDirectory: ${{ parameters.workdir }}
- condition: always()
+ set -euo pipefail
+ meson test -C build --print-errorlogs --wrapper="${{ parameters.wrapper }}"
+ python3 scripts/meson-junit-report.py --project-name=xkbcommon \
+ --job-id='$(Build.BuildId)' --branch='$(Build.SourceBranch)' \
+ --output=testlog.xml build/meson-logs/testlog*.json
+ displayName: 'Test'
+
- task: PublishTestResults@2
inputs:
- testResultsFiles: '**/*-junit.xml'
+ testResultsFiles: 'testlog.xml'
failTaskOnFailedTests: true
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 3479aec..f5308a7 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -17,6 +17,7 @@ jobs:
compiler: $(compiler)
options: -Denable-wayland=false
wrapper: valgrind --leak-check=full --track-origins=yes --error-exitcode=99
+
- job: 'macOS'
dependsOn: []
pool:
@@ -26,3 +27,4 @@ jobs:
- template: .azure-pipelines/steps/meson.yml
parameters:
options: -Denable-wayland=false -Denable-x11=false
+ prepare: 'export PATH="/usr/local/opt/bison/bin:${PATH}"'