Skip to content

feat: SetValueWithoutNotify to ValueReference #21

feat: SetValueWithoutNotify to ValueReference

feat: SetValueWithoutNotify to ValueReference #21

Workflow file for this run

name: Unity Tests
on:
push:
branches: # Only run jobs if files changed on this branch
- master
paths: # Only run jobs if files changed at these paths
- '.github/workflows/**'
- 'Assets/**'
- 'Packages/**'
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
jobs:
# Run the Unity tests
tests:
name: Run Unity 2021.3 tests
runs-on: ubuntu-latest
steps:
# Checkout the repo
- name: Checkout
uses: actions/[email protected]
with:
lfs: true
# Cache library folder for faster tests
- name: Cache library
uses: actions/[email protected]
with:
path: Library
key: LibraryFolder
restore-keys: |
LibraryFolder
# Run play mode tests
- name: Play mode tests
uses: game-ci/unity-test-runner@main # Must be on main until a fix regarding character limit is published
id: playmode_tests
with:
testMode: playmode
checkName: Play mode test results
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+Hertzole.ScriptableValues'
# Run edit mode tests
- name: Edit mode tests
uses: game-ci/unity-test-runner@main # Must be on main until a fix regarding character limit is published
id: editmode_tests
with:
testMode: editmode
checkName: Edit mode test results
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+Hertzole.ScriptableValues'
# Upload test results
- name: Upload play mode results
uses: actions/upload-artifact@v3
if: always()
with:
name: Test results
path: ${{ steps.playmode_tests.outputs.coveragePath }}
# Upload test coverage results
- name: Upload edit mode results
uses: actions/upload-artifact@v3
if: always()
with:
name: Coverage results
path: ${{ steps.playmode_tests.outputs.coveragePath }}
sonarscan:
needs: [tests]
name: SonarScan
runs-on: ubuntu-latest
container: unityci/editor:ubuntu-2021.3.10f1-base-1.0.1
steps:
- name: Activate Unity
continue-on-error: true
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
run: |
echo "$UNITY_LICENSE" | tr -d '\r' > License.ulf
unity-editor -nographics -logFile /dev/stdout -manualLicenseFile License.ulf -quit
- name: Checkout repository
uses: actions/checkout@v1
- name: Cache library
uses: actions/[email protected]
with:
path: Library
key: LibraryFolder
restore-keys: |
LibraryFolder
- name: Install .NET
uses: actions/[email protected]
with:
dotnet-version: |
6.0.x
- name: Install scanner
run: |
dotnet tool install dotnet-sonarscanner --tool-path . --version 5.4.0
apt update
apt install -y openjdk-11-jre-headless
- name: Generate Solution
run: unity-editor -nographics -logFile /dev/stdout -customBuildName runtime-options-manager -projectPath . -executeMethod GitTools.Solution.Sync -quit
# Get the test results from the artifacts
- name: Get test reports
uses: actions/download-artifact@v3
with:
name: Test results
path: Tests
# Get the test coverage results from the artifacts
- name: Get test coverage
uses: actions/download-artifact@v3
with:
name: Coverage results
path: Coverage
# The test results have a different path than what SonarQube can read.
# We need to remove the github/workspace/ path.
- name: Fix paths
run: |
sed -i 's/\/github\/workspace\///g' Coverage/workspace-opencov/PlayMode/TestCoverageResults_0000.xml
sed -i 's/\/github\/workspace\///g' Coverage/workspace-opencov/EditMode/TestCoverageResults_0000.xml
- name: SonarQube analysis
env:
FrameworkPathOverride: /opt/unity/Editor/Data/MonoBleedingEdge/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
ls
ls Coverage
./dotnet-sonarscanner begin \
/o:"hertzole" \
/k:"scriptable-values" \
/d:sonar.host.url=https://sonarcloud.io \
/d:sonar.verbose=false \
/d:sonar.login=$SONAR_TOKEN \
/d:sonar.cs.nunit.reportsPaths=Tests/editmode.xml,Tests/playmode.xml \
/d:sonar.cs.opencover.reportsPaths=Coverage/workspace-opencov/PlayMode/TestCoverageResults_0000.xml,Coverage/workspace-opencov/EditMode/TestCoverageResults_0000.xml
dotnet build scriptable-values.sln
./dotnet-sonarscanner end /d:sonar.login=$SONAR_TOKEN