From 3a4468b27023b69f4f15be4f97baad65fa4d1b07 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Fri, 21 Oct 2022 15:00:55 +0100 Subject: [PATCH] azure-pipelines.yml: switch from host build to container build This has two main advantages: firstly it means that the Dockerfile is being tested as part of the pipeline when changes are merged into master, and secondly it allows testing of Linux builds without requiring a separate job for Docker that can consume even more CI minutes. In order to test the container image it is necessary to manually start the build image using docker run, execute the tests, and then copy the results back to the host ready for publishing. Note that since the base OS image is now handled by docker we can switch the host to use the 'ubuntu-latest' image rather than the older 'ubuntu-20.04' image. --- azure-pipelines.yml | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3959607112..47bd19e2d0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,34 +5,33 @@ jobs: - job: Linux pool: - vmImage: 'ubuntu-20.04' + vmImage: 'ubuntu-latest' timeoutInMinutes: 90 steps: - checkout: self submodules: true - - script: | - sudo apt-get update - DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \ - cmake libgmp-dev libmpfr-dev libmpc-dev \ - libboost-all-dev bison texinfo \ - ruby flex curl - displayName: 'Install prerequisites' - - script: | - mkdir build - cd build - ../build-toolchain.bash + - task: Docker@2 + inputs: + command: build + repository: ghcr.io/mcayland/retro68-build + tags: latest + arguments: --target build displayName: 'Build' - script: | - cd build - curl -L -O https://github.com/autc04/executor/releases/download/v0.1.0/Executor2000-0.1.0-Linux.tar.bz2 - tar xfvj Executor2000-0.1.0-Linux.tar.bz2 Executor2000-0.1.0-Linux/bin/executor-headless - echo "executor-path=`pwd`/Executor2000-0.1.0-Linux/bin/executor-headless" > ~/.LaunchAPPL.cfg - echo "emulator=executor" >> ~/.LaunchAPPL.cfg - ctest --no-compress-output -T test -E Carbon || true + docker run --name retro68-build --rm -i -d ghcr.io/mcayland/retro68-build:latest + docker exec -i retro68-build /bin/bash <<"EOF" + cd /Retro68-build + curl -L -O https://github.com/autc04/executor/releases/download/v0.1.0/Executor2000-0.1.0-Linux.tar.bz2 + tar xfvj Executor2000-0.1.0-Linux.tar.bz2 Executor2000-0.1.0-Linux/bin/executor-headless + echo "executor-path=`pwd`/Executor2000-0.1.0-Linux/bin/executor-headless" > ~/.LaunchAPPL.cfg + echo "emulator=executor" >> ~/.LaunchAPPL.cfg + ctest --no-compress-output -T test -E Carbon || true + EOF + mkdir build && docker cp retro68-build:/Retro68-build/Testing build + docker stop retro68-build displayName: Run Tests using Executor 2000 - task: PublishTestResults@2 inputs: testResultsFormat: 'CTest' testResultsFiles: build/Testing/**/*.xml buildPlatform: 'x86_64-linux' -