-
Notifications
You must be signed in to change notification settings - Fork 7
70 lines (61 loc) · 1.91 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
67
68
69
name: CI
on:
push:
branches: [ master ]
paths-ignore:
- 'doc/**'
- 'tutorial/**'
- 'README.md'
- '.readthedocs.yaml'
pull_request:
branches: [ master ]
paths-ignore:
- 'doc/**'
- 'tutorial/**'
- 'README.md'
- '.readthedocs.yaml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install prerequisites
run: |
sudo apt update
sudo apt install -y wget make cmake gcc device-tree-compiler bison flex
- name: Download and extract prebuilt toolchain
run: |
RISCV_NEWLIBC_TOOLCHAIN=/opt/gcc-riscv64-unknown-elf
wget https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
tar -xzf riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
mv riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14 $RISCV_NEWLIBC_TOOLCHAIN
rm -f *.tar.gz
# strip binaries
cd /opt
set +e
for i in `find libexec bin -type f`
do
strip -s $i
done
cd -
$RISCV_NEWLIBC_TOOLCHAIN/bin/riscv64-unknown-elf-gcc -v
- name: Build all
run: |
make
tar -czf toolchain.tar.gz /opt/gcc-riscv64-unknown-elf
- name: Upload build asserts
uses: actions/[email protected]
with:
name: gd32vf103.elf
path: |
./build/gd32vf103.elf
- name: Upload prebuilt toolchain
uses: actions/[email protected]
with:
name: prebuilt_toolchain
path: |
toolchain.tar.gz
- name: Run tests
run: |
if ls ./build | grep "gd32vf103.elf" ; then echo "Pass"; else echo "Failed" && exit 1; fi;