-
Notifications
You must be signed in to change notification settings - Fork 215
/
Copy pathazure-pipelines.yml
111 lines (93 loc) · 3.69 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
# Documentation: https://aka.ms/yaml
trigger:
batch: true
branches:
include:
# This is where pull requests from "bors r+" are built.
- staging
# This is where pull requests from "bors try" are built.
- trying
# Build pull requests.
- master
strategy:
matrix:
linux:
image_name: 'ubuntu-16.04'
rustup_toolchain: nightly
mac:
image_name: 'macos-10.13'
rustup_toolchain: nightly
windows:
image_name: 'vs2017-win2016'
rustup_toolchain: nightly
pool:
vmImage: $(image_name)
steps:
- bash: |
echo "Hello world from $AGENT_NAME running on $AGENT_OS"
echo "Reason: $BUILD_REASON"
case "$BUILD_REASON" in
"Manual") echo "$BUILD_REQUESTEDFOR manually queued the build." ;;
"PullRequest") echo "This is a CI build for a pull request on $BUILD_REQUESTEDFOR." ;;
"IndividualCI") echo "This is a CI build for $BUILD_REQUESTEDFOR." ;;
"BatchedCI") echo "This is a batched CI build for $BUILD_REQUESTEDFOR." ;;
*) "$BUILD_REASON" ;;
esac
displayName: 'Build Info'
continueOnError: true
- script: |
set -euxo pipefail
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
displayName: 'Install Rust (Linux/macOS)'
- script: curl -sSf -o rustup-init.exe https://win.rustup.rs && rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: 'Install Rust (Windows)'
- script: |
echo ##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: 'Add ~/.cargo/bin to PATH (Windows)'
- script: |
rustc -Vv
cargo -V
displayName: 'Print Rust Version'
continueOnError: true
- script: rustup component add rust-src llvm-tools-preview
displayName: 'Install Rustup Components'
- script: cargo install cargo-xbuild cargo-binutils --debug
displayName: 'Install cargo-xbuild cargo-binutils'
- script: sudo apt update && sudo apt install qemu-system-x86
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: 'Install QEMU (Linux)'
- script: |
set -euxo pipefail
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK=1
export HOMEBREW_NO_INSTALL_CLEANUP=1
brew install qemu
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: 'Install QEMU (macOS)'
- script: |
choco install qemu --limit-output --no-progress
echo ##vso[task.setvariable variable=PATH;]%PATH%;C:\Program Files\qemu
set PATH=%PATH%;C:\Program Files\qemu
qemu-system-x86_64 --version
condition: eq( variables['Agent.OS'], 'Windows_NT' )
failOnStderr: true
displayName: 'Install QEMU (Windows)'
- script: cargo xbuild
workingDirectory: test-kernel
displayName: 'Build Test Kernel'
- script: cargo xbuild --release
displayName: 'Build Bootloader'
env: { KERNEL: "test-kernel/target/x86_64-test-kernel/debug/test-kernel" }
- script: cargo objcopy -- -I elf64-x86-64 -O binary --binary-architecture=i386:x86-64 target/x86_64-bootloader/release/bootloader target/x86_64-bootloader/release/bootloader.bin
displayName: 'Convert Bootloader ELF to Binary'
- bash: |
qemu-system-x86_64 -drive format=raw,file=target/x86_64-bootloader/release/bootloader.bin -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none
if [ $? -eq 123 ]; then (exit 0); else (exit 1); fi
displayName: 'Test Bootloader'
- script: cargo xbuild
workingDirectory: example-kernel
displayName: 'Build Example Kernel'