-
Notifications
You must be signed in to change notification settings - Fork 54
/
azure-pipelines.yml
159 lines (152 loc) · 5.07 KB
/
azure-pipelines.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
trigger:
- master
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-latest'
timeoutInMinutes: 90
variables:
- group: Tokens
steps:
- checkout: self
submodules: true
- task: Docker@2
inputs:
command: build
repository: ghcr.io/autc04/retro68-build
tags: latest
arguments: --target build
displayName: 'Build'
- task: Docker@2
inputs:
command: build
repository: ghcr.io/autc04/retro68
tags: latest
arguments: --target release
displayName: 'Build release'
- script: |
docker run --name retro68-build --rm -i -d ghcr.io/autc04/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'
- 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
pool:
vmImage: 'macOS-13'
timeoutInMinutes: 90
steps:
- checkout: self
submodules: true
- script: |
brew install boost cmake gmp mpfr libmpc bison texinfo
displayName: 'Brew prerequisites'
- script: |
mkdir build
cd build
../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
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'
- job: NixLinux
strategy:
matrix:
M68K:
TARGET: m68k
PowerPC:
TARGET: powerpc
Carbon:
TARGET: carbon
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix \
| sh -s -- install --no-confirm --extra-conf "trusted-users = root vsts"
displayName: Install Nix
- script: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use autc04
displayName: Setup Cachix
- checkout: self
submodules: false
- script: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
nix develop .#${TARGET} --profile dev-profile -c true
nix build .#samples-${TARGET} --out-link CompiledSamples
displayName: Build
- publish: CompiledSamples
artifact: Samples ($(TARGET))
- script: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
export CACHIX_AUTH_TOKEN=$(CACHIX_AUTH_TOKEN)
cachix push autc04 dev-profile
cachix push autc04 CompiledSamples
displayName: Push to Cachix
condition: and(succeeded(), ne(variables['CACHIX_AUTH_TOKEN'], ''))
- job: NixMac
strategy:
matrix:
M68K:
TARGET: m68k
PowerPC:
TARGET: powerpc
Carbon:
TARGET: carbon
pool:
vmImage: 'macOS-latest'
timeoutInMinutes: 90
steps:
- script: |
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix \
| sh -s -- install --no-confirm --extra-conf "trusted-users = root runner"
displayName: Install Nix
- script: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use autc04
displayName: Setup Cachix
- checkout: self
submodules: false
- script: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
nix develop .#${TARGET} --profile dev-profile -c true
nix build .#samples-${TARGET} --out-link CompiledSamples
displayName: Build
- script: |
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
export CACHIX_AUTH_TOKEN=$(CACHIX_AUTH_TOKEN)
cachix push autc04 dev-profile
cachix push autc04 CompiledSamples
displayName: Push to Cachix
condition: and(succeeded(), ne(variables['CACHIX_AUTH_TOKEN'], ''))