Skip to content

Commit

Permalink
Merge branch 'feature/travis-ci' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
laurb9 committed Feb 9, 2019
2 parents acaf24f + 4088bb0 commit 6d4b4d7
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .cli-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sketchbook_path: .arduino
arduino_data: .arduino
board_manager:
additional_urls:
- http://arduino.esp8266.com/stable/package_esp8266com_index.json
- https://dl.espressif.com/dl/package_esp32_index.json
- https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,14 @@
# VScode
.vscode

# PyCharm/Jetbrains editors
.idea

# Mac
.DS_Store

# Arduino
*.hex
*.bin
*.elf
.arduino
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: minimal
git:
depth: false
before_install:
- make setup
install: true
script:
- make all
cache:
directories:
- .arduino
52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Default build architecture and board
TARGET ?= arduino:avr:uno

# Default list of cores to install with `make setup`
CORES ?= arduino:avr adafruit:samd esp8266:esp8266 esp32:esp32

# Where to save the Arduino support files, this should match what is in .cli-config.yml
ARDUINO_DIR ?= .arduino

default:
#################################################################################################
# Initial setup: make .arduino/arduino-cli setup
#
# Build all the examples: make all TARGET=adafruit:samd:adafruit_feather_m0
#
# Install more cores: make setup CORES=arduino:samd
# (edit .cli-config.yml and add repository if needed)
#################################################################################################

ARDUINO_CLI_URL = http://downloads.arduino.cc/arduino-cli/arduino-cli-latest-linux64.tar.bz2
ARDUINO_CLI ?= $(ARDUINO_DIR)/arduino-cli --config-file .cli-config.yml
EXAMPLES := $(shell ls examples)

all: # Build all example sketches
all: $(EXAMPLES:%=%.hex)

%.hex: # Generic rule for compiling sketch to uploadable hex file
%.hex: examples/%
$(ARDUINO_CLI) compile --warnings all --fqbn $(TARGET) $< --output $@
ls -l $@*

# Remove built objects
clean:
rm -fv $(EXAMPLES:%=%.{hex,elf}*)

$(ARDUINO_DIR)/arduino-cli: # Download and install arduino-cli
$(ARDUINO_DIR)/arduino-cli:
mkdir -p $(ARDUINO_DIR)
cd $(ARDUINO_DIR)
curl -s $(ARDUINO_CLI_URL) \
| tar xfj - -O -C $(ARDUINO_DIR) \
> $@
chmod 755 $@

setup: # Configure cores and libraries for arduino-cli (which it will download if missing)
setup: $(ARDUINO_DIR)/arduino-cli
mkdir -p $(ARDUINO_DIR)/libraries
ln -sf $(CURDIR) $(ARDUINO_DIR)/libraries/
$(ARDUINO_CLI) config dump
$(ARDUINO_CLI) core update-index
$(ARDUINO_CLI) core install $(CORES)
$(ARDUINO_CLI) core list
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.com/laurb9/StepperDriver.svg?branch=master)](https://travis-ci.com/laurb9/StepperDriver)

StepperDriver
=============

Expand Down

0 comments on commit 6d4b4d7

Please sign in to comment.