Skip to content

Commit 854b3d8

Browse files
authored
Merge pull request #6 from Unity-Technologies/dev
AIRO-1610 Merge Dev to Main
2 parents a7c8aba + 7aad7dd commit 854b3d8

File tree

6 files changed

+387
-67
lines changed

6 files changed

+387
-67
lines changed

.yamato/sonar.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
csharp:
2+
name: Sonarqube C# Scan
3+
agent:
4+
type: Unity::metal::macmini
5+
image: package-ci/mac
6+
flavor: m1.mac
7+
variables:
8+
PROJECT_PATH: TestVhacd
9+
SONARQUBE_PROJECT_KEY: ai-robotics-vhacd-csharp
10+
SONARQUBE_PROJECT_BASE_DIR: /Users/bokken/build/output/Unity-Technologies/VHACD/com.unity.robotics.vhacd
11+
MSBUILD_SLN_PATH: ./TestVhacd/TestVhacd.sln
12+
PROJECT_ROOT: /Users/bokken/build/output/Unity-Technologies/VHACD/
13+
UNITY_VERSION: 2020.3.21f1
14+
commands:
15+
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.it.unity3d.com/artifactory/api/npm/upm-npm
16+
- unity-downloader-cli -u $UNITY_VERSION -c Editor
17+
- brew install mono corretto
18+
- curl https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/5.2.1.31210/sonar-scanner-msbuild-5.2.1.31210-net46.zip -o sonar-scanner-msbuild-net46.zip -L
19+
- unzip sonar-scanner-msbuild-net46.zip -d ~/sonar-scanner-msbuild
20+
- chmod a+x ~/sonar-scanner-msbuild/sonar-scanner-4.6.1.2450/bin/sonar-scanner
21+
- .Editor/Unity.app/Contents/MacOS/Unity -projectPath $PROJECT_PATH -batchmode -quit -nographics -logFile - -executeMethod "UnityEditor.SyncVS.SyncSolution"
22+
- command: |
23+
cd $PROJECT_PATH
24+
for file in *.csproj; do sed -i.backup "s/^[[:blank:]]*<ReferenceOutputAssembly>false<\/ReferenceOutputAssembly>/<ReferenceOutputAssembly>true<\/ReferenceOutputAssembly>/g" $file; rm $file.backup; done
25+
cd $PROJECT_ROOT
26+
- mono ~/sonar-scanner-msbuild/SonarScanner.MSBuild.exe begin /k:$SONARQUBE_PROJECT_KEY /d:sonar.host.url=$SONARQUBE_ENDPOINT_URL_PRD /d:sonar.login=$SONARQUBE_TOKEN_PRD /d:sonar.projectBaseDir=$SONARQUBE_PROJECT_BASE_DIR
27+
- msbuild $MSBUILD_SLN_PATH
28+
- mono ~/sonar-scanner-msbuild/SonarScanner.MSBuild.exe end /d:sonar.login=$SONARQUBE_TOKEN_PRD
29+
triggers:
30+
cancel_old_ci: true
31+
expression: |
32+
((pull_request.target eq "main" OR pull_request.target eq "dev")
33+
AND NOT pull_request.push.changes.all match "**/*.md") OR
34+
(push.branch eq "main" OR push.branch eq "dev")
35+
standard:
36+
name: Sonarqube Standard Scan
37+
agent:
38+
type: Unity::VM
39+
image: robotics/ci-ubuntu20:latest
40+
flavor: i1.large
41+
variables:
42+
SONARQUBE_PROJECT_KEY: ai-robotics-vhacd-standard
43+
ROOT_DIR: /home/bokken/build/output/Unity-Technologies/VHACD
44+
SRC_DIR: /home/bokken/build/output/Unity-Technologies/VHACD/src
45+
BUILD_WRAPPER_DIR: /home/bokken/build/output/Unity-Technologies/VHACD/build_wrapper_output_directory
46+
commands:
47+
- curl https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip -o sonar-scanner-linux.zip -L
48+
- unzip sonar-scanner-linux.zip -d ~/sonar-scanner
49+
- curl $SONARQUBE_ENDPOINT_URL_PRD/static/cpp/build-wrapper-linux-x86.zip -o sonar-build-wrapper-linux.zip -L
50+
- unzip sonar-build-wrapper-linux.zip -d ~/sonar-build-wrapper
51+
- mkdir build
52+
- cd build
53+
- cmake $SRC_DIR
54+
- ~/sonar-build-wrapper/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir $BUILD_WRAPPER_DIR make
55+
- cd $ROOT_DIR
56+
- ~/sonar-scanner/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.projectKey=$SONARQUBE_PROJECT_KEY -Dsonar.sources=$SRC_FOLDER -Dsonar.host.url=$SONARQUBE_ENDPOINT_URL_PRD -Dsonar.login=$SONARQUBE_TOKEN_PRD -Dsonar.cfamily.build-wrapper-output=$BUILD_WRAPPER_DIR
57+
triggers:
58+
cancel_old_ci: true
59+
expression: |
60+
((pull_request.target eq "main" OR pull_request.target eq "dev")
61+
AND NOT pull_request.push.changes.all match "**/*.md") OR
62+
(push.branch eq "main" OR push.branch eq "dev")

