-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build arm-clang on circleci with pull request (#2644)
* Build arm-clang using circle ci (only on PR): cache most of mandatory deps, clang toolchain * update get_deps.py to include CMSIS_5 with --print + no arguments, prevent duplicated deps
- Loading branch information
Showing
4 changed files
with
102 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,106 @@ | ||
# Use the latest 2.1 version of CircleCI pipeline process engine. | ||
# See: https://circleci.com/docs/configuration-reference | ||
version: 2.1 | ||
|
||
# Define a job to be invoked later in a workflow. | ||
# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs | ||
commands: | ||
setup-toolchain: | ||
parameters: | ||
toolchain: | ||
type: string | ||
toolchain_url: | ||
type: string | ||
steps: | ||
- run: | ||
name: Make toolchain cache key | ||
command: echo "<< parameters.toolchain >>-<< parameters.toolchain_url>>" > toolchain_key | ||
- restore_cache: | ||
name: Restore Toolchain Cache | ||
key: deps-{{ checksum "toolchain_key" }} | ||
paths: | ||
- ~/cache/<< parameters.toolchain >> | ||
- run: | ||
name: Install Toolchain | ||
command: | | ||
# Only download if folder does not exist (not cached) | ||
if [ ! -d ~/cache/<< parameters.toolchain >> ]; then | ||
mkdir -p ~/cache/<< parameters.toolchain >> | ||
wget << parameters.toolchain_url>> -O toolchain.tar.gz | ||
tar -C ~/cache/<< parameters.toolchain >> -xaf toolchain.tar.gz | ||
fi | ||
- save_cache: | ||
name: Save Toolchain Cache | ||
key: deps-{{ checksum "toolchain_key" }} | ||
paths: | ||
- ~/cache/<< parameters.toolchain >> | ||
- run: | ||
name: Setup build environment | ||
command: | | ||
echo "export PATH=$PATH:`echo ~/cache/<< parameters.toolchain >>/*/bin`" >> $BASH_ENV | ||
# 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 | ||
get-deps: | ||
parameters: | ||
family: | ||
type: string | ||
steps: | ||
- run: | ||
name: Make deps cache key | ||
command: | | ||
python tools/get_deps.py --print > deps_key | ||
- restore_cache: | ||
name: Restore Dependencies Cache | ||
key: deps-{{ checksum "deps_key" }} | ||
paths: | ||
- lib/CMSIS_5 | ||
- lib/FreeRTOS-Kernel | ||
- lib/lwip | ||
- tools/uf2 | ||
- run: | ||
name: Get Dependencies | ||
command: | | ||
python tools/get_deps.py << parameters.family >> | ||
- save_cache: | ||
name: Save Dependencies Cache | ||
key: deps-{{ checksum "deps_key" }} | ||
paths: | ||
- lib/CMSIS_5 | ||
- lib/FreeRTOS-Kernel | ||
- lib/lwip | ||
- tools/uf2 | ||
|
||
jobs: | ||
say-hello: | ||
# Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. | ||
# See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job | ||
arm-clang: | ||
parameters: | ||
family: | ||
type: string | ||
build-system: | ||
type: string | ||
|
||
docker: | ||
# Specify the version you desire here | ||
# See: https://circleci.com/developer/images/image/cimg/base | ||
- image: cimg/base:current | ||
|
||
resource_class: small | ||
|
||
# Add steps to the job | ||
# See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps | ||
resource_class: medium | ||
environment: | ||
TOOLCHAIN_URL: 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 | ||
steps: | ||
# Checkout the code as the first step. | ||
- checkout | ||
- setup-toolchain: | ||
toolchain: clang | ||
toolchain_url: $TOOLCHAIN_URL | ||
- get-deps: | ||
family: << parameters.family >> | ||
- run: | ||
name: "Say hello" | ||
command: "echo Hello, World!" | ||
name: Build | ||
command: python tools/build.py -s << parameters.build-system >> --toolchain clang << parameters.family >> | ||
|
||
# Orchestrate jobs using workflows | ||
# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows | ||
workflows: | ||
say-hello-workflow: # This is the name of the workflow, feel free to change it to better match your workflow. | ||
# Inside the workflow, you define the jobs you want to run. | ||
build: | ||
jobs: | ||
- say-hello | ||
- arm-clang: | ||
matrix: | ||
parameters: | ||
build-system: | ||
- cmake | ||
#family: ['stm32f1'] | ||
#family: ['stm32f1', 'stm32f2'] | ||
family: ['imxrt', 'kinetis_k kinetis_kl kinetis_k32l2', 'lpc11 lpc13 lpc15', 'lpc17 lpc18 lpc40 lpc43', 'lpc51 lpc54 lpc55', 'nrf', 'samd11 samd21 saml2x', 'samd5x_e5x samg', 'stm32f0 stm32f1 stm32f2 stm32f3', 'stm32f4', 'stm32f7', 'stm32g0 stm32g4 stm32h5', 'stm32h7', 'stm32l4 stm32u5 stm32wb'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters