diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..0a12a8c --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,53 @@ +name: Test + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + testAllModes: + name: Test in ${{ matrix.testMode }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + testMode: + - playmode + - editmode + steps: + - uses: actions/checkout@v4 + with: + lfs: true + - uses: actions/cache@v4 + with: + path: ${{ matrix.projectPath }}/Library + key: Library-${{ matrix.projectPath }} + restore-keys: | + Library- + - uses: game-ci/unity-test-runner@v4 + id: tests + env: + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + with: + projectPath: ${{ matrix.projectPath }} + testMode: ${{ matrix.testMode }} + artifactsPath: ${{ matrix.testMode }}-artifacts + githubToken: ${{ secrets.GITHUB_TOKEN }} + checkName: ${{ matrix.testMode }} Test Results + coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+bamlab.*' + - uses: actions/upload-artifact@v4 + if: always() + with: + name: Test results for ${{ matrix.testMode }} + path: ${{ steps.tests.outputs.artifactsPath }} + - uses: actions/upload-artifact@v4 + if: always() + with: + name: Coverage results for ${{ matrix.testMode }} + path: ${{ steps.tests.outputs.coveragePath }} \ No newline at end of file diff --git a/Assets/Scripts/MicromissileAssembly.asmdef b/Assets/Scripts/bamlab.micromissiles.asmdef similarity index 91% rename from Assets/Scripts/MicromissileAssembly.asmdef rename to Assets/Scripts/bamlab.micromissiles.asmdef index 28f4281..e21f82a 100644 --- a/Assets/Scripts/MicromissileAssembly.asmdef +++ b/Assets/Scripts/bamlab.micromissiles.asmdef @@ -1,5 +1,5 @@ { - "name": "MicromissileAssembly", + "name": "bamlab.micromissiles", "rootNamespace": "", "references": [ "GUID:6055be8ebefd69e48b49212b09b47b2f", diff --git a/Assets/Scripts/MicromissileAssembly.asmdef.meta b/Assets/Scripts/bamlab.micromissiles.asmdef.meta similarity index 100% rename from Assets/Scripts/MicromissileAssembly.asmdef.meta rename to Assets/Scripts/bamlab.micromissiles.asmdef.meta diff --git a/Assets/Tests/Tests.asmdef b/Assets/Tests/bamlab.test.asmdef similarity index 89% rename from Assets/Tests/Tests.asmdef rename to Assets/Tests/bamlab.test.asmdef index 2e95de2..6eb15a3 100644 --- a/Assets/Tests/Tests.asmdef +++ b/Assets/Tests/bamlab.test.asmdef @@ -1,10 +1,10 @@ { - "name": "Tests", + "name": "bamlab.test", "rootNamespace": "", "references": [ "UnityEngine.TestRunner", "UnityEditor.TestRunner", - "MicromissileAssembly" + "bamlab.micromissiles" ], "includePlatforms": [ "Editor" diff --git a/Assets/Tests/Tests.asmdef.meta b/Assets/Tests/bamlab.test.asmdef.meta similarity index 100% rename from Assets/Tests/Tests.asmdef.meta rename to Assets/Tests/bamlab.test.asmdef.meta diff --git a/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json b/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json index 3c7b4c1..c4edae1 100644 --- a/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json +++ b/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json @@ -1,5 +1,26 @@ { "m_Dictionary": { - "m_DictionaryValues": [] + "m_DictionaryValues": [ + { + "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "IncludeAssemblies", + "value": "{\"m_Value\":\"bamlab.micromissiles,bamlab.test\"}" + }, + { + "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "Path", + "value": "{\"m_Value\":\"{ProjectPath}\"}" + }, + { + "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "HistoryPath", + "value": "{\"m_Value\":\"{ProjectPath}\"}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "EnableCodeCoverage", + "value": "{\"m_Value\":true}" + } + ] } } \ No newline at end of file