-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (81 loc) · 2.56 KB
/
Copy pathunity-tests.yml
File metadata and controls
91 lines (81 loc) · 2.56 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
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
81
82
83
84
85
86
87
88
89
90
91
name: Unity Tests 🎮
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
checks: write
actions: read
jobs:
# =====================================================
# Запуск тестов
# =====================================================
test:
name: "${{ matrix.testMode }} Tests"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
testMode:
- playmode
- editmode
steps:
# --- Клонируем репозиторий ---
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
# --- Кеширование Library ---
- name: Cache Unity Library
uses: actions/cache@v4
with:
path: Library
key: Library-${{ matrix.testMode }}-${{ hashFiles('Assets/**', 'Packages/manifest.json', 'ProjectSettings/**') }}
restore-keys: |
Library-${{ matrix.testMode }}-
Library-
# --- Запуск тестов ---
- name: Run ${{ matrix.testMode }} tests
uses: game-ci/unity-test-runner@v4
id: tests
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
testMode: ${{ matrix.testMode }}
artifactsPath: TestResults/${{ matrix.testMode }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: "${{ matrix.testMode }} Test Results"
# --- Сохраняем результаты ---
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: Test-Results-${{ matrix.testMode }}
path: ${{ steps.tests.outputs.artifactsPath }}
retention-days: 14
# =====================================================
# Итоговый отчёт
# =====================================================
report:
name: Test Report 📊
runs-on: ubuntu-latest
needs: test
if: always()
steps:
- name: Download all results
uses: actions/download-artifact@v4
with:
path: TestResults
- name: Summary
run: |
echo "## 🎮 Unity Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
for dir in TestResults/*/; do
mode=$(basename "$dir")
echo "- ✅ **$mode** — completed" >> $GITHUB_STEP_SUMMARY
done