.yamato/yamato-config.yml

+47-31
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,47 @@
1-
name: VHACD Unit Tests
2-
agent:
3-
type: Unity::VM
4-
image: robotics/ci-ubuntu20:v0.1.0-795910
5-
flavor: i1.large
6-
variables:
7-
COVERAGE_EXPECTED: 0
8-
PATH: /root/.local/bin:/home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
9-
commands:
10-
- git submodule update --init --recursive
11-
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
12-
- unity-downloader-cli -u 2020.3.21f1 -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
13-
- git clone [email protected]:unity/utr.git utr
14-
- utr/utr --testproject=./TestVhacd --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor --enable-code-coverage --coverage-results-path=../test-results --coverage-options="assemblyFilters:+Unity.Robotics.VHACD,+Unity.Robotics.VHACD.Editor;generateHtmlReport;generateBadgeReport;generateAdditionalMetrics"
15-
# check test coverage
16-
- command: |
17-
linecoverage=$(cat test-results/Report/Summary.xml | grep Linecoverage | grep -Eo '[+-]?[0-9]+([.][0-9]+)?')
18-
echo "Line coverage: $linecoverage%"
19-
if (( $(echo "$linecoverage < $COVERAGE_EXPECTED" | bc -l) ))
20-
then echo "ERROR: Code coverage is under threshold of $COVERAGE_EXPECTED%" && exit 1
21-
fi
22-
triggers:
23-
cancel_old_ci: true
24-
expression: |
25-
((pull_request.target eq "main" OR pull_request.target eq "dev")
26-
AND NOT pull_request.push.changes.all match "**/*.md") OR
27-
(push.branch eq "main" OR push.branch eq "dev")
28-
artifacts:
29-
logs:
30-
paths:
31-
- "test-results/**/*"
1+
# {% assign platforms = "linux mac windows" | split: " " %}
2+
{% assign platforms = "linux mac" | split: " " %}
3+
4+
{% for platform in platforms %}
5+
{{platform}}:
6+
name: VHACD Unit Tests ({{platform}})
7+
agent:
8+
{% if platform == "linux" %}
9+
type: Unity::VM
10+
image: robotics/ci-ubuntu20:v0.1.0-795910
11+
flavor: i1.large
12+
{% elsif platform == "mac" %}
13+
type: Unity::metal::macmini
14+
image: package-ci/mac
15+
flavor: m1.mac
16+
# {% elsif platform == "windows" %}
17+
# type: Unity::VM
18+
# image: slough-ops/win10-base:stable
19+
# flavor: b1.medium
20+
{% endif %}
21+
variables:
22+
COVERAGE_EXPECTED: 0
23+
PATH: /root/.local/bin:/home/bokken/bin:/home/bokken/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/sbin:/home/bokken/.npm-global/bin
24+
commands:
25+
- git submodule update --init --recursive
26+
- python3 -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
27+
- unity-downloader-cli -u 2020.3.21f1 -c editor -c StandaloneSupport-IL2CPP -c Linux --wait --published
28+
- git clone [email protected]:unity/utr.git utr
29+
- utr/utr --testproject=./TestVhacd --editor-location=.Editor --reruncount=0 --artifacts_path=test-results --suite=playmode --suite=editor --platform=Editor --enable-code-coverage --coverage-results-path=../test-results --coverage-options="assemblyFilters:+Unity.Robotics.VHACD,+Unity.Robotics.VHACD.Editor;generateHtmlReport;generateBadgeReport;generateAdditionalMetrics"
30+
# check test coverage
31+
- command: |
32+
linecoverage=$(cat test-results/Report/Summary.xml | grep Linecoverage | grep -Eo '[+-]?[0-9]+([.][0-9]+)?')
33+
echo "Line coverage: $linecoverage%"
34+
if (( $(echo "$linecoverage < $COVERAGE_EXPECTED" | bc -l) ))
35+
then echo "ERROR: Code coverage is under threshold of $COVERAGE_EXPECTED%" && exit 1
36+
fi
37+
triggers:
38+
cancel_old_ci: true
39+
expression: |
40+
((pull_request.target eq "main" OR pull_request.target eq "dev")
41+
AND NOT pull_request.push.changes.all match "**/*.md") OR
42+
(push.branch eq "main" OR push.branch eq "dev")
43+
artifacts:
44+
logs:
45+
paths:
46+
- "test-results/**/*"
47+
{% endfor %}

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
1212

1313
### Added
1414

15+
Added Sonarqube Scanner, multiplatform Yamato testing
16+
17+
### Changed
18+
19+
### Deprecated
20+
21+
### Removed
22+
23+
### Fixed
24+
25+
## [0.0.1-preview] - 2021-12-14
26+
27+
### Upgrade Notes
28+
29+
### Known Issues
30+
31+
### Added
32+
1533
### Changed
34+
1635
Created VHACD Unity package
1736

1837
### Deprecated

0 commit comments

Comments
 (0)