-
Notifications
You must be signed in to change notification settings - Fork 4
116 lines (94 loc) · 3.35 KB
/
main.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
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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
env:
DEFINES: "LOG_LEVEL=LOG_LEVEL_WARN"
jobs:
build:
runs-on: ubuntu-20.04
timeout-minutes: 12
steps:
- uses: actions/checkout@v3
- name: Get and run setup script
run: |
wget https://raw.githubusercontent.com/uw-midsun/box/master/requirements.sh
chmod +x ./requirements.sh
sudo ./requirements.sh
pip install -r requirements.txt --upgrade
- name: Install libncurses5
run: sudo apt-get install -y libncurses5 libncursesw5
- name: Install STM32 toolchain
env:
GCC_PATH: arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi
GCC_URL: https://developer.arm.com/-/media/Files/downloads/gnu/13.2.Rel1/binrel/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi.tar.xz
run: |
cd ${HOME}
wget -nv $GCC_URL
echo "Extracting archive..."
tar xf ${GCC_PATH}.tar.xz
echo "Listing GCC bin directory:"
ls -la ${GCC_PATH}/bin/
echo "Adding to PATH..."
echo "${HOME}/${GCC_PATH}/bin" >> $GITHUB_PATH
# Export path for current shell
export PATH="${HOME}/${GCC_PATH}/bin:${PATH}"
echo "Current PATH:"
echo $PATH
echo "Testing GCC installation:"
${HOME}/${GCC_PATH}/bin/arm-none-eabi-gcc --version
- name: Print versions of everything
run: |
arm-none-eabi-gcc --version
arm-none-eabi-objcopy --version
arm-none-eabi-objdump --version
arm-none-eabi-size --version
arm-none-eabi-gcc-ar --version
arm-none-eabi-gdb --version
gcc --version
make --version
clang --version
clang-format --version
pylint --version
- name: Format and lint
run: |
scons format
if [[ $(git diff --name-only) ]] ; then
echo -e "\n unformatted files:";
git diff --name-only;
exit 1;
fi
scons lint
if [ $? -ne 0 ] ; then
echo -e "\n lint failed";
exit 1;
fi
- name: Build stm32f10x
id: build-stm32
run: |
sudo rm -f /etc/apt/sources.list.d/maarten-fonville-ubuntu-protobuf-focal.list
sudo apt-get update
# Install binutils
sudo apt-get install -y binutils binutils-dev
# Configure LTO-aware tools and make sure plugin is executable
export AR=arm-none-eabi-gcc-ar
export RANLIB=arm-none-eabi-gcc-ranlib
export NM=arm-none-eabi-gcc-nm
# Enable LTO
export CCFLAGS="${CCFLAGS} -flto"
export LINKFLAGS="${LINKFLAGS} -flto"
scons --platform=arm --define="${DEFINES}"
- name: Build and test
id: build-test
run: |
# Setting up vcan
sudo apt-get install -y linux-modules-extra-$(uname -r)
sudo modprobe can
sudo modprobe can_raw
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
scons --platform=x86 --define="${DEFINES}"
scons test --platform=x86 --define="${DEFINES}"