Files
unity-application/.drone.yml
2023-03-23 11:35:14 +00:00

84 lines
3.8 KiB
YAML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
kind: pipeline
name: tests
type: docker
trigger:
event:
- pull_request
steps:
- name: unity-tests
image: docker.io/library/unity-runner:0.1
commands:
- mkdir code_coverage
- chmod 777 code_coverage
- /opt/unity/editors/2021.3.19f1/Editor/Unity -runTests -batchmode -nographics -projectPath . -testResults results_editmode.xml -testPlatform EditMode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath code_coverage -coverageOptions "generateAdditionalMetrics;pathFilters:-**Assets/MediaPipeUnity/Common/**,-**Assets/**Test*.cs;dontClear" || true
#- /opt/unity/editors/2021.3.19f1/Editor/Unity -runTests -batchmode -nographics -projectPath . -testResults results_playmode.xml -testPlatform PlayMode -debugCodeOptimization -enableCodeCoverage -coverageResultsPath code_coverage -coverageOptions "generateAdditionalMetrics;pathFilters:-**Assets/MediaPipeUnity/Common/**,-**Assets/**Test*.cs;dontClear" || true
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -debugCodeOptimization -enableCodeCoverage -coverageResultsPath code_coverage -coverageOptions "generateAdditionalReports;pathFilters:-**Assets/MediaPipeUnity/Common/**,-**Assets/**Test*.cs" -quit || true
- ls code_coverage
- ls code_coverage/Report
- name: tests-parser
image: docker.io/library/unity-test-parser:0.1
commands:
- python /app/unity_test_parser.py results_editmode.xml results_editmode.xml
- name: sonarqube-code-coverage
pull: if-not-exists
image: sonarsource/sonar-scanner-cli
commands:
- sonar-scanner -Dsonar.host.url=$SONAR_HOST -Dsonar.login=$SONAR_TOKEN -Dsonar.projectKey=$SONAR_PROJECT_KEY -Dsonar.coverageReportPaths="./code_coverage/Report/SonarQube.xml"
environment:
SONAR_HOST:
from_secret: sonar_host
SONAR_TOKEN:
from_secret: sonar_token
SONAR_PROJECT_KEY:
from_secret: sonar_project_key
---
kind: pipeline
name: builds
type: docker
trigger:
event:
- push
branch:
- master
- development
- Automatic-Builds
steps:
- name: unity-builds
image: docker.io/library/unity-runner:0.1
commands:
- mkdir -p ./wesign-builds/{tmp,WeSign-Windows,WeSign-Linux,WeSign-MacOS}
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildWindowsPlayer ./wesign-builds/tmp/WeSign-Windows.exe -quit --headless || true
- chmod 777 -R .
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildWindowsPlayer ./wesign-builds/WeSign-Windows/WeSign.exe -quit --headless
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildLinux64Player ./wesign-builds/WeSign-Linux/WeSign -quit --headless
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -buildOSXUniversalPlayer ./wesign-builds/WeSign-MacOS/WeSign.app -quit --headless
- name: commit-files
image: alpine/git
environment:
GIT_AUTHOR_NAME: DroneCI
GIT_AUTHOR_EMAIL: droneci@wesign.com
GIT_COMMITTER_NAME: DroneCI
GIT_COMMITTER_EMAIL: droneci@wesign.com
commands:
- git config --global user.name "DroneCI"
- git config --global user.email "droneci@wesign.com"
- zip -r ./wesign-builds/WeSign-Windows.zip ./wesign-builds/WeSign-Windows
- zip -r ./wesign-builds/WeSign-MacOS.zip ./wesign-builds/WeSign-MacOS
- zip -r ./wesign-builds/WeSign-Linux.zip ./wesign-builds/WeSign-Linux
- git add ./wesign-builds/WeSign-Windows.zip
- git add ./wesign-builds/WeSign-MacOS.zip
- git add ./wesign-builds/WeSign-Linux.zip
- git commit -m "Add build files [skip ci]"
- git push -f https://oauth2:ixKiNbp48zzmP5PF-epo@gitlab.ilabt.imec.be/wesign/unity-application/