-
Notifications
You must be signed in to change notification settings - Fork 6
66 lines (58 loc) · 2.17 KB
/
ci.yml
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
name: ci-build
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
env:
rv32_toolchain: https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2024.02.02
rv32_toolchain_file_name: riscv32-glibc-ubuntu-22.04-gcc-nightly-2024.02.02-nightly.tar.gz
rv64_toolchain: https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2024.02.02
rv64_toolchain_file_name: riscv64-glibc-ubuntu-22.04-gcc-nightly-2024.02.02-nightly.tar.gz
jobs:
kernel:
strategy:
fail-fast: false
matrix:
include:
- name: opensbi-32ilp32
toolchain_tripe: riscv32-unknown-linux-gnu-
- name: opensbi-64lp64
toolchain_tripe: riscv64-unknown-linux-gnu-
runs-on: ubuntu-22.04
env:
CROSS_COMPILE: ${{ matrix.toolchain_tripe }}
steps:
- name: Install software
run: |
sudo apt update && \
sudo apt install -y build-essential
- name: Checkout source
uses: actions/checkout@v4
- name: Configure toolchains
run: |
if [ x"${{ matrix.name }}" = x"opensbi-32ilp32" ]; then
wget ${rv32_toolchain}/${rv32_toolchain_file_name}
tar -xvf ${rv32_toolchain_file_name} -C /opt
rm -v ${rv32_toolchain_file_name}
fi
if [ x"${{ matrix.name }}" = x"opensbi-64lp64" ]; then
wget ${rv64_toolchain}/${rv64_toolchain_file_name}
tar -xvf ${rv64_toolchain_file_name} -C /opt
rm -v ${rv64_toolchain_file_name}
fi
- name: Compile
run: |
export PATH="/opt/riscv/bin:$PATH"
make PLATFORM=generic -j
mv build/platform/generic/firmware/fw_dynamic.bin ./
mv build/platform/generic/firmware/fw_dynamic.elf ./
git log --oneline -100 > git.log
tar czvf ${{ matrix.name }}.tar.gz fw_dynamic.elf fw_dynamic.bin git.log
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}.tar.gz
path: ${{ matrix.name }}.tar.gz
retention-days: 90