Skip to content

Commit

Permalink
Merge CircleCI version 2.0 support to master
Browse files Browse the repository at this point in the history
  • Loading branch information
devanlai committed Feb 28, 2018
2 parents a6d4d4f + d553259 commit ee378a8
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 18 deletions.
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: 2
jobs:
build:
machine: true
steps:
- checkout
- run:
name: Checkout submodules
command: git submodule sync && git submodule update --init
- restore_cache:
key: v1-toolchain-checksum-{{ checksum "util/install-toolchain.sh" }}
- run:
name: Install toolchain
command: ./util/install-toolchain.sh
- save_cache:
key: v1-toolchain-checksum-{{ checksum "util/install-toolchain.sh" }}
paths:
- "~/toolchains/"
- run:
name: Compile firmware
command: make -k all
environment:
PREFIX: "~/toolchains/gcc-arm-embedded/bin/arm-none-eabi"
- store_artifacts:
path: build/
12 changes: 0 additions & 12 deletions circle.yml

This file was deleted.

36 changes: 30 additions & 6 deletions util/install-toolchain.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
#!/bin/bash
URL=https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2
TOOLCHAIN=gcc-arm-none-eabi-5_2-2015q4
if [[ ! -d "$HOME/toolchains/gcc-arm-embedded" ]]; then
mkdir -p ~/toolchains
wget -qO- $URL | tar xj -C ~/toolchains/
ln -s $TOOLCHAIN ~/toolchains/gcc-arm-embedded
set -eo pipefail
URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2016q4/gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2
TOOLCHAIN=gcc-arm-none-eabi-6_2-2016q4
TOOLCHAINS=$HOME/toolchains
TOOLCHAIN_MISSING=0
GCC=${TOOLCHAINS}/gcc-arm-embedded/bin/arm-none-eabi-gcc
if [[ ! -d "${TOOLCHAINS}/gcc-arm-embedded" ]]; then
TOOLCHAIN_MISSING=1
fi;
if [[ ! -f ${GCC} ]]; then
TOOLCHAIN_MISSING=1
fi;

if [ $TOOLCHAIN_MISSING -eq 1 ]; then
echo "Installing $TOOLCHAIN from $URL to ${TOOLCHAINS}"
mkdir -p ${TOOLCHAINS}
wget -qO- $URL | tar xj -C ${TOOLCHAINS}
rm -rf ${TOOLCHAINS}/gcc-arm-embedded
ln -s $TOOLCHAIN ${TOOLCHAINS}/gcc-arm-embedded
fi;

EXISTING_TOOLCHAIN=`readlink -f "${TOOLCHAINS}/gcc-arm-embedded"`
echo "Current toolchain is $EXISTING_TOOLCHAIN"

if ! ldd ${GCC} >/dev/null; then
echo "${GCC} does not appear to be executable on this machine"
exit 1
fi;

TOOLCHAIN_VER=`${GCC} --version | head -n 1`
echo "Installed toolchain version is $TOOLCHAIN_VER"

0 comments on commit ee378a8

Please sign in to comment.