diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 336a7d8..57828ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,12 +42,6 @@ jobs: octocov: true steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: false - lfs: false - - name: Crete project for tests uses: nowsprinting/create-unity-project-action@v3 with: @@ -60,9 +54,14 @@ jobs: restore-keys: | Library- - - name: Set package name - run: | - echo "package_name=$(grep -o -E '"name": "(.+)"' ./package.json | cut -d ' ' -f2)" >> "$GITHUB_ENV" + - name: Checkout repository as embedded package + uses: actions/checkout@v4 + with: + submodules: false + lfs: false + path: ${{ env.CREATED_PROJECT_PATH }}/Packages/com.nowsprinting.test-helper + # In Linux editor, there is a problem that assets in local packages cannot be found with `AssetDatabase.FindAssets`. + # As a workaround, I have made it into an embedded package. - name: Install dependencies run: | @@ -70,7 +69,6 @@ jobs: openupm add -f com.unity.test-framework openupm add -f com.unity.testtools.codecoverage openupm add -f com.cysharp.unitask - openupm add -ft "${{ env.package_name }}"@file:../../ working-directory: ${{ env.CREATED_PROJECT_PATH }} - name: Set coverage assembly filters @@ -99,7 +97,9 @@ jobs: id: test - name: Set coverage path for octocov - run: sed -i -r 's/\.\/Logs/${{ steps.test.outputs.coveragePath }}/' .octocov.yml + run: | + mv ${{ env.CREATED_PROJECT_PATH }}/Packages/com.nowsprinting.test-helper/.octocov.yml . + sed -i -r 's/\.\/UnityProject~\/Logs/${{ steps.test.outputs.coveragePath }}/' .octocov.yml if: ${{ matrix.octocov }} - name: Run octocov diff --git a/.octocov.yml b/.octocov.yml index e870727..b35f490 100644 --- a/.octocov.yml +++ b/.octocov.yml @@ -2,16 +2,14 @@ coverage: if: true paths: - - ./Logs/Report/lcov.info # Warning: This path is replace by regex in test.yml + - ./UnityProject~/Logs/Report/lcov.info # Warning: This path is replace by regex in test.yml codeToTestRatio: code: - - 'Editor/**/*.cs' - - 'Runtime/**/*.cs' - - 'Samples~/**/*.cs' - - '!Samples~/**/Tests/**/*.cs' + - '**/*.cs' + - '!**/Tests/**' + - '!**/UnityProject~/**' test: - - 'Tests/**/*.cs' - - 'Samples~/**/Tests/**/*.cs' + - '**/Tests/**/*.cs' testExecutionTime: if: true diff: