47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
version: 2.1
|
|
|
|
jobs:
|
|
build:
|
|
machine: true
|
|
parameters:
|
|
arduino_version:
|
|
description: "Arduino version"
|
|
default: "1.8.11"
|
|
type: string
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- arduino-<< parameters.arduino_version >>
|
|
- run:
|
|
name: Install Arduino
|
|
command: |
|
|
if [ ! -d "$HOME/arduino-<< parameters.arduino_version >>" ]
|
|
then
|
|
wget https://downloads.arduino.cc/arduino-<< parameters.arduino_version >>-linux64.tar.xz
|
|
tar xf arduino-<< parameters.arduino_version >>-linux64.tar.xz -C $HOME
|
|
fi
|
|
- save_cache:
|
|
key: arduino-<< parameters.arduino_version >>
|
|
paths:
|
|
- ~/arduino-<< parameters.arduino_version >>
|
|
- run:
|
|
name: Compile
|
|
command: make
|
|
- run:
|
|
name: Check strings
|
|
command: make strings_test
|
|
- run:
|
|
name: Check software version
|
|
command: |
|
|
export SOFTWARE_VERSION=$(cat src/Config.h | grep -w SOFTWARE_VERSION | cut -d'"' -f 2 | cut -d'\' -f 1)
|
|
strings bin/arduino_firmware.hex.bin | grep $SOFTWARE_VERSION
|
|
export SHORT_COMMIT_SHA=$(echo $CIRCLE_SHA1 | cut -c1-8)
|
|
export COMMIT_SUFFIX=$(strings bin/arduino_firmware.hex.bin | grep $SHORT_COMMIT_SHA)
|
|
export NEW_FW_DIR=bin/$SOFTWARE_VERSION$COMMIT_SUFFIX
|
|
mkdir $NEW_FW_DIR
|
|
rm bin/*.bin
|
|
mv bin/*.hex $NEW_FW_DIR
|
|
- store_artifacts:
|
|
path: bin
|