-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (85 loc) · 2.82 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Execute tests after push
on:
push:
branches:
- master
jobs:
build:
name: Build my project ✨
runs-on: ubuntu-latest
steps:
# Free Disk Space
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@v1.3.1
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: false
haskell: true
large-packages: true
docker-images: true
swap-storage: true
# Checkout
- name: Checkout repository
uses: actions/checkout@v4.1.1
# Git LFS Cache
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v4.0.1
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}
- name: Git LFS Pull
run: |
git lfs pull
git add .
git reset --hard
# Library Cache
- name: Cache
uses: actions/cache@v4.0.1
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Tests
- name: Run tests
uses: game-ci/unity-test-runner@v4.1.1
id: myTestStep
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
unityVersion: 2022.3.7f1
projectPath: ./
githubToken: ${{ secrets.GITHUB_TOKEN }}
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+GameRules,+GameView'
- name: Upload tests coverage
uses: actions/upload-artifact@v4.3.1
if: always()
with:
name: Coverage results
path: ${{ steps.myTestStep.outputs.coveragePath }}
# Build
- name: Build
uses: game-ci/unity-builder@v4.2.1
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneWindows64
unityVersion: 2022.3.7f1
versioning: Semantic
allowDirtyBuild: true
- uses: actions/upload-artifact@v4.3.1
with:
name: Build
path: build