Skip to content

Commit

Permalink
Migrate from CircleCI 1.0 to 2.0
Browse files Browse the repository at this point in the history
Update circle.yml to the new format .circleci/config.yml
Update install-toolchain.sh to the more robust version from dap42
  • Loading branch information
devanlai committed Feb 28, 2018
1 parent 9eca23a commit ebc9b4b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 16 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 -f release.Makefile -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.

32 changes: 28 additions & 4 deletions util/install-toolchain.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
#!/bin/bash
set -eo pipefail
URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
TOOLCHAIN=gcc-arm-none-eabi-6-2017-q2-update
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
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 ebc9b4b

Please sign in to comment.