Retro68/azure-pipelines.yml

149 lines
4.5 KiB
YAML
Raw Normal View History

2019-09-27 21:06:18 +00:00
trigger:
- master
2022-01-03 20:51:35 +00:00
2019-09-27 21:06:18 +00:00
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-20.04'
2022-01-17 20:39:58 +00:00
timeoutInMinutes: 90
2019-09-27 21:06:18 +00:00
steps:
- checkout: self
submodules: true
- script: |
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \
2019-09-27 21:06:18 +00:00
cmake libgmp-dev libmpfr-dev libmpc-dev \
libboost-all-dev bison texinfo \
ruby flex curl
displayName: 'Install prerequisites'
2019-09-27 21:06:18 +00:00
- script: |
mkdir build
cd build
2019-11-11 23:07:39 +00:00
../build-toolchain.bash
displayName: 'Build'
2019-09-28 22:22:44 +00:00
- script: |
cd build
curl -L -O https://github.com/autc04/executor/releases/download/v0.1.0/Executor2000-0.1.0-Linux.tar.bz2
2019-09-28 22:22:44 +00:00
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
2019-11-11 23:07:39 +00:00
ctest --no-compress-output -T test -E Carbon || true
displayName: Run Tests using Executor 2000
2019-09-28 22:22:44 +00:00
- task: PublishTestResults@2
inputs:
testResultsFormat: 'CTest'
testResultsFiles: build/Testing/**/*.xml
buildPlatform: 'x86_64-linux'
2019-09-27 21:06:18 +00:00
- job: macOS
pool:
vmImage: 'macOS-11'
2022-01-17 20:39:58 +00:00
timeoutInMinutes: 90
2019-09-27 21:06:18 +00:00
steps:
- checkout: self
submodules: true
- script: |
brew install boost cmake gmp mpfr libmpc bison
displayName: 'Brew prerequisites'
2019-09-27 21:06:18 +00:00
- script: |
mkdir build
cd build
2019-11-11 23:07:39 +00:00
../build-toolchain.bash
displayName: Build
- script: |
cd build
curl -L -O https://github.com/autc04/executor/releases/download/v0.1.0/Executor2000-0.1.0-Darwin.tar.bz2
tar xfvj Executor2000-0.1.0-Darwin.tar.bz2 Executor2000-0.1.0-Darwin/bin/executor-headless
echo "executor-path=`pwd`/Executor2000-0.1.0-Darwin/bin/executor-headless" > ~/.LaunchAPPL.cfg
echo "emulator=executor" >> ~/.LaunchAPPL.cfg
2019-11-11 23:07:39 +00:00
ctest --no-compress-output -T test -E Carbon || true
displayName: Run Tests using Executor 2000
- task: PublishTestResults@2
inputs:
testResultsFormat: 'CTest'
testResultsFiles: build/Testing/**/*.xml
buildPlatform: 'x86_64-macos'
2021-12-08 21:40:19 +00:00
2022-01-18 23:10:50 +00:00
- job: NixLinux
2022-01-18 23:09:34 +00:00
strategy:
matrix:
M68K:
TARGET: m68k
PowerPC:
TARGET: powerpc
2022-01-18 23:58:03 +00:00
Carbon:
TARGET: carbon
maxParallel: 2
2021-12-08 21:40:19 +00:00
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
submodules: true
- script: |
2022-01-04 00:10:47 +00:00
docker run -i --name nix -v`pwd`:/src nixos/nix:2.3.12 <<EOF
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use autc04
2022-01-18 23:06:02 +00:00
nix-build src -A ${TARGET}.retro68.samples
2021-12-11 17:09:08 +00:00
EOF
2021-12-08 22:45:58 +00:00
displayName: Build inside nixos/nix docker
2021-12-08 22:14:39 +00:00
- script: |
2022-01-03 20:32:01 +00:00
mkdir CompiledSamples
cd CompiledSamples
2021-12-08 22:14:39 +00:00
docker cp -L nix:result - | tar x --strip-components 1
2021-12-08 22:45:58 +00:00
displayName: Copy result out of docker
2021-12-08 22:14:39 +00:00
2022-01-03 20:32:01 +00:00
- publish: CompiledSamples
2022-01-18 23:06:02 +00:00
artifact: Samples ($(TARGET))
2022-01-04 00:10:47 +00:00
- script: |
2022-08-01 16:06:16 +00:00
docker start nix -i <<EOF || true
set -e
export CACHIX_AUTH_TOKEN=$(CACHIX_AUTH_TOKEN)
cd src
nix-build -A ${TARGET}.retro68.samples | cachix push autc04
nix-shell -A ${TARGET} --command exit
nix-store -qR --include-outputs \$(nix-instantiate default.nix -A ${TARGET}) | cachix push autc04
2022-01-04 00:10:47 +00:00
EOF
displayName: Push to Cachix
2022-08-01 16:06:16 +00:00
condition: and(succeeded(), ne(variables['CACHIX_AUTH_TOKEN'], ''))
2021-12-08 21:40:19 +00:00
2022-01-18 23:10:50 +00:00
- job: NixMac
2022-01-18 23:09:34 +00:00
strategy:
matrix:
M68K:
TARGET: m68k
PowerPC:
TARGET: powerpc
2022-01-18 23:58:03 +00:00
Carbon:
TARGET: carbon
maxParallel: 2
2022-01-17 22:12:07 +00:00
pool:
vmImage: 'macOS-11'
steps:
- script: |
2022-01-18 08:35:00 +00:00
export NIX_EXTRA_CONF="trusted-users = root runner"
2022-01-17 22:12:07 +00:00
sh <(curl -L https://nixos.org/nix/install)
displayName: Install nix
- script: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
2022-01-17 23:05:48 +00:00
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use autc04
2022-01-17 23:41:23 +00:00
displayName: setup cachix
- checkout: self
submodules: false
- script: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
2022-01-18 23:06:02 +00:00
nix-build -A $(TARGET).retro68.samples
2022-01-17 22:12:07 +00:00
displayName: build
2022-01-17 23:05:48 +00:00
- script: |
2022-01-17 23:41:23 +00:00
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
export CACHIX_AUTH_TOKEN=$(CACHIX_AUTH_TOKEN)
2022-08-01 16:06:16 +00:00
nix-build -A $(TARGET).retro68.samples | (cachix push autc04 || true)
2022-01-18 23:06:02 +00:00
nix-shell -A $(TARGET) --command exit
2022-08-01 16:06:16 +00:00
nix-store -qR --include-outputs `nix-instantiate default.nix -A $(TARGET)` | (cachix push autc04 || true)
2022-01-17 23:05:48 +00:00
displayName: Push to Cachix
2022-08-01 16:06:16 +00:00
condition: and(succeeded(), ne(variables['CACHIX_AUTH_TOKEN'], ''))