-
Notifications
You must be signed in to change notification settings - Fork 36
80 lines (71 loc) · 2.8 KB
/
main.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: CI check for Unity 2020.3.x, 2021.3.x, 2022.3.x
on:
pull_request:
branches:
- master
- beta/**
jobs:
test:
name: Test on Unity ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unityVersion:
- 2020.3.48f1
- 2021.3.42f1
- 2022.3.42f1
steps:
# リポジトリをチェックアウト
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true # Large File Storageが必要な場合に true を指定
- name: Set up Unity version-specific Packages and ProjectSettings
run: |
if [[ "${{ matrix.unityVersion }}" == "2020.3.48f1" ]]; then
cp -r .ProjectSettings2020 ProjectSettings
cp -r .Packages2020 Packages
elif [[ "${{ matrix.unityVersion }}" == "2021.3.42f1" ]]; then
cp -r .ProjectSettings2021 ProjectSettings
cp -r .Packages2021 Packages
elif [[ "${{ matrix.unityVersion }}" == "2022.3.42f1" ]]; then
cp -r .ProjectSettings2022 ProjectSettings
cp -r .Packages2022 Packages
fi
# Unity Test Runnerを実行 (エディットモードテスト)
- name: Run Edit Mode Tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ./
unityVersion: ${{ matrix.unityVersion }}
customParameters: -runTests -testPlatform editmode
artifactsPath: editmode-results
# アーティファクトのアップロード(エディットモード)
- name: Upload Edit Mode Test results for ${{ matrix.unityVersion }}
uses: actions/upload-artifact@v4
with:
name: Edit Mode Test results for Unity ${{ matrix.unityVersion }}
path: editmode-results
# Unity Test Runnerを実行 (プレイモードテスト)
- name: Run Play Mode Tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: ./
unityVersion: ${{ matrix.unityVersion }}
customParameters: -runTests -testPlatform playmode
artifactsPath: playmode-results
# アーティファクトのアップロード(プレイモード)
- name: Upload Play Mode Test results for ${{ matrix.unityVersion }}
uses: actions/upload-artifact@v4
with:
name: Play Mode Test results for Unity ${{ matrix.unityVersion }}
path: playmode-results