-
Notifications
You must be signed in to change notification settings - Fork 68
142 lines (119 loc) · 3.63 KB
/
build.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
name: Build
on:
push:
branches:
- 'master'
tags:
- '*'
schedule:
- cron: '40 4 * * *' # every day at 4:40
pull_request:
jobs:
test:
name: "Test"
strategy:
fail-fast: false
matrix:
platform: [
ubuntu-latest,
macos-latest,
windows-latest
]
runs-on: ${{ matrix.platform }}
timeout-minutes: 15
steps:
- name: "Checkout Repository"
uses: actions/checkout@v1
- name: Set up Rustup
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: "Print Rust Version"
run: |
rustc -Vv
cargo -Vv
- name: "Run cargo build"
uses: actions-rs/cargo@v1
with:
command: build
- name: "Run cargo test"
uses: actions-rs/cargo@v1
with:
command: test
- name: "Deny Warnings"
uses: actions-rs/cargo@v1
with:
command: build
env:
RUSTFLAGS: "-D warnings"
- name: "Install it"
run: cargo install --path .
- name: "Switch to Rust nightly"
run: rustup default nightly
- name: "Install Rustup Components"
run: rustup component add rust-src llvm-tools-preview
# install QEMU
- name: Install QEMU (Linux)
run: |
sudo apt update
sudo apt install qemu-system-x86
if: runner.os == 'Linux'
- name: Install QEMU (macOS)
run: brew install qemu
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
- name: Install QEMU (Windows)
run: |
choco install qemu --version 2021.5.5
echo "$Env:Programfiles\qemu" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: runner.os == 'Windows'
shell: pwsh
- name: "Print QEMU Version"
run: qemu-system-x86_64 --version
- name: 'Build "basic" Kernel'
run: cargo bootimage --target ../x86_64-bootimage-example-kernels.json
working-directory: example-kernels/basic
- name: 'Run QEMU with "basic" Kernel'
run: |
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
if [ $? -eq 103 ]; then (exit 0); else (exit 1); fi
shell: bash {0}
working-directory: example-kernels
- name: 'Run `cargo run` for "runner" kernel'
run: |
cargo run
if [ $? -eq 109 ]; then (exit 0); else (exit 1); fi
shell: bash {0}
working-directory: example-kernels/runner
- run: cargo test
working-directory: example-kernels/runner-test
name: 'Run `cargo test` for "runner-test" kernel'
- run: cargo test -Z doctest-xcompile
working-directory: example-kernels/runner-doctest
name: 'Run `cargo test -Z doctest-xcompile` for "runner-doctest" kernel'
- run: cargo test
working-directory: example-kernels/runner-fail-reboot
name: 'Run `cargo test` for "runner-fail-reboot" kernel'
check_formatting:
name: "Check Formatting"
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v1
- run: rustup toolchain install nightly --profile minimal --component rustfmt
- run: cargo +nightly fmt -- --check
clippy:
name: "Clippy"
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v1
- run: rustup toolchain install nightly --profile minimal --component clippy
- name: "Run `cargo clippy`"
uses: actions-rs/cargo@v1
with:
command: clippy