-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/develop' into tron_develop_ups…
…tream_f6eeaba
- Loading branch information
Showing
4,145 changed files
with
4,903 additions
and
1,085,770 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
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 |
---|---|---|
|
@@ -9,9 +9,137 @@ tag_filters: &tag_filters | |
only: | ||
- /.+/ | ||
|
||
orbs: | ||
win: circleci/[email protected] | ||
|
||
aliases: | ||
- &tasks ["compile:all clean:all", "compile:user clean:user", "compile:debug clean:debug"] | ||
- &platforms ["argon", "boron", "bsom", "b5som", "tracker"] | ||
|
||
# Define a job to be invoked later in a workflow. | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs | ||
jobs: | ||
setup-workspace: | ||
machine: | ||
image: ubuntu-2004:current | ||
steps: | ||
- run: | ||
name: "Create Tested Platforms Files in Workspace" | ||
command: | | ||
mkdir -p $HOME/workspace/tested-platforms | ||
ls -la $HOME/workspace | ||
ls -la $HOME/workspace/tested-platforms | ||
echo ":::: done!" | ||
- persist_to_workspace: | ||
root: ~/workspace | ||
paths: | ||
- tested-platforms | ||
validate-toolchain-platforms: | ||
machine: | ||
image: ubuntu-2004:current | ||
steps: | ||
- attach_workspace: | ||
at: ~/workspace | ||
- checkout | ||
- install-prtcl-ubuntu | ||
- run: | ||
name: "Check if all toolchain platforms were tested" | ||
command: | | ||
ls -la $HOME/workspace | ||
ls -la $HOME/workspace/tested-platforms | ||
echo | ||
deviceOSPath=~/project | ||
deviceOSSource="source:${deviceOSPath}" | ||
toolchain="$(prtcl toolchain:view ${deviceOSSource} --json)" | ||
platformsStr=$(echo $toolchain | jq '.platforms' | jq 'map(.name)') | ||
platforms=() | ||
while read p; do | ||
platforms+=($(echo ${p} | tr -d '"')) | ||
done < <(echo $platformsStr | jq -c '.[]') | ||
echo ":::: Found toolchain platforms: ${platforms[@]}" | ||
oses=( | ||
'darwin-x64' | ||
'ubuntu-x64' | ||
'windows-x64' | ||
) | ||
for os in "${oses[@]}"; do | ||
for platform in "${platforms[@]}"; do | ||
dir="${HOME}/workspace/tested-platforms" | ||
prefix="${os}-${platform}" | ||
pattern="${prefix}-*" | ||
echo ":::: Checking for results matching '${dir}/${pattern}'" | ||
results=$(find $dir -maxdepth 1 -name "${pattern}" -type f) | ||
count=0 | ||
if [ -n "${results}" ]; then | ||
count=$(echo "$results" | wc -l) | ||
fi | ||
echo ":::: Found ${count} results:" | ||
echo "$results" | ||
echo | ||
if [ $count -lt 1 ]; then | ||
echo ":::: Missing tests for ${platform}!" | ||
exit 1 | ||
fi | ||
done | ||
done | ||
echo ":::: done!" | ||
build-for-windows: | ||
executor: | ||
name: win/default | ||
parameters: | ||
tasks: | ||
type: string | ||
platform: | ||
type: string | ||
steps: | ||
- checkout | ||
- run: git submodule update --init --recursive | ||
- install-prtcl-windows | ||
- test-localcompiler-windows: | ||
tasks: << parameters.tasks >> | ||
platform: << parameters.platform >> | ||
- save-platform-to-workspace: | ||
os: windows-x64 | ||
tasks: << parameters.tasks >> | ||
platform: << parameters.platform >> | ||
build-for-darwin: | ||
macos: | ||
xcode: "13.2.1" | ||
parameters: | ||
tasks: | ||
type: string | ||
platform: | ||
type: string | ||
steps: | ||
- checkout | ||
- run: git submodule update --init --recursive | ||
- install-prtcl-darwin | ||
- test-localcompiler-nix: | ||
tasks: << parameters.tasks >> | ||
platform: << parameters.platform >> | ||
- save-platform-to-workspace: | ||
os: darwin-x64 | ||
tasks: << parameters.tasks >> | ||
platform: << parameters.platform >> | ||
build-for-ubuntu: | ||
machine: | ||
image: ubuntu-2004:current | ||
parameters: | ||
tasks: | ||
type: string | ||
platform: | ||
type: string | ||
steps: | ||
- checkout | ||
- run: git submodule update --init --recursive | ||
- install-prtcl-ubuntu | ||
- test-localcompiler-nix: | ||
tasks: << parameters.tasks >> | ||
platform: << parameters.platform >> | ||
- save-platform-to-workspace: | ||
os: ubuntu-x64 | ||
tasks: << parameters.tasks >> | ||
platform: << parameters.platform >> | ||
combine-binaries: | ||
docker: | ||
- image: alpine:latest | ||
|
@@ -120,7 +248,7 @@ jobs: | |
cd $HOME/device-os | ||
git submodule update --init --recursive | ||
if [ -z "$CIRCLE_TAG" ]; then | ||
export ARTIFACT_TAG=$(echo "$CIRCLE_BRANCH" | tr '[:upper:]' '[:lower:]' | sed 's,/,-,g')-$(git rev-parse --short HEAD) | ||
export ARTIFACT_TAG=$(echo "$CIRCLE_BRANCH" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-zA-Z0-9]/-/g')-$(git rev-parse --short HEAD) | ||
else | ||
export ARTIFACT_TAG=$CIRCLE_TAG | ||
fi | ||
|
@@ -166,8 +294,176 @@ jobs: | |
paths: | ||
- release | ||
|
||
commands: | ||
install-prtcl-ubuntu: | ||
steps: | ||
- run: | ||
name: "Install `prtcl` CLI (ubuntu)" | ||
command: | | ||
printf 'Acquire::http::Timeout "30";\nAcquire::ftp::Timeout "30";\nAcquire::Retries "5";\n' | sudo tee /etc/apt/apt.conf.d/99timeout > /dev/null | ||
sudo apt-get update -q | ||
sudo apt-get install -qy zlib1g-dev jq | ||
sudo curl https://prtcl.s3.amazonaws.com/install-apt.sh | sh | ||
echo ":::: done!" | ||
install-prtcl-darwin: | ||
steps: | ||
- run: | ||
name: "Install `prtcl` CLI (darwin)" | ||
command: | | ||
brew tap particle-iot/brew && brew install prtcl jq | ||
echo ":::: done!" | ||
install-prtcl-windows: | ||
steps: | ||
- run: | ||
name: "Install `prtcl` CLI (windows)" | ||
command: | | ||
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { | ||
echo ":::: Insufficient privileges! Must be Admin" | ||
exit 1; | ||
} | ||
$ErrorActionPreference = "Stop" | ||
echo ":::: Downloading CLI installer..." | ||
Invoke-WebRequest "https://prtcl.s3.amazonaws.com/prtcl-x64.exe" -OutFile "./prtcl-x64.exe" | ||
echo ":::: Installing CLI..." | ||
Start-Process ".\prtcl-x64.exe" -argumentlist "/S" -Wait | ||
echo ":::: done!" | ||
environment: | ||
PRTCL_DISABLE_AUTOUPDATE: "1" | ||
test-localcompiler-nix: | ||
parameters: | ||
tasks: | ||
type: string | ||
platform: | ||
type: string | ||
steps: | ||
- run: | ||
name: "Test Local Compilation Tasks" | ||
no_output_timeout: "10m" | ||
command: scripts/test-build-tasks.sh ~/project "<< parameters.platform >>" "<< parameters.tasks >>" | ||
environment: | ||
PRTCL_DISABLE_AUTOUPDATE: "1" | ||
test-localcompiler-windows: | ||
parameters: | ||
tasks: | ||
type: string | ||
platform: | ||
type: string | ||
steps: | ||
- run: | ||
name: "Test Local Compilation Tasks" | ||
no_output_timeout: "20m" | ||
command: pwsh scripts/test-build-tasks.ps1 $home\project "<< parameters.platform >>" "<< parameters.tasks >>" | ||
environment: | ||
PRTCL_DISABLE_AUTOUPDATE: "1" | ||
save-platform-to-workspace: | ||
parameters: | ||
os: | ||
type: string | ||
tasks: | ||
type: string | ||
platform: | ||
type: string | ||
steps: | ||
- attach_workspace: | ||
at: ~/workspace | ||
- when: | ||
condition: | ||
or: | ||
- equal: [ 'ubuntu-x64', << parameters.os >> ] | ||
- equal: [ 'darwin-x64', << parameters.os >> ] | ||
steps: | ||
- run: | ||
name: "Save Platform to Workspace (*nix)" | ||
command: | | ||
os="<< parameters.os >>" | ||
tasks="<< parameters.tasks >>" | ||
platform="<< parameters.platform >>" | ||
dir="${HOME}/workspace/tested-platforms" | ||
filename="${os}-${platform}-$(echo $tasks | tr -d ' ":')" | ||
filepath="${dir}/${filename}" | ||
echo ":::: Adding: ${filepath}" | ||
touch $filepath | ||
ls -la $dir | ||
echo ":::: done!" | ||
- when: | ||
condition: | ||
and: | ||
- equal: [ 'windows-x64', << parameters.os >> ] | ||
steps: | ||
- run: | ||
name: "Save Platform to Workspace (windows)" | ||
shell: powershell.exe | ||
command: | | ||
$ErrorActionPreference = "Stop" | ||
$os = "<< parameters.os >>" | ||
$tasks = "<< parameters.tasks >>" | ||
$platform = "<< parameters.platform >>" | ||
$dir = "$($home)\workspace\tested-platforms" | ||
$filename = "$($os)-$($platform)-$($tasks -replace '[ :"]','')" | ||
$filepath = "$($dir)\$($filename)" | ||
echo ":::: Adding: $($filepath)" | ||
New-Item $filepath -type file | ||
Get-ChildItem -Force $dir | ||
echo ":::: done!" | ||
- persist_to_workspace: | ||
root: ~/workspace | ||
paths: | ||
- tested-platforms | ||
workflows: | ||
test-build-system: | ||
when: | ||
or: | ||
- matches: | ||
pattern: "^main$" | ||
value: << pipeline.git.branch >> | ||
- matches: | ||
pattern: "^master$" | ||
value: << pipeline.git.branch >> | ||
- matches: | ||
pattern: "^develop$" | ||
value: << pipeline.git.branch >> | ||
- matches: | ||
pattern: "^test/v.*" | ||
value: << pipeline.git.branch >> | ||
- matches: | ||
pattern: "^release/.*" | ||
value: << pipeline.git.branch >> | ||
jobs: | ||
- setup-workspace: | ||
<<: *tag_filters | ||
- build-for-windows: | ||
<<: *tag_filters | ||
matrix: | ||
parameters: | ||
tasks: *tasks | ||
platform: *platforms | ||
requires: | ||
- setup-workspace | ||
- build-for-ubuntu: | ||
<<: *tag_filters | ||
matrix: | ||
parameters: | ||
tasks: *tasks | ||
platform: *platforms | ||
requires: | ||
- setup-workspace | ||
- build-for-darwin: | ||
<<: *tag_filters | ||
matrix: | ||
parameters: | ||
tasks: *tasks | ||
platform: *platforms | ||
requires: | ||
- setup-workspace | ||
- validate-toolchain-platforms: | ||
<<: *tag_filters | ||
requires: | ||
- setup-workspace | ||
- build-for-windows | ||
- build-for-ubuntu | ||
- build-for-darwin | ||
build-and-test: | ||
jobs: | ||
- build-and-test: | ||
|
@@ -176,11 +472,12 @@ workflows: | |
- particle-ci-private | ||
matrix: | ||
parameters: | ||
platform: ["photon", "p1", "electron", "argon", "boron", "bsom", "b5som", "tracker", "p2", "unit-test newhal gcc"] | ||
platform: ["argon", "boron", "bsom", "b5som", "tracker", "p2", "unit-test newhal gcc"] | ||
- combine-binaries: | ||
requires: | ||
- build-and-test | ||
- report: | ||
requires: | ||
- build-and-test | ||
- combine-binaries | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"version": "1.0.0", | ||
"toolchains": [ | ||
{ | ||
"platforms": [6, 8, 10, 12, 13, 23, 25, 26, 32], | ||
"platforms": [12, 13, 23, 25, 26, 32], | ||
"firmware": "deviceOS@source", | ||
"compilers": "[email protected]", | ||
"tools": "[email protected]", | ||
|
Oops, something went wrong.