Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add SonarCloud scan to UMVC.Editor
Browse files Browse the repository at this point in the history
loic-lopez committed May 26, 2023
1 parent cdc879c commit 05fdb29
Showing 1 changed file with 64 additions and 14 deletions.
78 changes: 64 additions & 14 deletions .github/workflows/UMVC.Editor.yml
Original file line number Diff line number Diff line change
@@ -23,18 +23,47 @@ jobs:
- name: Is UMVC.Core failing?
if: ${{ steps.wait-for-build.outputs.conclusion == 'failure' }}
run: echo "::error There is a problem with your UMVC.Core build! Exiting!!" && exit 1

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
- uses: actions/setup-java@v3 # Used for sonarcloud scanner
with:
distribution: 'temurin'
java-version: '11'

- name: install dotnet-coverage
run: dotnet tool install --global dotnet-coverage

- name: install dotnet-sonarscanner
run: dotnet tool install --global dotnet-sonarscanner

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install python3-pip unzip curl -y && pip install requests

- name: Download UMVC.Core Build
- name: Download UMVC.Editor Build
run: python .github/workflows/scripts/downloadArtifacts.py ${{ secrets.PERSONAL_TOKEN }}

- name: Unzip and move UMVC.Core dlls
- name: Unzip and move UMVC.Editor dlls
run: sh .github/workflows/scripts/install-umvc.editor-deps.sh

# Test edit mode
- name: Run playmode & editmode tests
uses: game-ci/unity-test-runner@v2
@@ -50,14 +79,35 @@ jobs:
-coverageOptions "assemblyFilters:-*unity*"
-debugCodeOptimization
- name: Display files in artifacts/CodeCoverage/
run: ls -R ./artifacts/CodeCoverage/

- name: Codecov
uses: codecov/codecov-action@v3
- name: Start SonarCloud scanner for UMVC.Editor
run: >
dotnet-sonarscanner begin /k:"UMVC.Editor" \
/o:"loic-lopez" \
/n:"UMVC.Editor" \
/v:"${{ steps.gitversion.outputs.semVer }}" \
/d:sonar.login="${{ secrets.SONAR_TOKEN_EDITOR }}" \
/d:sonar.cs.opencover.reportsPaths="./artifacts/CodeCoverage/editmode-results.xml,./artifacts/CodeCoverage/playmode-results.xml" \
/d:sonar.scm.provider=git \
/d:sonar.projectDescription="UMVC.Editor - Model-View-Controller Built For Unity" \
/d:sonar.host.url=https://sonarcloud.io /d:sonar.verbose=true /d:sonar.sources="Assets/UMVC/Editor" /d:sonar.tests="Assets/UMVC.Editor.Tests,Assets/UMVC.Playmode.Tests"
- name: Run UnityEditor.SyncVS.SyncSolution
uses: game-ci/unity-test-runner@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./artifacts/CodeCoverage/editmode-results.xml,./artifacts/CodeCoverage/playmode-results.xml
name: codecov-umbrella-editor
fail_ci_if_error: true
unityVersion: 2021.3.16f1
customParameters: -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -customBuildName UMVC

- name: End SonarCloud scanner for UMVC.Core
run: |
dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN_EDITOR }}" /d:sonar.verbose=true
# - name: Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./artifacts/CodeCoverage/editmode-results.xml,./artifacts/CodeCoverage/playmode-results.xml
# name: codecov-umbrella-editor
# fail_ci_if_error: true

0 comments on commit 05fdb29

Please sign in to comment.