forked from DEIS-Tools/MAES
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (132 loc) · 4.16 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Unity Actions
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: {}
### Refer to https://game.ci/docs/github/getting-started
jobs:
setup:
name: Setup Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Cache .NET tools
uses: actions/cache@v3
with:
path: |
~/.nuget/packages
~/.dotnet/tools
key: dotnet-tools-${{ runner.os }}-8.0
restore-keys: |
dotnet-tools-${{ runner.os }}
- name: Cache Packages
uses: actions/cache@v3
with:
path: Assets/Packages
key: Packages
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Install NuGetForUnity.Cli
run: dotnet tool install --global NuGetForUnity.Cli
- name: Restore NuGet Packages for Unity Project
run: nugetforunity restore .
test:
needs: setup
permissions:
checks: write
name: Run all tests ✨
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-test
- uses: actions/cache/restore@v3
with:
path: Assets/Packages
key: Packages
- uses: game-ci/unity-test-runner@v4
id: testRunner
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
projectPath: .
- uses: actions/upload-artifact@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
name: Test results (playmode)
path: ${{ steps.testRunner.outputs.artifactsPath }}
build:
needs: [setup, test]
name: Build for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
targetPlatform:
- StandaloneLinux64
- StandaloneWindows64
- StandaloneOSX
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
- uses: actions/cache/restore@v3
with:
path: Assets/Packages
key: Packages
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
projectPath: .
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build
lint:
name: Lint
runs-on: ubuntu-latest
container: unityci/editor:ubuntu-2022.3.51f1-linux-il2cpp-3.1.0
steps:
- uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Install NuGetForUnity.Cli
run: |
dotnet tool install --global NuGetForUnity.Cli
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: Restore NuGet Packages for Unity Project
run: nugetforunity restore .
- name: Generate Solution
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
run: |
unity-editor -nographics -logFile /dev/stdout -quit -username "$UNITY_EMAIL" -password "$UNITY_PASSWORD" -serial "$UNITY_SERIAL"
unity-editor -nographics -logFile /dev/stdout -customBuildName LinuxProjectFileBuild -projectPath . -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -quit
- name: Format
run: dotnet format MAEPS.sln --exclude "Assets/RosMessages/" --exclude "Assets/YamlDotNet/" --verify-no-changes