Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Build on macOS #59

Merged
merged 3 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .ci/autorun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,18 @@ function ASSERT {

cleanup

# macOS needs more time to boot compared to Linux, so the timeout is set to
# 600 seconds for macOS to handle the longer startup. For Linux, 90 seconds
# is sufficient due to its faster boot process.
UNAME_S=$(uname -s)
ChinYikMing marked this conversation as resolved.
Show resolved Hide resolved
if [[ ${UNAME_S} == "Darwin" ]]; then
TIMEOUT=600
else # Linux
TIMEOUT=90
fi

ASSERT expect <<DONE
set timeout 90
set timeout ${TIMEOUT}
spawn make check
expect "buildroot login:" { send "root\n" } timeout { exit 1 }
expect "# " { send "uname -a\n" } timeout { exit 2 }
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@ name: CI
on: [push, pull_request]

jobs:
rv32emu:
semu-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: install-dependencies
run: |
sudo apt-get install build-essential device-tree-compiler
sudo apt-get install expect
run: |
sudo apt-get install build-essential device-tree-compiler expect
- name: default build
run: make
shell: bash
- name: automated test
run: .ci/autorun.sh
shell: bash

semu-macOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: install-dependencies
run: |
brew install make dtc expect e2fsprogs
- name: default build
run: make
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions mk/external.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ define download
$($(T)_DATA):
$(VECHO) " GET\t$$@\n"
$(Q)curl --progress-bar -O -L -C - "$(strip $($(T)_DATA_URL))"
$(Q)echo "$(strip $$($(T)_DATA_SHA1)) [email protected]" | $(SHA1SUM) -c
$(Q)echo "$(strip $$($(T)_DATA_SHA1)) [email protected]" | $(SHA1SUM) -c
$(Q)bunzip2 [email protected]
endef

EXTERNAL_DATA = KERNEL INITRD
$(foreach T,$(EXTERNAL_DATA),$(eval $(download)))
$(foreach T,$(EXTERNAL_DATA),$(eval $(download)))