Files
unity-application/.drone.yml
2023-03-08 13:08:14 +00:00

40 lines
1.2 KiB
YAML

kind: pipeline
name: sonarcube
type: docker
steps:
- name: unity-build-tests
image: docker.io/library/unity-test-runner:0.1
commands:
- ls
- /opt/unity/editors/2021.3.19f1/Editor/Unity -batchmode -nographics -projectPath . -executeMethod GitTools.Solution.Sync -quit
- name: code-analysis
pull: if-not-exists
image: mcr.microsoft.com/dotnet/sdk:6.0
commands:
- apt-get update && apt-get install -y unzip
- export PATH="$PATH:/root/.dotnet/tools"
- ls
# - rm Assembly-CSharp-Editor.csproj
- rm Assembly-CSharp.csproj
- dotnet tool install --global dotnet-sonarscanner
- dotnet sonarscanner begin /k:"$SONAR_PROJECT_KEY" /d:sonar.host.url="$SONAR_HOST" /d:sonar.login="$SONAR_TOKEN" /d:sonar.branch.name="$DRONE_REPO_BRANCH" /d:sonar.analysis.mode=preview
- dotnet restore
- dotnet build
- dotnet sonarscanner end /d:sonar.login="$SONAR_TOKEN"
environment:
SONAR_HOST:
from_secret: sonar_host
SONAR_TOKEN:
from_secret: sonar_token
SONAR_PROJECT_KEY:
from_secret: sonar_project_key
trigger:
event:
- push
- pull_request