Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into tron_develop_ups…
Browse files Browse the repository at this point in the history
…tream_f6eeaba
  • Loading branch information
sergeuz committed May 23, 2022
2 parents 80dbade + f6eeaba commit f5251e0
Show file tree
Hide file tree
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.
4 changes: 2 additions & 2 deletions .buildpackrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export BUILDPACK_VARIATION=manifest
export RELEASE_PLATFORMS=( )

# Platforms for which this firmware is considered experimental
export PRERELEASE_PLATFORMS=( photon p1 electron argon boron bsom b5som tracker p2 )
export PRERELEASE_PLATFORMS=( argon boron bsom b5som tracker p2 )
# Note: a single platform should be only in release or prerelease list. If
# added to both it will be considered a prerelease

# Platforms which require modules to be prebuilt
export MODULAR_PLATFORMS=( photon p1 electron argon boron bsom b5som tracker p2 )
export MODULAR_PLATFORMS=( argon boron bsom b5som tracker p2 )

301 changes: 299 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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

2 changes: 1 addition & 1 deletion .workbench/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down
Loading

0 comments on commit f5251e0

Please sign in to comment.