mirror of
https://github.com/autc04/Retro68.git
synced 2025-01-15 15:33:44 +00:00
Merge branch 'docker-build' - finally incorporate PR #193 :-)
This commit is contained in:
commit
4116be4acc
30
Dockerfile
30
Dockerfile
@ -1,15 +1,29 @@
|
|||||||
# vim:ft=dockerfile
|
# vim:ft=dockerfile
|
||||||
|
|
||||||
FROM ubuntu:18.04
|
# Base image
|
||||||
|
FROM ubuntu:20.04 AS base
|
||||||
|
|
||||||
RUN apt-get update && apt-get -y install \
|
RUN apt-get update && \
|
||||||
g++ \
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||||
cmake libgmp-dev libmpfr-dev libmpc-dev libboost-all-dev bison \
|
cmake libgmp-dev libmpfr-dev libmpc-dev \
|
||||||
zlib1g-dev \
|
libboost-all-dev bison texinfo \
|
||||||
perl texinfo
|
ruby flex curl g++ git
|
||||||
|
|
||||||
|
# Add toolchain to default PATH
|
||||||
|
ENV PATH=/Retro68-build/toolchain/bin:$PATH
|
||||||
|
WORKDIR /root
|
||||||
|
|
||||||
|
# Build image
|
||||||
|
FROM base AS build
|
||||||
|
|
||||||
ADD . /Retro68
|
ADD . /Retro68
|
||||||
|
|
||||||
RUN mkdir /Retro68-build
|
RUN mkdir /Retro68-build && \
|
||||||
|
bash -c "cd /Retro68-build && bash /Retro68/build-toolchain.bash"
|
||||||
|
|
||||||
RUN bash -c "cd /Retro68-build && bash /Retro68/build-toolchain.bash --clean-after-build"
|
# Release image
|
||||||
|
FROM base AS release
|
||||||
|
|
||||||
|
COPY --from=build /Retro68-build/toolchain /Retro68-build/toolchain
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.source https://github.com/autc04/Retro68
|
||||||
|
@ -5,36 +5,53 @@ jobs:
|
|||||||
|
|
||||||
- job: Linux
|
- job: Linux
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-20.04'
|
vmImage: 'ubuntu-latest'
|
||||||
timeoutInMinutes: 90
|
timeoutInMinutes: 90
|
||||||
|
variables:
|
||||||
|
- group: Tokens
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
submodules: true
|
submodules: true
|
||||||
- script: |
|
|
||||||
sudo apt-get update
|
- task: Docker@2
|
||||||
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \
|
inputs:
|
||||||
cmake libgmp-dev libmpfr-dev libmpc-dev \
|
command: build
|
||||||
libboost-all-dev bison texinfo \
|
repository: ghcr.io/autc04/retro68-build
|
||||||
ruby flex curl
|
tags: latest
|
||||||
displayName: 'Install prerequisites'
|
arguments: --target build
|
||||||
- script: |
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
../build-toolchain.bash
|
|
||||||
displayName: 'Build'
|
displayName: 'Build'
|
||||||
|
- task: Docker@2
|
||||||
|
inputs:
|
||||||
|
command: build
|
||||||
|
repository: ghcr.io/autc04/retro68
|
||||||
|
tags: latest
|
||||||
|
arguments: --target release
|
||||||
|
displayName: 'Build release'
|
||||||
- script: |
|
- script: |
|
||||||
cd build
|
docker run --name retro68-build --rm -i -d ghcr.io/autc04/retro68-build:latest
|
||||||
curl -L -O https://github.com/autc04/executor/releases/download/v0.1.0/Executor2000-0.1.0-Linux.tar.bz2
|
docker exec -i retro68-build /bin/bash <<"EOF"
|
||||||
tar xfvj Executor2000-0.1.0-Linux.tar.bz2 Executor2000-0.1.0-Linux/bin/executor-headless
|
cd /Retro68-build
|
||||||
echo "executor-path=`pwd`/Executor2000-0.1.0-Linux/bin/executor-headless" > ~/.LaunchAPPL.cfg
|
curl -L -O https://github.com/autc04/executor/releases/download/v0.1.0/Executor2000-0.1.0-Linux.tar.bz2
|
||||||
echo "emulator=executor" >> ~/.LaunchAPPL.cfg
|
tar xfvj Executor2000-0.1.0-Linux.tar.bz2 Executor2000-0.1.0-Linux/bin/executor-headless
|
||||||
ctest --no-compress-output -T test -E Carbon || true
|
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
|
displayName: Run Tests using Executor 2000
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFormat: 'CTest'
|
testResultsFormat: 'CTest'
|
||||||
testResultsFiles: build/Testing/**/*.xml
|
testResultsFiles: build/Testing/**/*.xml
|
||||||
buildPlatform: 'x86_64-linux'
|
buildPlatform: 'x86_64-linux'
|
||||||
|
- script: |
|
||||||
|
docker login ghcr.io/autc04 -u autc04 -p $GHCR_TOKEN
|
||||||
|
docker push ghcr.io/autc04/retro68
|
||||||
|
env:
|
||||||
|
GHCR_TOKEN: $(GHCR_TOKEN)
|
||||||
|
displayName: 'Push release to GHCR'
|
||||||
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
||||||
|
|
||||||
- job: macOS
|
- job: macOS
|
||||||
pool:
|
pool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user