Skip to content

Commit

Permalink
Mod run tests as embedded package on CI
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nowsprinting committed Apr 28, 2024
1 parent 772682a commit eb5846e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -60,17 +54,21 @@ 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: |
npm install -g openupm-cli
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
Expand Down

0 comments on commit eb5846e

Please sign in to comment.