Code Coverage Support (#182)

* Added basic framework for enable code coverage

* Added basic coverage results building and combination

* fixed ENABLE_CODE_COVERAGE to be `true` or `false`

* Added code coverage project to manifest

* Updated to add more tests for code coverage build

* Updated coverage parameter documentation

* Fixed small syntax error

* Enabled code coverage flag for code coverage tests

* Fixed error in test file build

* Updated project run settings

* Fixed error when creating combined code coverage results

* Updated testing workflows

* updated test workflows

* Updated parameters and added tests

* Updated tests and bash script for running

* Updated run_tests.sh script to simplfy some parameters

* Updated run_tests to remove incorrect ';'

* Updated run_tests script

* Fixed small syntax error

* Fixed for loop in run_tests.sh

* Updated run_tests syntax error for '=' operator

* Fixed runTests variable assignment

* Fixed parameters for running tests via bash

* Corrected bash arguments

* Updated test cases in main.yml

* Updated parameter names and default values for code coverage

* Fixed broken paths for coverage results upload in main.yml

* Corrected names of coverage results artifacts
This commit is contained in:
Nick Maltbie
2022-04-21 04:50:37 -04:00
committed by GitHub
parent ec4f39253f
commit 96562463cf
11 changed files with 117 additions and 110 deletions

View File

@@ -105,6 +105,7 @@ jobs:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
testMode: all
coverageOptions: 'enableCyclomaticComplexity;generateHtmlReport;generateBadgeReport;assemblyFilters:+MyScripts'
# Test implicit artifactsPath, by not setting it
# Upload artifacts
@@ -115,6 +116,14 @@ jobs:
path: ${{ steps.allTests.outputs.artifactsPath }}
retention-days: 14
# Upload coverage
- name: Upload coverage results
uses: actions/upload-artifact@v3
with:
name: Coverage results (all)
path: ${{ steps.allTests.outputs.coveragePath }}
retention-days: 14
testRunnerInEditMode:
name: Test edit mode 📝
runs-on: ubuntu-latest
@@ -162,6 +171,14 @@ jobs:
path: ${{ steps.editMode.outputs.artifactsPath }}
retention-days: 14
# Upload coverage
- name: Upload coverage results
uses: actions/upload-artifact@v3
with:
name: Coverage results (edit mode)
path: ${{ steps.editMode.outputs.coveragePath }}
retention-days: 14
testRunnerInPlayMode:
name: Test play mode 📺
runs-on: ubuntu-latest
@@ -209,6 +226,14 @@ jobs:
path: ${{ steps.playMode.outputs.artifactsPath }}
retention-days: 14
# Upload coverage
- name: Upload coverage results
uses: actions/upload-artifact@v3
with:
name: Coverage results (play mode)
path: ${{ steps.playMode.outputs.coveragePath }}
retention-days: 14
testEachModeSequentially:
name: Test each mode sequentially 👩‍👩‍👧‍👦 # don't try this at home (it's much slower)
runs-on: ubuntu-latest