-
Notifications
You must be signed in to change notification settings - Fork 144
241 lines (233 loc) · 8.45 KB
/
test.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
name: test
permissions: {}
on:
push:
branches:
- "**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
env:
BLENDER_ARCHIVE_BASE_URL: https://mirrors.ocf.berkeley.edu/blender/release
jobs:
test-windows:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
blender_major_minor_version:
- 2.93
- 3.3
- 3.6
- 4.2
env:
BLENDER_VRM_EXCLUDE_GUI_TEST: true
steps:
- uses: actions/checkout@v4
- name: Cache archive
id: cache-archive
uses: actions/cache@v4
with:
path: blender.zip
key: ${{ matrix.blender_major_minor_version }}-archive-5
- name: Download archive
if: steps.cache-archive.outputs.cache-hit != 'true'
env:
BLENDER_MAJOR_MINOR_VERSION: ${{ matrix.blender_major_minor_version }}
run: |
$url = "${env:BLENDER_ARCHIVE_BASE_URL}/Blender${env:BLENDER_MAJOR_MINOR_VERSION}/blender-${env:BLENDER_MAJOR_MINOR_VERSION}.0-windows-x64.zip"
$retry = 10
for (; $true; $retry--) {
try {
Start-BitsTransfer blender.zip -Source "$url"
break
} catch {
if ($retry -le 0) {
throw $_.Exception
}
}
Start-Sleep -Seconds 60
}
- name: Test
run: |
Expand-Archive -LiteralPath blender.zip -DestinationPath "$env:TEMP\blender"
$env:BLENDER_VRM_TEST_BLENDER_PATH = (Get-ChildItem "$env:TEMP\blender\*\blender.exe")[0].FullName
& "$env:BLENDER_VRM_TEST_BLENDER_PATH" --background -noaudio --python-exit-code 1 --python tools\generate_dynamic_tests.py
& "$env:BLENDER_VRM_TEST_BLENDER_PATH" --background -noaudio --python-exit-code 1 --python tools\unittest_discover.py
- name: Archive failed io test result
uses: actions/upload-artifact@v4
if: failure()
with:
name: VRMs (${{ github.job }}#${{ strategy.job-index }})
path: tests/resources/vrm/*/temp
test-macos:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
blender_major_minor_version:
- 2.93
- 3.3
- 3.6
- 4.2
blender_arch:
- arm64
include:
- blender_major_minor_version: 4.2
blender_arch: x64
env:
BLENDER_VRM_EXCLUDE_GUI_TEST: true
steps:
- uses: actions/checkout@v4
- name: Cache archive
id: cache-archive
uses: actions/cache@v4
with:
path: blender.dmg
key: ${{ matrix.blender_major_minor_version }}-${{ matrix.blender_arch }}-archive-5
- name: Download archive
if: steps.cache-archive.outputs.cache-hit != 'true'
env:
BLENDER_MAJOR_MINOR_VERSION: ${{ matrix.blender_major_minor_version }}
BLENDER_ARCH: ${{ matrix.blender_arch }}
run: |
url="${BLENDER_ARCHIVE_BASE_URL}/Blender${BLENDER_MAJOR_MINOR_VERSION}/blender-${BLENDER_MAJOR_MINOR_VERSION}.0-macos-${BLENDER_ARCH}.dmg"
curl -fsLS --retry 5 --retry-all-errors "$url" -o blender.dmg
- name: Test
run: |
hdiutil attach blender.dmg
cp -fr /Volumes/Blender/Blender.app /Applications
/Applications/Blender.app/Contents/MacOS/blender --background -noaudio --python-exit-code 1 --python tools/generate_dynamic_tests.py
/Applications/Blender.app/Contents/MacOS/blender --background -noaudio --python-exit-code 1 --python tools/unittest_discover.py
- name: Archive failed io test result
uses: actions/upload-artifact@v4
if: failure()
with:
name: VRMs (${{ github.job }}#${{ strategy.job-index }})
path: tests/resources/vrm/*/temp
test-linux:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
blender_major_minor_version:
- 4.2
env:
BLENDER_VRM_EXCLUDE_GUI_TEST: true
steps:
- uses: actions/checkout@v4
- name: Cache archive
id: cache-archive
uses: actions/cache@v4
with:
path: blender.tar.gz
key: ${{ matrix.blender_major_minor_version }}-archive-6
- name: Download archive
if: steps.cache-archive.outputs.cache-hit != 'true'
env:
BLENDER_MAJOR_MINOR_VERSION: ${{ matrix.blender_major_minor_version }}
run: |
url="${BLENDER_ARCHIVE_BASE_URL}/Blender${BLENDER_MAJOR_MINOR_VERSION}/blender-${BLENDER_MAJOR_MINOR_VERSION}.0-linux-x64.tar.xz"
curl -fsLS --retry 5 --retry-all-errors "$url" -o blender.tar.xz
- name: Test
run: |
mkdir -p "$HOME/.local/blender"
tar -x --strip-components=1 -f blender.tar.xz -C "$HOME/.local/blender"
"$HOME/.local/blender/blender" --background -noaudio --python-exit-code 1 --python tools/generate_dynamic_tests.py
"$HOME/.local/blender/blender" --background -noaudio --python-exit-code 1 --python tools/unittest_discover.py
- name: Archive failed io test result
uses: actions/upload-artifact@v4
if: failure()
with:
name: VRMs (${{ github.job }}#${{ strategy.job-index }})
path: tests/resources/vrm/*/temp
lint:
runs-on: ubuntu-24.04
steps:
- name: Install deb packages
run: |
sudo apt-get update -qq || true
sudo apt-get install -y python3 shellcheck shfmt uchardet
env:
DEBIAN_FRONTEND: noninteractive
- uses: actions/checkout@v4
with:
fetch-depth: 0 # for super-linter
- name: Disable git config core.quotepath
run: git config core.quotepath off
- name: Check file permissions
run: |
git ls-files ':!tools/*.sh' ':!tools/*.py' ':!tests/resources' ':!typings' | while read -r f; do
echo "$f"
if [ -x "$f" ]; then
echo "$f has unnecessary executable permission."
exit 1
fi
done
git ls-files 'tools/*.sh' 'tools/*.py' | while read -r f; do
echo "$f"
if [ ! -x "$f" ]; then
echo "$f has no executable permission."
exit 1
fi
done
- name: Check file name characters
run: |
git ls-files | while read -r f; do
encoding=$(echo "$f" | uchardet)
if [ "$encoding" != "ASCII" ]; then
echo "$f is not ascii file name but $encoding."
exit 1
fi
done
git ls-files "*.py" "*.pyi" | while read -r f; do
if [ "$f" != "$(echo "$f" | LC_ALL=C tr "[:upper:]" "[:lower:]")" ]; then
echo "$f contains uppercase character"
exit 1
fi
done
- name: Install UV
run: |
curl --fail --show-error --location https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Install UV dependencies
run: |
for _ in $(seq 5); do
if uv sync; then
break
fi
done
- name: Check source code formatting
run: |
./tools/format.sh
git diff --exit-code
- name: Check property type annotations
run: |
uv run python tools/property_typing.py > property_typing.log
./tools/format.sh
git diff --exit-code
- name: Install hadolint
run: ./tools/install_hadolint.sh
- name: Lint
run: ./tools/lint.sh
- name: Sanity Check
run: |
uv run python -c "import io_scene_vrm; io_scene_vrm.register(); io_scene_vrm.unregister()"
- name: Super-Linter
uses: super-linter/super-linter@v7.2.1
env:
LINTER_RULES_PATH: /
FILTER_REGEX_EXCLUDE: ^/github/workspace/CHANGELOG\.md$ # CHANGELOG.mdはrelease-pleaseによる自動生成ファイル
LOG_LEVEL: NOTICE
MARKDOWN_CONFIG_FILE: .markdownlint.yaml
GITHUB_ACTIONS_CONFIG_FILE: .github/actionlint.yaml
VALIDATE_GO: false
VALIDATE_GO_MODULES: false
VALIDATE_HTML: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_JSCPD: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_PYINK: false
VALIDATE_PYTHON_PYLINT: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}