Skip to content

Commit

Permalink
Merge pull request #88 from nowsprinting/chore/fix_test_workflow
Browse files Browse the repository at this point in the history
Mod make package name from repo name
  • Loading branch information
nowsprinting committed May 19, 2024
2 parents ccb3422 + be6d12e commit ddc4574
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ on:
- '.github/**'
- '!.github/workflows/test.yml'

env:
PACKAGE_NAME: com.nowsprinting.test-helper

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -38,8 +35,8 @@ jobs:
matrix:
unityVersion: # Available versions see: https://game.ci/docs/docker/versions
- 2019.4.40f1
- 2022.3.17f1
- 2023.2.5f1
- 2022.3.29f1
- 2023.2.20f1
include:
- unityVersion: 2019.4.40f1
octocov: true
Expand All @@ -57,12 +54,17 @@ jobs:
restore-keys: |
Library-
- name: Get package checkout path
run: |
name=com.$(echo "${GITHUB_REPOSITORY}" | sed 's/\//\./g')
echo "PACKAGE_PATH=$CREATED_PROJECT_PATH/Packages/$name" >> "$GITHUB_ENV"
- name: Checkout repository as embedded package
uses: actions/checkout@v4
with:
submodules: false
lfs: false
path: ${{ env.CREATED_PROJECT_PATH }}/Packages/${{ env.PACKAGE_NAME }}
path: ${{ env.PACKAGE_PATH }}
# 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.

Expand All @@ -76,7 +78,7 @@ jobs:

- name: Set coverage assembly filters
run: |
assemblies=$(find ${{ env.CREATED_PROJECT_PATH }}/Packages/${{ env.PACKAGE_NAME }} -name "*.asmdef" | sed -e s/.*\\//\+/ | sed -e s/\\.asmdef// | sed -e s/^.*\\.Tests//)
assemblies=$(find ${{ env.PACKAGE_PATH }} -name "*.asmdef" | sed -e s/.*\\//\+/ | sed -e s/\\.asmdef// | sed -e s/^.*\\.Tests//)
# shellcheck disable=SC2001,SC2048,SC2086
echo "assembly_filters=$(echo ${assemblies[*]} | sed -e s/\ /,/g),+<assets>,-*.Tests" >> "$GITHUB_ENV"
Expand All @@ -101,7 +103,7 @@ jobs:

- name: Set coverage path for octocov
run: |
mv ${{ env.CREATED_PROJECT_PATH }}/Packages/${{ env.PACKAGE_NAME }}/.octocov.yml .
mv ${{ env.PACKAGE_PATH }}/.octocov.yml .
sed -i -r 's/UnityProject~\/Logs/${{ steps.test.outputs.coveragePath }}/' .octocov.yml
if: ${{ matrix.octocov }}

Expand Down

0 comments on commit ddc4574

Please sign in to comment.