Skip to content

Commit

Permalink
Merge pull request #39 from sysprog21/ci-autorun
Browse files Browse the repository at this point in the history
CI: Automate the runtime checks
  • Loading branch information
jserv authored Jan 20, 2024
2 parents af0b37a + ace0e7e commit ce7097d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .ci/autorun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

pkill -9 semu

expect <<DONE
set timeout 120
spawn make check
expect "buildroot login:" { send "root\n" } timeout { exit 1 }
expect "# " { send "uname -a\n" } timeout { exit 2 }
expect "riscv32 GNU/Linux" { send "\x01"; send "x" } timeout { exit 3 }
DONE

ret=$?
pkill -9 semu
echo

MESSAGES=("OK!" \
"Fail to boot" \
"Fail to login" \
"Fail to run commands" \
)

echo "${MESSAGES[$ret]}"
exit ${ret}
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ jobs:
- name: install-dependencies
run: |
sudo apt-get install build-essential device-tree-compiler
sudo apt-get install expect
- name: default build
run: make
shell: bash
- name: automated test
run: .ci/autorun.sh
shell: bash

coding_style:
runs-on: ubuntu-22.04
Expand All @@ -21,5 +25,5 @@ jobs:
- name: coding convention
run: |
sudo apt-get install -q -y clang-format-12
sh .ci/check-format.sh
.ci/check-format.sh
shell: bash

0 comments on commit ce7097d

Please sign in to comment.