-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.33 KB
/
ci.yml
File metadata and controls
50 lines (40 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
UNITY_VERSION: 6000.3.10f1
jobs:
unity-compile:
name: Unity Compile
runs-on: [self-hosted, macOS]
steps:
- name: Setup Unity project
uses: void2610/unity-coding-standards/.github/actions/setup-unity-project@main
with:
unity-version: ${{ env.UNITY_VERSION }}
- name: Compile project
run: |
# Unityをバッチモードで起動し、コンパイルログからエラーを検出する。
UNITY_PATH="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
LOG_FILE="${RUNNER_TEMP}/unity-compile.log"
# キャンセルされた過去ジョブのロックファイルが残ることがあるため、起動前に削除する。
rm -f Temp/UnityLockfile
"$UNITY_PATH" \
-batchmode \
-quit \
-nographics \
-projectPath "$GITHUB_WORKSPACE" \
-logFile "$LOG_FILE"
cat "$LOG_FILE"
if grep -E "error CS[0-9]{4}|Compilation failed" "$LOG_FILE"; then
echo "Unity compile failed."
exit 1
fi