From be6d12eb5b996891af1a38f74d157efff9fbda99 Mon Sep 17 00:00:00 2001 From: Koji Hasegawa Date: Sun, 19 May 2024 20:10:12 +0900 Subject: [PATCH] Mod make package name from repo name --- .github/workflows/test.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1f8894e..495cb51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 @@ -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. @@ -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),+,-*.Tests" >> "$GITHUB_ENV" @@ -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 }}