Skip to content

Commit a0ad61b

Browse files
authored
Merge pull request #59 from ChinYikMing/macOS-CI
CI: Build on macOS
2 parents 92218e3 + d05f395 commit a0ad61b

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.ci/autorun.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,18 @@ function ASSERT {
1616

1717
cleanup
1818

19+
# macOS needs more time to boot compared to Linux, so the timeout is set to
20+
# 600 seconds for macOS to handle the longer startup. For Linux, 90 seconds
21+
# is sufficient due to its faster boot process.
22+
UNAME_S=$(uname -s)
23+
if [[ ${UNAME_S} == "Darwin" ]]; then
24+
TIMEOUT=600
25+
else # Linux
26+
TIMEOUT=90
27+
fi
28+
1929
ASSERT expect <<DONE
20-
set timeout 90
30+
set timeout ${TIMEOUT}
2131
spawn make check
2232
expect "buildroot login:" { send "root\n" } timeout { exit 1 }
2333
expect "# " { send "uname -a\n" } timeout { exit 2 }

.github/workflows/main.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,27 @@ name: CI
33
on: [push, pull_request]
44

55
jobs:
6-
rv32emu:
6+
semu-linux:
77
runs-on: ubuntu-22.04
88
steps:
99
- uses: actions/checkout@v4
1010
- name: install-dependencies
11-
run: |
12-
sudo apt-get install build-essential device-tree-compiler
13-
sudo apt-get install expect
11+
run: |
12+
sudo apt-get install build-essential device-tree-compiler expect
13+
- name: default build
14+
run: make
15+
shell: bash
16+
- name: automated test
17+
run: .ci/autorun.sh
18+
shell: bash
19+
20+
semu-macOS:
21+
runs-on: macos-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: install-dependencies
25+
run: |
26+
brew install make dtc expect e2fsprogs
1427
- name: default build
1528
run: make
1629
shell: bash

mk/external.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ define download
1919
$($(T)_DATA):
2020
$(VECHO) " GET\t$$@\n"
2121
$(Q)curl --progress-bar -O -L -C - "$(strip $($(T)_DATA_URL))"
22-
$(Q)echo "$(strip $$($(T)_DATA_SHA1)) $$@.bz2" | $(SHA1SUM) -c
22+
$(Q)echo "$(strip $$($(T)_DATA_SHA1)) $$@.bz2" | $(SHA1SUM) -c
2323
$(Q)bunzip2 $$@.bz2
2424
endef
2525

2626
EXTERNAL_DATA = KERNEL INITRD
27-
$(foreach T,$(EXTERNAL_DATA),$(eval $(download)))
27+
$(foreach T,$(EXTERNAL_DATA),$(eval $(download)))

0 commit comments

Comments
 (0)