Skip to content

Commit a024f7c

Browse files
authored
FIX CI: fix errors of example and build (#13)
* CI: update example CI * CI: add -no-pie when build x64_64 * ci: fixup write output.log when test example
1 parent 5896967 commit a024f7c

File tree

2 files changed

+8
-38
lines changed

2 files changed

+8
-38
lines changed

.github/workflows/example.yaml

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -48,44 +48,10 @@ jobs:
4848
run: yes | pacman -Syy make cmake rustup gcc
4949
- name: setup rust toolchain
5050
run: rustup default nightly && cargo install cargo-binutils
51-
- name: Test ${{ matrix.arch }}
52-
run: cd example && PATH=$PATH:~/.cargo/bin make ARCH=${{ matrix.arch }} build
5351
- name: Install Qemu
5452
run: yes | pacman -Syy ${{ matrix.packages }}
55-
- name: Test run
56-
run: cd example && PATH=$PATH:~/.cargo/bin make ARCH=${{ matrix.arch }} run
53+
- name: Run Example
54+
run: PATH=$PATH:~/.cargo/bin make ARCH=${{ matrix.arch }} example > output.log
5755
timeout-minutes: 1
58-
59-
template:
60-
runs-on: ubuntu-latest
61-
container:
62-
image: archlinux:base
63-
volumes:
64-
- .:/code
65-
strategy:
66-
fail-fast: false
67-
matrix:
68-
arch: [x86_64, riscv64, aarch64, loongarch64]
69-
include:
70-
- arch: aarch64
71-
packages: qemu-system-aarch64
72-
- arch: riscv64
73-
packages: qemu-system-riscv
74-
- arch: x86_64
75-
packages: qemu-system-x86
76-
- arch: loongarch64
77-
packages: qemu-system-loongarch64
78-
steps:
79-
- name: Install generaic tools
80-
run: yes | pacman -Syy make cmake rustup gcc git libgit2 libgit2-glib pkgconf openssl
81-
- name: Install Rust toolchain
82-
run: rustup default stable && cargo install cargo-binutils && cargo install cargo-generate
83-
- name: generate by template
84-
run: USER=test cargo generate --git https://github.com/Byte-OS/polyhal-template.git -n test-polyhal
85-
- name: Install Qemu
86-
run: yes | pacman -Syy ${{ matrix.packages }}
87-
- name: test run
88-
run: cd test-polyhal && (PATH=$PATH:~/.cargo/bin timeout 60 make ARCH=${{ matrix.arch }} run > output.log) || echo "qemu exited!"
89-
timeout-minutes: 2
90-
- name: test log
91-
run: grep "\[kernel\] exited successfully" test-polyhal/output.log
56+
- name: Parse Ouput
57+
run: grep "Run END. Shutdown successfully." output.log

.github/workflows/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ jobs:
3030
- name: setup rust toolchain
3131
run: rustup default nightly && cargo install cargo-binutils && rustup target add ${{ matrix.target }}
3232
- name: Test Build ${{ matrix.arch }}
33+
if: matrix.arch == 'x86_64'
34+
run: RUSTFLAGS=-Clink-arg=-no-pie cargo build --release --target ${{ matrix.target}} --all-features
35+
- name: Test Build ${{ matrix.arch }}
36+
if: matrix.arch != 'x86_64'
3337
run: cargo build --release --target ${{ matrix.target}} --all-features

0 commit comments

Comments
 (0)