-
-
Notifications
You must be signed in to change notification settings - Fork 422
140 lines (122 loc) · 4.27 KB
/
workflow.yml
File metadata and controls
140 lines (122 loc) · 4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Copyright The SimpleKernel Contributors
name: build
on:
push:
pull_request:
release:
types: [published]
# Cancel in-progress runs for the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# PR: 3 runs for speed; push/release: 10 runs for stability
SYSTEM_TEST_RUNS: ${{ github.event_name == 'pull_request' && 3 || 10 }}
jobs:
build-riscv64:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: read
container:
image: ghcr.io/simple-xx/simplekernel-dev:latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Shallow submodule init
run: |
git config --global --add safe.directory '*'
git submodule update --init --recursive --depth 1
- name: Cache CMake build (riscv64)
uses: actions/cache@v4
with:
path: build_riscv64/
key: cmake-riscv64-${{ runner.arch }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**') }}
restore-keys: |
cmake-riscv64-${{ runner.arch }}-
- name: Configure & Build
run: |
cmake --preset=build_riscv64
cmake --build build_riscv64 --target SimpleKernel docs
- name: System Test
run: |
for i in $(seq 1 $SYSTEM_TEST_RUNS); do
echo "=== riscv64 System Test Run $i/$SYSTEM_TEST_RUNS ==="
timeout 300 cmake --build build_riscv64 --target system_test_run > /tmp/st_out_$i.txt 2>&1 || true
cat /tmp/st_out_$i.txt
if ! grep -q "RESULT: ALL TESTS PASSED" /tmp/st_out_$i.txt; then
echo "riscv64 system test run $i/$SYSTEM_TEST_RUNS FAILED"
exit 1
fi
echo "riscv64 system test run $i/$SYSTEM_TEST_RUNS passed"
done
- name: Upload docs artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: docs-html
path: docs/html/
retention-days: 1
build-aarch64:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: read
container:
image: ghcr.io/simple-xx/simplekernel-dev:latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Shallow submodule init
run: |
git config --global --add safe.directory '*'
git submodule update --init --recursive --depth 1
- name: Cache CMake build (aarch64)
uses: actions/cache@v4
with:
path: build_aarch64/
key: cmake-aarch64-${{ runner.arch }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**') }}
restore-keys: |
cmake-aarch64-${{ runner.arch }}-
- name: Configure & Build
run: |
cmake --preset=build_aarch64 -DQEMU_NORMAL_WORLD_DEV_PATH=null -DQEMU_SECURE_WORLD_DEV_PATH=null
cmake --build build_aarch64 --target SimpleKernel unit-test coverage
- name: System Test
run: |
for i in $(seq 1 $SYSTEM_TEST_RUNS); do
echo "=== aarch64 System Test Run $i/$SYSTEM_TEST_RUNS ==="
timeout 300 cmake --build build_aarch64 --target system_test_run > /tmp/st_out_$i.txt 2>&1 || true
cat /tmp/st_out_$i.txt
if ! grep -q "RESULT: ALL TESTS PASSED" /tmp/st_out_$i.txt; then
echo "aarch64 system test run $i/$SYSTEM_TEST_RUNS FAILED"
exit 1
fi
echo "aarch64 system test run $i/$SYSTEM_TEST_RUNS passed"
done
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
files: ${{ github.workspace }}/build_aarch64/coverage/coverage.info
verbose: true
publish:
needs: [build-riscv64, build-aarch64]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: docs-html
path: docs/html/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/html/