@@ -11,117 +11,192 @@ trigger:
11
11
# Build pull requests.
12
12
- master
13
13
14
- strategy :
15
- matrix :
16
- linux :
17
- image_name : ' ubuntu-16.04'
18
- rustup_toolchain : stable
19
- mac :
20
- image_name : ' macos-10.13'
21
- rustup_toolchain : stable
22
- windows :
23
- image_name : ' vs2017-win2016'
24
- rustup_toolchain : stable
25
-
26
- pool :
27
- vmImage : $(image_name)
28
-
29
- steps :
30
- - bash : |
31
- echo "Hello world from $AGENT_NAME running on $AGENT_OS"
32
- echo "Reason: $BUILD_REASON"
33
- case "$BUILD_REASON" in
34
- "Manual") echo "$BUILD_REQUESTEDFOR manually queued the build." ;;
35
- "PullRequest") echo "This is a CI build for a pull request on $BUILD_REQUESTEDFOR." ;;
36
- "IndividualCI") echo "This is a CI build for $BUILD_REQUESTEDFOR." ;;
37
- "BatchedCI") echo "This is a batched CI build for $BUILD_REQUESTEDFOR." ;;
38
- *) "$BUILD_REASON" ;;
39
- esac
40
- displayName : ' Build Info'
41
- continueOnError : true
42
-
43
- - script : |
44
- set -euxo pipefail
45
- curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
46
- echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
47
- condition : or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
48
- displayName : ' Install Rust (Linux/macOS)'
49
-
50
- - script : curl -sSf -o rustup-init.exe https://win.rustup.rs && rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
51
- condition : eq( variables['Agent.OS'], 'Windows_NT' )
52
- displayName : ' Install Rust (Windows)'
53
-
54
- - script : |
55
- echo ##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin
56
- condition : eq( variables['Agent.OS'], 'Windows_NT' )
57
- displayName : ' Add ~/.cargo/bin to PATH (Windows)'
58
-
59
- - script : |
60
- rustc -Vv
61
- cargo -V
62
- displayName : ' Print Rust Version'
63
- continueOnError : true
64
-
65
- - script : cargo build
66
- displayName : ' Build'
67
-
68
- - script : cargo test
69
- displayName : ' Test'
70
-
71
- - script : rustup component add rust-src llvm-tools-preview
72
- displayName : ' Install Rustup Components'
73
-
74
- - script : cargo install cargo-xbuild --debug
75
- displayName : ' Install cargo-xbuild'
76
-
77
- - script : sudo apt update && sudo apt install qemu-system-x86
78
- condition : eq( variables['Agent.OS'], 'Linux' )
79
- displayName : ' Install QEMU (Linux)'
80
-
81
- - script : |
82
- set -euxo pipefail
83
- export HOMEBREW_NO_AUTO_UPDATE=1
84
- export HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK=1
85
- export HOMEBREW_NO_INSTALL_CLEANUP=1
86
- brew install qemu
87
- condition : eq( variables['Agent.OS'], 'Darwin' )
88
- displayName : ' Install QEMU (macOS)'
89
-
90
- - script : |
91
- choco install qemu --limit-output --no-progress
92
- echo ##vso[task.setvariable variable=PATH;]%PATH%;C:\Program Files\qemu
93
- set PATH=%PATH%;C:\Program Files\qemu
94
- qemu-system-x86_64 --version
95
- condition : eq( variables['Agent.OS'], 'Windows_NT' )
96
- failOnStderr : true
97
- displayName : ' Install QEMU (Windows)'
98
-
99
- - script : cargo install --path . --force --debug
100
- displayName : ' Install this bootimage version'
101
-
102
- - script : rustup toolchain add nightly
103
- displayName : ' Install Rust Nightly'
104
-
105
- - script : bootimage build --target x86_64-basic.json && file target/x86_64-basic/debug/bootimage-basic.bin
106
- workingDirectory : example-kernels/basic
107
- displayName : ' Build Example Kernel "Basic"'
108
-
109
- - script : bootimage run --target x86_64-basic.json
110
- workingDirectory : example-kernels/basic
111
- displayName : ' Run Example Kernel "basic"'
112
-
113
- - script : bootimage build && file target/x86_64-default-target/debug/bootimage-default-target-bootimage.bin
114
- workingDirectory : example-kernels/default-target-bootimage
115
- displayName : ' Build Example Kernel "default-target-bootimage"'
116
-
117
- - script : bootimage run
118
- workingDirectory : example-kernels/default-target-bootimage
119
- displayName : ' Run Example Kernel "default-target-bootimage"'
120
-
121
- - script : bootimage build && file target/x86_64-default-target/debug/bootimage-default-target-cargo.bin
122
- workingDirectory : example-kernels/default-target-cargo
123
- displayName : ' Build Example Kernel "default-target-cargo"'
124
-
125
- - script : bootimage run
126
- workingDirectory : example-kernels/default-target-cargo
127
- displayName : ' Run Example Kernel "default-target-cargo"'
14
+ jobs :
15
+ - job : build
16
+ displayName : Build
17
+ strategy :
18
+ matrix :
19
+ linux :
20
+ image_name : ' ubuntu-16.04'
21
+ rustup_toolchain : stable
22
+ mac :
23
+ image_name : ' macos-10.13'
24
+ rustup_toolchain : stable
25
+ windows :
26
+ image_name : ' vs2017-win2016'
27
+ rustup_toolchain : stable
28
+
29
+ pool :
30
+ vmImage : $(image_name)
31
+
32
+ steps :
33
+ - bash : |
34
+ echo "Hello world from $AGENT_NAME running on $AGENT_OS"
35
+ echo "Reason: $BUILD_REASON"
36
+ case "$BUILD_REASON" in
37
+ "Manual") echo "$BUILD_REQUESTEDFOR manually queued the build." ;;
38
+ "PullRequest") echo "This is a CI build for a pull request on $BUILD_REQUESTEDFOR." ;;
39
+ "IndividualCI") echo "This is a CI build for $BUILD_REQUESTEDFOR." ;;
40
+ "BatchedCI") echo "This is a batched CI build for $BUILD_REQUESTEDFOR." ;;
41
+ *) "$BUILD_REASON" ;;
42
+ esac
43
+ displayName: 'Build Info'
44
+ continueOnError: true
45
+
46
+ - script : |
47
+ set -euxo pipefail
48
+ curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
49
+ echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
50
+ condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
51
+ displayName: 'Install Rust (Linux/macOS)'
52
+
53
+ - script : curl -sSf -o rustup-init.exe https://win.rustup.rs && rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
54
+ condition : eq( variables['Agent.OS'], 'Windows_NT' )
55
+ displayName : ' Install Rust (Windows)'
56
+
57
+ - script : |
58
+ echo ##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin
59
+ condition: eq( variables['Agent.OS'], 'Windows_NT' )
60
+ displayName: 'Add ~/.cargo/bin to PATH (Windows)'
61
+
62
+ - script : |
63
+ rustc -Vv
64
+ cargo -V
65
+ displayName: 'Print Rust Version'
66
+ continueOnError: true
67
+
68
+ - script : cargo build
69
+ displayName : ' Build'
70
+
71
+ - script : cargo test
72
+ displayName : ' Test'
73
+
74
+
75
+ - job : test
76
+ displayName : Test
77
+
78
+ strategy :
79
+ matrix :
80
+ linux :
81
+ image_name : ' ubuntu-16.04'
82
+ rustup_toolchain : nightly
83
+ mac :
84
+ image_name : ' macos-10.13'
85
+ rustup_toolchain : nightly
86
+ windows :
87
+ image_name : ' vs2017-win2016'
88
+ rustup_toolchain : nightly
89
+
90
+ pool :
91
+ vmImage : $(image_name)
92
+
93
+ steps :
94
+ - bash : |
95
+ echo "Hello world from $AGENT_NAME running on $AGENT_OS"
96
+ echo "Reason: $BUILD_REASON"
97
+ case "$BUILD_REASON" in
98
+ "Manual") echo "$BUILD_REQUESTEDFOR manually queued the build." ;;
99
+ "PullRequest") echo "This is a CI build for a pull request on $BUILD_REQUESTEDFOR." ;;
100
+ "IndividualCI") echo "This is a CI build for $BUILD_REQUESTEDFOR." ;;
101
+ "BatchedCI") echo "This is a batched CI build for $BUILD_REQUESTEDFOR." ;;
102
+ *) "$BUILD_REASON" ;;
103
+ esac
104
+ displayName: 'Build Info'
105
+ continueOnError: true
106
+
107
+ - script : |
108
+ set -euxo pipefail
109
+ curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
110
+ echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
111
+ condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
112
+ displayName: 'Install Rust (Linux/macOS)'
113
+
114
+ - script : curl -sSf -o rustup-init.exe https://win.rustup.rs && rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
115
+ condition : eq( variables['Agent.OS'], 'Windows_NT' )
116
+ displayName : ' Install Rust (Windows)'
117
+
118
+ - script : |
119
+ echo ##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin
120
+ condition: eq( variables['Agent.OS'], 'Windows_NT' )
121
+ displayName: 'Add ~/.cargo/bin to PATH (Windows)'
122
+
123
+ - script : |
124
+ rustc -Vv
125
+ cargo -V
126
+ displayName: 'Print Rust Version'
127
+ continueOnError: true
128
+
129
+ - script : rustup component add rust-src llvm-tools-preview
130
+ displayName : ' Install Rustup Components'
131
+
132
+ - script : cargo install cargo-xbuild --debug
133
+ displayName : ' Install cargo-xbuild'
134
+
135
+ - script : sudo apt update && sudo apt install qemu-system-x86
136
+ condition : eq( variables['Agent.OS'], 'Linux' )
137
+ displayName : ' Install QEMU (Linux)'
138
+
139
+ - script : |
140
+ set -euxo pipefail
141
+ export HOMEBREW_NO_AUTO_UPDATE=1
142
+ export HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK=1
143
+ export HOMEBREW_NO_INSTALL_CLEANUP=1
144
+ brew install qemu
145
+ condition: eq( variables['Agent.OS'], 'Darwin' )
146
+ displayName: 'Install QEMU (macOS)'
147
+
148
+ - script : |
149
+ choco install qemu --limit-output --no-progress
150
+ echo ##vso[task.setvariable variable=PATH;]%PATH%;C:\Program Files\qemu
151
+ set PATH=%PATH%;C:\Program Files\qemu
152
+ qemu-system-x86_64 --version
153
+ condition: eq( variables['Agent.OS'], 'Windows_NT' )
154
+ failOnStderr: true
155
+ displayName: 'Install QEMU (Windows)'
156
+
157
+ - script : cargo install --path . --force --debug
158
+ displayName : ' Install this bootimage version'
159
+
160
+ - script : bootimage build --target ../x86_64-bootimage-example-kernels.json
161
+ workingDirectory : example-kernels/basic
162
+ displayName : ' Build "basic" Kernel'
163
+
164
+ - bash : |
165
+ qemu-system-x86_64 -drive format=raw,file=target/x86_64-bootimage-example-kernels/debug/bootimage-basic.bin -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none
166
+ if [ $? -eq 103 ]; then (exit 0); else (exit 1); fi
167
+ workingDirectory: example-kernels
168
+ displayName: 'Run QEMU with "basic" Kernel'
169
+
170
+ - bash : |
171
+ bootimage run --target ../x86_64-bootimage-example-kernels.json -- -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none
172
+ if [ $? -eq 103 ]; then (exit 0); else (exit 1); fi
173
+ workingDirectory: example-kernels/basic
174
+ displayName: 'Check Exit Code of `bootimage run` for "basic" kernel'
175
+
176
+ - bash : |
177
+ bootimage run -- -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none
178
+ if [ $? -eq 105 ]; then (exit 0); else (exit 1); fi
179
+ workingDirectory: example-kernels/default-target-bootimage
180
+ displayName: 'Check Exit Code of `bootimage run` for "default-target-bootimage" kernel'
181
+
182
+ - bash : |
183
+ bootimage run -- -device isa-debug-exit,iobase=0xf4,iosize=0x04 -display none
184
+ if [ $? -eq 107 ]; then (exit 0); else (exit 1); fi
185
+ workingDirectory: example-kernels/default-target-cargo
186
+ displayName: 'Check Exit Code of `bootimage run` for "default-target-cargo" kernel'
187
+
188
+ - script : bootimage test
189
+ workingDirectory : example-kernels/testing-serial-result
190
+ displayName : ' Run `bootimage test` for "testing-serial-result" kernel'
191
+
192
+ - script : bootimage test
193
+ workingDirectory : example-kernels/testing-qemu-exit-code
194
+ displayName : ' Run `bootimage test` for "testing-qemu-exit-code" kernel'
195
+
196
+ - script : cargo xrun
197
+ workingDirectory : example-kernels/runner
198
+ displayName : ' Run `cargo xrun` for "runner" kernel'
199
+
200
+ - script : cargo test
201
+ workingDirectory : example-kernels/tester
202
+ displayName : ' Run `cargo test` for "tester" kernel'
0 commit comments