Inofficial community implementation of arduino-cli task for Azure DevOps.
Install via Visual Studio MarketPlace.
Example usage for Azure DevOps and detailed description of tasks and arguments.
Installs arduino-cli to agent, when not installed already.
version
(string): Set specific version, for example0.18.0
or aslatest
to install arduino-cli. It isn't recommendet to uselatest
since arduino-cli has often breaking changes!
Example:
- task: ArduinoCliInstall@1
inputs:
version: 'latest'
Updates the index of cores.
- (Optional)
additionalUrls
(string): Comma-separated list of additional URLs for the Boards Manager. - (Optional)
configFile
(file path): The custom config file (if not specified the default will be used). - (Optional)
format
(string): The output format, can be {text|json}. - (Optional)
logFile
(file path): Path to the file where logs will be written. - (Optional)
logFormat
(string): The output format for the logs. - (Optional)
logLevel
(string): Messages with this level and above will be logged. - (Optional)
verbose
(boolean): Print the logs on the standard output. - (Optional)
ArdunioCliToolPath
(file path): Path to the arduino-cli if not using arduino-cli install task before this one.
Example:
- task: ArduinoCliCoreUpdateIndex@1
Installs additionals cores.
core
(string): Name of core.arduino:avr
for latest verion,arduino:avr@1.8.1
for specific verion.- (Optional)
runPostInstall
(boolean): Force run of post-install scripts (if the CLI is not running interactively). - (Optional)
skipPostInstall
(boolean): Force skip of post-install scripts (if the CLI is running interactively). - (Optional)
additionalUrls
(string): Comma-separated list of additional URLs for the Boards Manager. - (Optional)
configFile
(file path): The custom config file (if not specified the default will be used). - (Optional)
format
(string): The output format, can be {text|json}. - (Optional)
logFile
(file path): Path to the file where logs will be written. - (Optional)
logFormat
(string): The output format for the logs. - (Optional)
logLevel
(string): Messages with this level and above will be logged. - (Optional)
verbose
(boolean): Print the logs on the standard output. - (Optional)
ArdunioCliToolPath
(file path): Path to the arduino-cli if not using arduino-cli install task before this one.
Example:
- task: ArduinoCliCoreInstall@1
inputs:
core: 'arduino:avr'
Updates the libraries index to the latest version.
- (Optional)
additionalUrls
(string): Comma-separated list of additional URLs for the Boards Manager. - (Optional)
configFile
(file path): The custom config file (if not specified the default will be used). - (Optional)
format
(string): The output format, can be {text|json}. - (Optional)
logFile
(file path): Path to the file where logs will be written. - (Optional)
logFormat
(string): The output format for the logs. - (Optional)
logLevel
(string): Messages with this level and above will be logged. - (Optional)
verbose
(boolean): Print the logs on the standard output. - (Optional)
ArdunioCliToolPath
(file path): Path to the arduino-cli if not using arduino-cli install task before this one.
Example:
- task: ArduinoCliCoreUpdateIndex@1
Installs additionals cores.
installLibBy
(string): Specify how to install a library. You can choose by namelibName
, git urlgitUrl
or zip pathzipPath
.lib
(string): Name of lib.AudioZero
for latest verion,AudioZero@1.0.0
for specific verion. Can only be used, wheninstallLibBy
islibName
.gitUrl
(string): Enter git url for libraries hosted on repositories. Can only be used, wheninstallLibBy
isgitUrl
.zipPath
(filePath): Enter a path to zip file. Can only be used, wheninstallLibBy
iszipPath
.- (Optional)
additionalUrls
(string): Comma-separated list of additional URLs for the Boards Manager. - (Optional)
configFile
(file path): The custom config file (if not specified the default will be used). - (Optional)
format
(string): The output format, can be {text|json}. - (Optional)
logFile
(file path): Path to the file where logs will be written. - (Optional)
logFormat
(string): The output format for the logs. - (Optional)
logLevel
(string): Messages with this level and above will be logged. - (Optional)
verbose
(boolean): Print the logs on the standard output. - (Optional)
ArdunioCliToolPath
(file path): Path to the arduino-cli if not using arduino-cli install task before this one.
Example:
- task: ArduinoCliLibInstall@1
inputs:
installLibBy: 'libName'
lib: 'OneWire@2.3.5'
Builds binary from Arduino sketch.
fqbn
(string): Fully Qualified Board Name, e.g.:arduino:avr:uno
.sketchDir
(file path): Path to sketch directory. For example:$(System.DefaultWorkingDirectory)/MySketch
, when a sketch is located in$(System.DefaultWorkingDirectory)/MySketch/MySketch.ino
.- (Optional)
outputDir
(file path): Save build artifacts in this directory. Supported by arduino-cli 0.11.0 and newer. - (Optional)
buildCachePath
(file path): CBuilds of 'core.a' are saved into this path to be cached and reused. - (Optional)
buildPath
(file path): CPath where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS - (Optional)
buildProperty
(string): Override a build property with a custom value. Can be used multiple times for multiple properties. - (Optional)
clean
(boolean): Optional, cleanup the build folder and do not use any cached build. - (Optional)
exportBinaries
(boolean): If set built binaries will be exported to the sketch folder. - (Optional)
libraries
(string): List of custom libraries paths separated by commas. - (Optional)
onlyCompilationDatabase
(boolean): Just produce the compilation database, without actually compiling. - (Optional)
optimizeForDebug
(boolean): Optional, optimize compile output for debugging, rather than for release. - (Optional)
vidPid
(string): When specified, VID/PID specific build properties are used, if board supports them. - (Optional)
warnings
(string): Optional, can benone
,default
,more
andall
. Defaults tonone
. Used to tell gcc which warning level to use (-W flag). (defaultnone
). - (Optional)
additionalUrls
(string): Comma-separated list of additional URLs for the Boards Manager. - (Optional)
configFile
(file path): The custom config file (if not specified the default will be used). - (Optional)
format
(string): The output format, can be {text|json}. - (Optional)
logFile
(file path): Path to the file where logs will be written. - (Optional)
logFormat
(string): The output format for the logs. - (Optional)
logLevel
(string): Messages with this level and above will be logged. - (Optional)
verbose
(boolean): Print the logs on the standard output. - (Optional)
ArdunioCliToolPath
(file path): Path to the arduino-cli if not using arduino-cli install task before this one.
Example:
- task: ArduinoCliBuild@1
inputs:
fqbn: 'arduino:avr:uno'
sketchDir: '$(System.DefaultWorkingDirectory)/Main'
Basic example script for building Blink example on Azure DevOps for Arduino Uno. See azure-pipelines.yml:
# Sample azure cli to build and publish Arduino Blink example for the Arduino Uno board
trigger:
- main
pool:
vmImage: 'ubuntu-latest'
steps:
# Install latest version of arduino cli
# Not recommended to use the version 'latest'!!!
# arduino-cli has often breaking changes!
# Check https://github.com/arduino/arduino-cli/issues if something is not working anymore!
# So set a specific version! Like: 0.18.0
- task: ArduinoCliInstall@1
inputs:
version: 'latest'
# "The first thing to do upon a fresh install is to update the local cache of available platforms and libraries by running"
# see "Getting started" https://arduino.github.io/arduino-cli/getting-started/#connect-the-board-to-your-pc
- task: ArduinoCliCoreUpdateIndex@1
# Install core for 'arduino:avr'
- task: ArduinoCliCoreInstall@1
inputs:
core: 'arduino:avr'
# Build Main/Main.ino for fqbn 'arduino:avr:uno'
# Like every arduino project, the sketch file must be in a directory named the same as the sketch... ¯\_(ツ)_/¯
# Since arudino cli version 0.10.0 you can't specify a custom path to a sketch file, like 'somedir/someskecht.ino'!
- task: ArduinoCliBuild@1
inputs:
fqbn: 'arduino:avr:uno'
sketchDir: '$(System.DefaultWorkingDirectory)/Main'
outputDir: '$(Build.ArtifactStagingDirectory)'
# Publish build artifacts
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'ArduinoUno-Blink'
publishLocation: 'Container'
- Pipeline triggers on commit on
main
on `ubuntu-latest`` - Installs latest arduino-cli with task
ArduinoCliInstall@1
- "The first thing to do upon a fresh install is to update the local cache of available platforms and libraries by running" Getting started, so run task
ArduinoCliCoreUpdateIndex@1
- Install core for
arduino:avr
in taskArduinoCliCoreInstall@1
- Build Main/Main.ino for Arudino Uno with task
ArduinoCliBuild@1
- Add more extensions uris
- Update license, add privacy and update extensions uris and tags
- Fix some variables have a value, but they are not required
- Add more build options to support arduino-cli 0.18.0
- Fix crash on arm agents
- Only support ARMv7, because Azure DevOps only supports ARMv7 agents. See https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops#check-prerequisites
- Added basic version for cli tasks install, core update-index, lib update-index, lib install, build