forked from thorvg/thorvg
-
Notifications
You must be signed in to change notification settings - Fork 0
182 lines (156 loc) · 6.13 KB
/
regression.yml
File metadata and controls
182 lines (156 loc) · 6.13 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
175
176
177
178
179
180
181
182
name: Regression
# on: [push, pull_request] - enable when testing
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install things
run: |
sudo apt-get update
sudo apt-get install -y wget2 librsvg2-dev librsvg2-bin ninja-build git gcc-multilib g++-multilib earlyoom
sudo pip3 install meson
- name: Compile Thorvg PR
run: |
meson . build -Dtools=svg2png,lottie2gif -Dsavers=gif -Db_sanitize=address,undefined
sudo ninja -C build install
- name: Compile Thorvg Develop
run: |
git clone https://github.com/thorvg/thorvg.git thorvg_develop
cd thorvg_develop
meson . build -Dtools=svg2png
sudo ninja -C build install
cd ..
- name: Download SVG Regression finder and setup settings
run: |
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.4.0/svg_tester
chmod +x ./svg_tester
- name: Prepare valid files to test
run: |
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgValidFiles.zip -O files.zip
unzip -q files.zip
rm files.zip
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgNotValidFiles.zip -O files.zip
unzip -q files.zip
rm files.zip
mv ThorvgValidFiles FilesToTest
find ThorvgNotValidFiles -type f -exec mv {} FilesToTest \;
rmdir ThorvgNotValidFiles
- name: Setup settings for crash/leak/timeout tests
run: |
mv test/regression/settings_crash_leak.toml settings.toml
- name: Run regression finder tests
run: |
./svg_tester 2>&1 | tee result_crashes.txt
- name: Setup settings for comparison tests
run: |
mv test/regression/settings_comparison.toml settings.toml
- name: Store Crashing/Leaking/Timeouting Images
uses: actions/upload-artifact@v4
with:
name: crashing-leaking-timeouting-images
path: BrokenFILES
if-no-files-found: ignore
- name: Clean Data
run: |
rm -rf BrokenSVG || true
rm -rf FilesToTest || true
rm -rf ProblematicSVG || true
rm -rf IgnoredSVG || true
rm -rf BrokenFILES || true
# Test valid files
- name: Prepare valid files to test
run: |
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgValidFiles.zip -O files.zip
unzip -q files.zip
rm files.zip
mv ThorvgValidFiles FilesToTest
- name: Run regression finder tests
run: |
./svg_tester 2>&1 | tee result_valid_files.txt
- name: Store Broken Images for valid inputs
uses: actions/upload-artifact@v4
with:
name: differences-in-valid-files
path: BrokenSVG
if-no-files-found: ignore
- name: Store Problematic Images for valid inputs
uses: actions/upload-artifact@v4
with:
name: problematic-images-in-valid-files
path: ProblematicSVG
if-no-files-found: ignore
- name: Clean Data
run: |
rm -rf BrokenSVG || true
rm -rf FilesToTest || true
rm -rf ProblematicSVG || true
rm -rf IgnoredSVG || true
rm -rf BrokenFILES || true
# Test files that may not work currently good with Thorvg, errors from this are not critical
# it is possible that this will find also some improvements
- name: Prepare not valid to test
run: |
wget -q https://github.com/qarmin/SVG-regression-finder/releases/download/0.3.0/ThorvgNotValidFiles.zip -O files.zip
unzip -q files.zip
rm files.zip
mv ThorvgNotValidFiles FilesToTest
- name: Run invalid files tests
run: |
./svg_tester 2>&1 | tee result_not_valid_files.txt
- name: Store Broken Images for not valid inputs
uses: actions/upload-artifact@v4
with:
name: differences-in-not-valid-files
path: BrokenSVG
if-no-files-found: ignore
- name: Store Problematic Images for not valid inputs
uses: actions/upload-artifact@v4
with:
name: problematic-images-in-not-valid-files
path: ProblematicSVG
if-no-files-found: ignore
- name: Clean Data
run: |
rm -rf BrokenSVG || true
rm -rf FilesToTest || true
rm -rf ProblematicSVG || true
rm -rf IgnoredSVG || true
rm -rf BrokenFILES || true
- name: Test png reproducibility
run: |
wget -q https://github.com/thorvg/thorvg/files/11356766/AA_5.svg.zip -O files.zip
unzip -q files.zip
rm files.zip
cp test/regression/check_same_image_size.py check_same_image_size.py
# Forces to run tasks on different threads if possible, which should help find problem with data races
taskset -c 0-15 python3 check_same_image_size.py AA_5.svg ./build/src/tools/svg2png/svg2png 100 500 2>&1 | tee result_image_size.txt
- name: Check results
run: |
export PATH=$PATH:~/.local/bin/
python3 "${GITHUB_WORKSPACE}/.github/workflows/regression_check.py"
- name: Find Comment
uses: peter-evans/find-comment@v3
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Regression report
# TODO - not works
# - name: Create or update comment
# uses: peter-evans/create-or-update-comment@v4
# with:
# comment-id: ${{ steps.fc.outputs.comment-id }}
# issue-number: ${{ github.event.pull_request.number }}
# body-path: 'comment.txt'
# edit-mode: replace
- name: Fail CI if regression found
run: |
if [[ -f "fail_ci.txt" ]]; then
echo "Check Check results section for more details which tests failed"
exit 1
fi