Skip to content

Commit

Permalink
Run test in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
VeyronSakai committed Jun 9, 2024
1 parent 4d4b335 commit a86e517
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- Tests/**/*
- .github/workflows/test.yml
get-unity-version:
get-unity-path:
name: Get Unity Version
needs: paths-filter
if: ${{ (github.event_name == 'pull_request' && needs.paths-filter.outputs.should-test == 'true') || github.event_name == 'push'}}
Expand All @@ -43,20 +43,26 @@ jobs:
env:
PROJECT_VERSION_PATH: Samples~/ProjectSettings/ProjectVersion.txt
outputs:
unity-version: ${{ steps.get-unity-version.outputs.unity-version }}
unity-path: ${{ steps.get-unity-path.outputs.unity-path }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: ${{ env.PROJECT_VERSION_PATH }}
- name: Get Unity version
id: get-unity-version
- name: Get Unity path
id: get-unity-path
run: |
echo "unity-version=$(grep "m_EditorVersion:" < "${PROJECT_VERSION_PATH}" | cut -d" " -f2)" >> "${GITHUB_OUTPUT}"
UNITY_VERSION=$(grep "m_EditorVersion:" < "${PROJECT_VERSION_PATH}" | cut -d" " -f2)
if [[ "${RUNNER_OS}" == "macOS" ]]; then
echo "unity-path=/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity" >> "${GITHUB_OUTPUT}"
elif [[ "${RUNNER_OS}" == "Windows" ]]; then
echo "C:\Program Files\Unity\Hub\Editor\${UNITY_VERSION}\Editor\Unity.exe" >> "${GITHUB_OUTPUT}"
fi
test:
name: Test
runs-on: [self-hosted, macOS]
needs: [get-unity-version, paths-filter]
needs: [get-unity-path, paths-filter]
timeout-minutes: 30
if: ${{ (github.event_name == 'pull_request' && needs.paths-filter.outputs.should-test == 'true') || github.event_name == 'push'}}
permissions:
Expand All @@ -65,15 +71,17 @@ jobs:
checks: write
pull-requests: write
env:
UNITY_VERSION: ${{ needs.get-unity-version.outputs.unity-version }}
UNITY_VERSION: ${{ needs.get-unity-path.outputs.unity-path }}
steps:
- uses: actions/checkout@v4
with:
clean: false
- name: Run EditMode tests
working-directory: Samples~
env:
UNITY_PATH: ${{ needs.get-unity-path.outputs.unity-path }}
run: |
"/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity" \
"${UNITY_PATH}" \
-silent-crashes \
-batchmode \
-projectPath . \
Expand Down

0 comments on commit a86e517

Please sign in to comment.