Code size reduction #1602
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 apt-get update | |
sudo apt-get install -y binutils-plugin-dev | |
export AR=arm-none-eabi-gcc-ar | |
export RANLIB=arm-none-eabi-gcc-ranlib | |
export NM=arm-none-eabi-gcc-nm | |
export LTO_PLUGIN="${HOME}/${GCC_PATH}/lib/gcc/arm-none-eabi/13.2.1/liblto_plugin.so" | |
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}" |