tinyusb/.circleci/config2.yml

99 lines
3.2 KiB
YAML
Raw Normal View History

version: 2.1
commands:
setup-toolchain:
parameters:
toolchain:
type: string
steps:
- run:
name: Install Toolchain
command: |
TOOLCHAIN_JSON='{
"arm-clang": "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-17.0.1/LLVMEmbeddedToolchainForArm-17.0.1-Linux-x86_64.tar.xz",
"arm-gcc": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v12.3.1-1.1/xpack-arm-none-eabi-gcc-12.3.1-1.1-linux-x64.tar.gz"
}'
toolchain_url=$(echo $TOOLCHAIN_JSON | jq -r '.["<< parameters.toolchain >>"]')
echo "toolchain_url=$toolchain_url"
# download and extract toolchain
mkdir -p ~/cache/<< parameters.toolchain >>
wget $toolchain_url -O toolchain.tar.gz
tar -C ~/cache/<< parameters.toolchain >> -xaf toolchain.tar.gz
# Add toolchain to PATH
echo "export PATH=$PATH:`echo ~/cache/<< parameters.toolchain >>/*/bin`" >> $BASH_ENV
get-deps:
parameters:
family:
type: string
steps:
- run:
name: Get Dependencies
command: |
python tools/get_deps.py << parameters.family >>
# Install Pico SDK
if [ << parameters.family >> == "rp2040" ]; then
git clone --depth 1 https://github.com/raspberrypi/pico-sdk.git ~/pico-sdk
echo "export PICO_SDK_PATH=~/pico-sdk" >> $BASH_ENV
fi
jobs:
build:
parameters:
build-system:
type: string
toolchain:
type: string
family:
type: string
docker:
- image: cimg/base:current
resource_class: medium+
steps:
- checkout
- when:
condition: << parameters.build-system >> == 'cmake'
steps:
- run:
name: Install Ninja
command: |
# Install Ninja
NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux.zip
wget $NINJA_URL -O ninja-linux.zip
unzip ninja-linux.zip -d ~/bin
- setup-toolchain:
toolchain: << parameters.toolchain >>
- get-deps:
family: << parameters.family >>
- run:
name: Build
command: |
# Only build one board per family for non PRs i.e commit to master
ONE_PER_FAMILY=""
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
ONE_PER_FAMILY="--one-per-family"
fi
# Toolchain option default is gcc
if [ "<< parameters.toolchain >>" == "arm-clang" ]; then
TOOLCHAIN_OPTION="--toolchain clang"
elif [ "<< parameters.toolchain >>" == "arm-gcc" ]; then
TOOLCHAIN_OPTION="--toolchain gcc"
fi
python tools/build.py $ONE_PER_FAMILY -s << parameters.build-system >> $TOOLCHAIN_OPTION << parameters.family >>
workflows:
build:
jobs:
# - build:
# matrix:
# parameters:
# toolchain: ['arm-clang']
# build-system: ['cmake']
# family: ['imxrt']