Skip to content

edit mode test が実行されるようにする #10

edit mode test が実行されるようにする

edit mode test が実行されるようにする #10

name: Create UnityPackage
on:
workflow_dispatch:
push:
branches:
- workflow-wip
env:
UNITY_PROJECT_PATH: .
defaults:
run:
shell: bash
jobs:
checkout:
runs-on: [self-hosted, Windows, X64, Unity]
steps:
- id: checkout
uses: actions/checkout@v4
with:
submodules: recursive
lfs: true
detect-unity-version:
needs: checkout
runs-on: [self-hosted, Windows, X64, Unity]
outputs:
unity-editor-executable: ${{ steps.detect-unity-version.outputs.unity-editor-executable }}
steps:
- name: Detect Unity Version
id: detect-unity-version
run: |
PROJECT_VERSION_PATH="${UNITY_PROJECT_PATH}/ProjectSettings/ProjectVersion.txt"
UNITY_HUB="C:\Program Files\Unity Hub\Unity Hub.exe"
UNITY_VERSION=`cat ${PROJECT_VERSION_PATH} | sed -n -E "s/^m_EditorVersion:\s+//p" | head`
UNITY_CHANGESET=`cat ${PROJECT_VERSION_PATH} | sed -n -E "s/^m_EditorVersionWithRevision:\s+\S+\s+\((\S+)\)/\1/p" | head`
UNITY_EDITOR_EXECUTABLE=`"${UNITY_HUB}" -- --headless editors --installed | \
sed -n -E "s/^${UNITY_VERSION} , installed at //p" | \
head`
if [ -z "${UNITY_EDITOR_EXECUTABLE}" ]; then
echo "Unity ${UNITY_VERSION} is not installed."
exit 1
# コマンドラインからのインストールは Unity 3.7.0 時点では UAC 必須で難しい
UNITY_INSTALL_COMMAND="\"${UNITY_HUB}\" -- --headless install \
--version ${UNITY_VERSION} \
--changeset ${UNITY_CHANGESET} \
--module windows-il2cpp \
--childModules"
fi
echo "unity-editor-executable=${UNITY_EDITOR_EXECUTABLE}" >> "${GITHUB_OUTPUT}"
run-edit-mode-tests:
needs: detect-unity-version
runs-on: [self-hosted, Windows, X64, Unity]
steps:
- name: Run Editor Tests
id: run-edit-mode-tests
run: |
"${{ needs.detect-unity-version.outputs.unity-editor-executable }}" \
-batchmode \
-silent-crashes \
-projectPath "${UNITY_PROJECT_PATH}" \
-executeMethod "UniGLTF.TestRunner.RunEditModeTests" \
-logFile output.log
echo $?