-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (94 loc) · 3.27 KB
/
Build_For_Linux.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
99
100
101
102
103
104
105
name: Build For Linux
on:
push:
branches: [feat*]
pull_request:
branches: [main, next, pu*] # those branches cannnot be pushed directly
env:
SRC_DIR: src # Souce Dir
jobs:
StandaloneLinux64_TestRunner_Test:
name: StandaloneLinux64_TestRunner_Test
environment: Unity
runs-on: ubuntu-latest
steps:
# Check
- name: Checkout project
uses: actions/checkout@v4
with:
lfs: true
- name: Cache
uses: actions/cache@v3
with:
path: ${{env.SRC_DIR}}/Library
key: Library-Test-QS-StandaloneLinux64 # Library-<purpose>-<prihect name>-<target platform>
restore-keys: |
Library-QS-
Library-
# Test
- name: Run tests
id: StandaloneLinux64_Test
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectPath: ${{ env.SRC_DIR}}
# unityVersion: "2022.3.45f1" CI will lookup auto
# Output
- name : Upload Test Results
uses: actions/upload-artifact@v3
with:
name: Linux Test Result
path: ${{ steps.StandaloneLinux64_Test.outputs.artifactsPath }}
- name: Upload Test Coverage Results
uses: actions/upload-artifact@v3
if: always()
with:
name: Coverage results
path: ${{ steps.StandaloneLinux64_Test.outputs.coveragePath }}
StandaloneLinux64_Build:
name: StandaloneLinux64_Build
environment: Unity
runs-on: ubuntu-latest
permissions: # for create release
contents: write
discussions: write
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
# Cache
- uses: actions/cache@v3
with:
path: ${{env.SRC_DIR}}/Library
key: Library-Build-QS-StandaloneLinux64
restore-keys: |
Library-Build-QS-
Library-
# Build
- name: Build project
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: StandaloneLinux64
allowDirtyBuild: true
projectPath: ${{ env.SRC_DIR}}
# Output
- uses: actions/upload-artifact@v3
with:
name: Build_StandaloneLinux64
path: build
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.SRC_DIR }}/build