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
This commit is contained in:
@@ -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
|
version: 2.1
|
||||||
|
|
||||||
# Define a job to be invoked later in a workflow.
|
commands:
|
||||||
# See: https://circleci.com/docs/jobs-steps/#jobs-overview & https://circleci.com/docs/configuration-reference/#jobs
|
setup-toolchain:
|
||||||
jobs:
|
parameters:
|
||||||
say-hello:
|
toolchain:
|
||||||
# Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub.
|
type: string
|
||||||
# See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job
|
toolchain_url:
|
||||||
docker:
|
type: string
|
||||||
# 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
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the code as the first step.
|
|
||||||
- checkout
|
|
||||||
- run:
|
- run:
|
||||||
name: "Say hello"
|
name: Make toolchain cache key
|
||||||
command: "echo Hello, World!"
|
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
|
||||||
|
|
||||||
# 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.
|
|
||||||
jobs:
|
jobs:
|
||||||
- say-hello
|
arm-clang:
|
||||||
|
parameters:
|
||||||
|
family:
|
||||||
|
type: string
|
||||||
|
build-system:
|
||||||
|
type: string
|
||||||
|
|
||||||
|
docker:
|
||||||
|
- image: cimg/base:current
|
||||||
|
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
|
||||||
|
- setup-toolchain:
|
||||||
|
toolchain: clang
|
||||||
|
toolchain_url: $TOOLCHAIN_URL
|
||||||
|
- get-deps:
|
||||||
|
family: << parameters.family >>
|
||||||
|
- run:
|
||||||
|
name: Build
|
||||||
|
command: python tools/build.py -s << parameters.build-system >> --toolchain clang << parameters.family >>
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
build:
|
||||||
|
jobs:
|
||||||
|
- 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']
|
||||||
|
2
.github/actions/get_deps/action.yml
vendored
2
.github/actions/get_deps/action.yml
vendored
@@ -2,8 +2,8 @@ name: Get dependencies
|
|||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
arg:
|
arg:
|
||||||
|
description: 'Arguments to get_deps.py'
|
||||||
required: true
|
required: true
|
||||||
type: string
|
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
toolchain:
|
toolchain:
|
||||||
- 'aarch64-gcc'
|
- 'aarch64-gcc'
|
||||||
# - 'arm-clang'
|
# - 'arm-clang' # clang is built by circle-ci
|
||||||
- 'arm-gcc'
|
- 'arm-gcc'
|
||||||
- 'msp430-gcc'
|
- 'msp430-gcc'
|
||||||
- 'riscv-gcc'
|
- 'riscv-gcc'
|
||||||
@@ -81,7 +81,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
toolchain:
|
toolchain:
|
||||||
- 'aarch64-gcc'
|
- 'aarch64-gcc'
|
||||||
#- 'arm-clang'
|
# - 'arm-clang' # clang is built by circle-ci
|
||||||
- 'arm-gcc'
|
- 'arm-gcc'
|
||||||
- 'msp430-gcc'
|
- 'msp430-gcc'
|
||||||
- 'riscv-gcc'
|
- 'riscv-gcc'
|
||||||
|
@@ -249,9 +249,6 @@ def main():
|
|||||||
boards = args.board
|
boards = args.board
|
||||||
print_only = args.print
|
print_only = args.print
|
||||||
|
|
||||||
if len(families) == 0 and len(boards) == 0:
|
|
||||||
print("Warning: family and board are not specified, only fetching mandatory dependencies.")
|
|
||||||
|
|
||||||
status = 0
|
status = 0
|
||||||
deps = list(deps_mandatory.keys())
|
deps = list(deps_mandatory.keys())
|
||||||
|
|
||||||
@@ -267,11 +264,14 @@ def main():
|
|||||||
|
|
||||||
for f in families:
|
for f in families:
|
||||||
for d in deps_optional:
|
for d in deps_optional:
|
||||||
if f in deps_optional[d][2]:
|
if d not in deps and f in deps_optional[d][2]:
|
||||||
deps.append(d)
|
deps.append(d)
|
||||||
|
|
||||||
if print_only:
|
if print_only:
|
||||||
pvalue = {}
|
pvalue = {}
|
||||||
|
# print only without arguments, always add CMSIS_5
|
||||||
|
if len(families) == 0 and len(boards) == 0:
|
||||||
|
deps.append('lib/CMSIS_5')
|
||||||
for d in deps:
|
for d in deps:
|
||||||
commit = deps_all[d][1]
|
commit = deps_all[d][1]
|
||||||
pvalue[d] = commit
|
pvalue[d] = commit
|
||||||
|
Reference in New Issue
Block a user