Skip to content

Commit

Permalink
Merge pull request #59 from ChinYikMing/macOS-CI
Browse files Browse the repository at this point in the history
CI: Build on macOS
  • Loading branch information
jserv authored Sep 14, 2024
2 parents 92218e3 + d05f395 commit a0ad61b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
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)
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)) $$@.bz2" | $(SHA1SUM) -c
$(Q)echo "$(strip $$($(T)_DATA_SHA1)) $$@.bz2" | $(SHA1SUM) -c
$(Q)bunzip2 $$@.bz2
endef

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

0 comments on commit a0ad61b

Please sign in to comment.