-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (138 loc) · 4.63 KB
/
Copy pathci.yml
File metadata and controls
174 lines (138 loc) · 4.63 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Python ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Install dependencies
run: python -m pip install -r requirements.txt -r requirements-dev.txt
- name: Check high-confidence Python errors
run: python -m ruff check .
- name: Compile Python modules
run: python -m compileall -q .
- name: Check version consistency
run: python scripts/check_version.py
- name: Run tests
run: python tests.py
- name: Run legacy integration tests
run: python integration_tests.py
- name: Validate Linux shell scripts
if: runner.os == 'Linux'
run: |
sh -n setup.sh
sh -n run-unityscraper.sh
sh -n build_linux.sh
sh -n packaging/linux/install.sh
sh -n packaging/linux/uninstall.sh
- name: Validate macOS shell script
if: runner.os == 'macOS'
run: sh -n build_macos.sh
windows-build:
name: Windows executable
runs-on: windows-latest
needs: test
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Install build dependencies
run: python -m pip install -r requirements.txt pyinstaller
- name: Build
run: python -m PyInstaller --clean --noconfirm UnityScraper.spec
- name: Generate checksum
shell: pwsh
run: |
$hash = (Get-FileHash dist\UnityScraper.exe -Algorithm SHA256).Hash.ToLower()
"$hash *UnityScraper.exe" | Set-Content dist\UnityScraper.exe.sha256
- uses: actions/upload-artifact@v7
with:
name: UnityScraper-Windows-x64
path: |
dist/UnityScraper.exe
dist/UnityScraper.exe.sha256
if-no-files-found: error
linux-build:
name: Linux executable
runs-on: ubuntu-22.04
needs: test
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Install desktop build dependencies
run: |
sudo apt-get update
sudo apt-get install -y appstream desktop-file-utils python3-tk xvfb
python -m pip install -r requirements.txt pyinstaller
- name: Validate desktop metadata
run: |
sed -e 's|@EXEC@|/usr/bin/unityscraper|g' \
-e 's|@ICON@|io.github.trapemall.UnityScraper|g' \
packaging/linux/io.github.trapemall.UnityScraper.desktop \
> /tmp/io.github.trapemall.UnityScraper.desktop
desktop-file-validate /tmp/io.github.trapemall.UnityScraper.desktop
appstreamcli validate --no-net packaging/linux/io.github.trapemall.UnityScraper.metainfo.xml
- name: Build Linux bundle
run: ./build_linux.sh
- name: Smoke test graphical executable
run: |
set +e
xvfb-run -a timeout 8s dist/UnityScraper
status=$?
set -e
test "$status" -eq 124
- uses: actions/upload-artifact@v7
with:
name: UnityScraper-Linux-x86_64
path: |
dist/UnityScraper-Linux-x86_64.tar.gz
dist/UnityScraper-Linux-x86_64.tar.gz.sha256
if-no-files-found: error
macos-build:
name: macOS application
runs-on: macos-14
needs: test
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Install build dependencies
run: python -m pip install -r requirements.txt pyinstaller
- name: Build macOS application
run: ./build_macos.sh
- name: Validate application bundle
run: |
test -x dist/UnityScraper.app/Contents/MacOS/UnityScraper
plutil -lint dist/UnityScraper.app/Contents/Info.plist
- uses: actions/upload-artifact@v7
with:
name: UnityScraper-macOS-arm64
path: |
dist/UnityScraper-macOS-arm64.tar.gz
dist/UnityScraper-macOS-arm64.tar.gz.sha256
if-no-files-found: error