From b30bf21c82cf2ad9641ef104736556a2429f3d5e Mon Sep 17 00:00:00 2001 From: Adrian Perez de Castro Date: Mon, 12 Aug 2019 23:14:25 +0300 Subject: CI: some tweaks [ran: extracted generic bits from Windows commit.] Signed-off-by: Ran Benita --- .azure-pipelines/steps/dependencies-linux.yml | 2 + .azure-pipelines/steps/dependencies-macos.yml | 1 + .azure-pipelines/steps/meson.yml | 55 +++++++++++---------------- azure-pipelines.yml | 2 + 4 files changed, 27 insertions(+), 33 deletions(-) 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}"' -- cgit v1.2.3