File tree 3 files changed +41
-0
lines changed
3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Run tests
2
+ run-name : Run tests
3
+ on :
4
+ push :
5
+ branches : [ main ]
6
+ pull_request :
7
+ branches : [ main ]
8
+
9
+ jobs :
10
+ run-tests :
11
+ runs-on : ubuntu-22.04
12
+ steps :
13
+ - name : Check out source Repo
14
+ uses : actions/checkout@v3
15
+ - name : Build test container image
16
+ run : docker build -t test_image .
17
+ - name : Run tests in container image
18
+ run : docker run --rm -i test_image cargo test
Original file line number Diff line number Diff line change @@ -2,15 +2,24 @@ FROM rust:1.73-slim-bullseye
2
2
3
3
WORKDIR /builder
4
4
5
+ RUN apt-get update && \
6
+ apt-get install -y --no-install-recommends qemu-system=1:5.2+dfsg-11+deb11u3 && \
7
+ apt-get clean && \
8
+ rm -rf /var/lib/apt/lists/*
9
+
5
10
COPY ./.cargo ./.cargo
6
11
COPY ./src ./src
7
12
COPY ./Cargo.toml .
8
13
COPY ./Cargo.lock .
9
14
COPY ./rust-toolchain.toml .
10
15
COPY ./x86_64-os.json .
16
+ COPY ./tests ./tests
11
17
12
18
RUN cargo install bootimage && \
19
+ rustup toolchain install nightly-aarch64-unknown-linux-gnu && \
20
+ rustup toolchain install nightly-x86_64-unknown-linux-gnu && \
13
21
rustup component add rust-src --toolchain nightly-aarch64-unknown-linux-gnu && \
22
+ rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu && \
14
23
rustup component add llvm-tools-preview
15
24
16
25
CMD ["cargo" ,"bootimage" ]
Original file line number Diff line number Diff line change @@ -39,3 +39,17 @@ Hobby OS implementation in Rust
39
39
` ` ` bash
40
40
qemu-system-x86_64 -drive format=raw,file=target/x86_64-os/debug/bootimage-os.bin
41
41
` ` `
42
+
43
+ # # Tests
44
+
45
+ Run tests in Docker:
46
+
47
+ ` ` ` bash
48
+ docker run --rm -it $( docker build -q .) cargo test
49
+ ` ` `
50
+
51
+ Run tests on host system:
52
+
53
+ ` ` ` bash
54
+ cargo test
55
+ ` ` `
You can’t perform that action at this time.
0 commit comments