generated from vrchat-community/template-package
-
Notifications
You must be signed in to change notification settings - Fork 22
165 lines (141 loc) · 4.97 KB
/
gameci.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# MIT License
#
# Copyright (c) 2022 anatawa12
# Copyright (c) 2022 bd_
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: GameCI
on:
push:
branches: [main, dev]
# This is a bit of a radioactive event; we need to be very careful with what permissions
# we assign this action, as we're allowing arbitrary code execution with the context of
# whatever permissions we assign.
pull_request_target: {}
workflow_dispatch: {}
# pull_request_target grants access to a privileged GITHUB_TOKEN by default, revoke this
permissions: {}
jobs:
build-docs:
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- run: |
mkdir .github/ProjectRoot/Packages/nadena.dev.ndmf -p
mv [^P]* .github/ProjectRoot/Packages/nadena.dev.ndmf
mv .github/ProjectRoot/* .
mv 'Packages/nadena.dev.ndmf/UnitTests~' 'Packages/nadena.dev.ndmf/UnitTests'
- uses: anatawa12/sh-actions/resolve-vpm-packages@master
- run: |
ls -lR
- run: |
ls -lR Packages/nadena*
- uses: actions/cache@v3
with:
path: Library
key: docs-Library-${{ matrix.projectPath }}
restore-keys: Library-
- uses: game-ci/unity-builder@v3
id: docgen
with:
targetPlatform: StandaloneWindows
buildMethod: DocsBuilder.BuildDocs
allowDirtyBuild: true
env:
# meh, just a personal license...
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: docs
path: build/StandaloneWindows64/docs
build-and-test:
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- run: |
mkdir .github/ProjectRoot/Packages/nadena.dev.ndmf -p
mv [^P]* .github/ProjectRoot/Packages/nadena.dev.ndmf
mv .github/ProjectRoot/* .
mv 'Packages/nadena.dev.ndmf/UnitTests~' 'Packages/nadena.dev.ndmf/UnitTests'
- uses: anatawa12/sh-actions/resolve-vpm-packages@master
- run: |
ls -lR
- run: |
ls -lR Packages/nadena*
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.projectPath }}
restore-keys: Library-
- uses: game-ci/unity-test-runner@v3
id: gameci
env:
# meh, just a personal license...
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
testMode: EditMode
githubToken: ${{ github.token }}
coverageOptions: generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+nadena.dev.*
customParameters: -nographics -assemblyNames Tests
targetPlatform: StandaloneWindows
- uses: actions/upload-artifact@v3
if: always()
with:
name: Test results
path: ${{ steps.gameci.outputs.artifactsPath }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: Coverage results
path: ${{ steps.gameci.outputs.coveragePath }}
publish-docs:
if: github.ref == 'refs/heads/main'
permissions:
contents: read
pages: write
runs-on: ubuntu-latest
concurrency:
group: docs-publish
cancel-in-progress: true
needs: build-docs
steps:
- uses: actions/download-artifact@v3
with:
name: docs
path: docs
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2