Skip to content

Commit b1d741f

Browse files
azure-pipelines[bot]phil-opp
authored andcommitted
Set up CI with Azure Pipelines (#43)
1 parent c48ad15 commit b1d741f

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

azure-pipelines.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Documentation: https://aka.ms/yaml
2+
3+
trigger:
4+
batch: true
5+
branches:
6+
include:
7+
# This is where pull requests from "bors r+" are built.
8+
- staging
9+
# This is where pull requests from "bors try" are built.
10+
- trying
11+
# Build pull requests.
12+
- master
13+
# Build post braches
14+
- post-*
15+
16+
strategy:
17+
matrix:
18+
linux:
19+
image_name: 'ubuntu-16.04'
20+
rustup_toolchain: nightly
21+
mac:
22+
image_name: 'macos-10.13'
23+
rustup_toolchain: nightly
24+
windows:
25+
image_name: 'vs2017-win2016'
26+
rustup_toolchain: nightly
27+
28+
pool:
29+
vmImage: $(image_name)
30+
31+
steps:
32+
- bash: |
33+
echo "Hello world from $AGENT_NAME running on $AGENT_OS"
34+
echo "Reason: $BUILD_REASON"
35+
case "$BUILD_REASON" in
36+
"Manual") echo "$BUILD_REQUESTEDFOR manually queued the build." ;;
37+
"PullRequest") echo "This is a CI build for a pull request on $BUILD_REQUESTEDFOR." ;;
38+
"IndividualCI") echo "This is a CI build for $BUILD_REQUESTEDFOR." ;;
39+
"BatchedCI") echo "This is a batched CI build for $BUILD_REQUESTEDFOR." ;;
40+
*) "$BUILD_REASON" ;;
41+
esac
42+
displayName: 'Build Info'
43+
continueOnError: true
44+
45+
- script: |
46+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
47+
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
48+
condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
49+
displayName: 'Install Rust (Linux/macOS)'
50+
51+
- script: |
52+
curl -sSf -o rustup-init.exe https://win.rustup.rs
53+
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
54+
echo ##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin
55+
condition: eq( variables['Agent.OS'], 'Windows_NT' )
56+
displayName: 'Install Rust (Windows)'
57+
58+
- script: |
59+
rustc -Vv
60+
cargo -V
61+
displayName: 'Print Rust Version'
62+
continueOnError: true
63+
64+
- script: rustup component add rust-src
65+
displayName: 'Install Rustup Src Component'
66+
67+
- script: |
68+
cargo install cargo-xbuild --debug
69+
cargo install bootimage --debug
70+
displayName: 'Install cargo-xbuild and bootimage'
71+
72+
- script: sudo apt install qemu-system-x86
73+
condition: eq( variables['Agent.OS'], 'Linux' )
74+
displayName: 'Install QEMU (Linux)'
75+
76+
- script: |
77+
export HOMEBREW_NO_AUTO_UPDATE=1
78+
export HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK=1
79+
export HOMEBREW_NO_INSTALL_CLEANUP=1
80+
brew install qemu
81+
condition: eq( variables['Agent.OS'], 'Darwin' )
82+
displayName: 'Install QEMU (macOS)'
83+
84+
- script: |
85+
choco install qemu --limit-output --no-progress
86+
echo ##vso[task.setvariable variable=PATH;]%PATH%;C:\Program Files\qemu
87+
set PATH=%PATH%;C:\Program Files\qemu
88+
qemu-system-x86_64 --version
89+
condition: eq( variables['Agent.OS'], 'Windows_NT' )
90+
displayName: 'Install QEMU (Windows)'
91+
92+
- script: |
93+
cd example-kernel
94+
cargo xbuild --target x86_64-example-kernel.json
95+
cd ..
96+
displayName: 'Build Example Kernel'
97+
98+
- script: |
99+
cd builder
100+
cargo run -- --kernel ../example-kernel/target/x86_64-example-kernel/debug/example-kernel
101+
cd ..
102+
displayName: 'Build Bootloader'
103+
104+
- bash: |
105+
qemu-system-x86_64 -drive format=raw,file=target/x86_64-bootloader/release/bootimage.bin -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none
106+
if [ $? -eq 123 ]; then (exit 0); else (exit 1); fi
107+
displayName: 'Test Bootloader'
108+
109+
- script: |
110+
cd builder
111+
cargo run -- --kernel ../example-kernel/target/x86_64-example-kernel/debug/example-kernel --features vga_320x200
112+
cd ..
113+
displayName: 'Build Bootloader (Feature vga_320x200)'
114+
115+
- bash: |
116+
qemu-system-x86_64 -drive format=raw,file=target/x86_64-bootloader/release/bootimage.bin -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none
117+
if [ $? -eq 123 ]; then (exit 0); else (exit 1); fi
118+
displayName: 'Test Bootloader (Feature vga_320x200)'

0 commit comments

Comments
 (0)