File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 34
34
35
35
env :
36
36
PATH : /bin:/usr/bin:/usr/local/bin:/home/runner/.local/bin
37
+ REGENERATE_EXAMPLES : true
37
38
38
39
steps :
39
40
- name : GitHub event
@@ -115,7 +116,10 @@ jobs:
115
116
NODE_OPTIONS : --openssl-legacy-provider
116
117
if : github.event_name != 'pull_request_target'
117
118
- run : make check-examples-checker
118
- if : github.event_name != 'pull_request_target'
119
+ if : |
120
+ github.event_name != 'pull_request_target'
121
+ && env.REGENERATE_EXAMPLES == 'false'
122
+
119
123
# Cypress tests
120
124
- run : make serve-gmf-apps &
121
125
if : github.event_name != 'pull_request_target'
@@ -140,6 +144,7 @@ jobs:
140
144
if-no-files-found : ignore
141
145
retention-days : 5
142
146
if : always()
147
+ - run : ' [ ${REGENERATE_EXAMPLES} == false ]'
143
148
- uses : actions/upload-artifact@v4
144
149
with :
145
150
name : GMF Examples
@@ -154,6 +159,8 @@ jobs:
154
159
if-no-files-found : ignore
155
160
retention-days : 5
156
161
if : always()
162
+ - run : find .build/examples-hosted ! -name *-ref.png -type f -exec rm {};
163
+ if : env.REGENERATE_EXAMPLES == 'true'
157
164
- uses : actions/upload-artifact@v4
158
165
with :
159
166
name : Examples hosted
Original file line number Diff line number Diff line change @@ -303,7 +303,8 @@ contribs/dist: .build/build-dll.timestamp
303
303
mkdir -p $(dir $@ )
304
304
CI=true LANGUAGE=en_US buildtools/retry node buildtools/check-example.js \
305
305
.build/examples-hosted/error.html
306
- ! buildtools/check-example .build/examples-hosted/error.html.png examples/error-ref.png
306
+ # Only if REGENERATE_EXAMPLES is not true
307
+ ! ( [ ${REGENERATE_EXAMPLES} != true ] && buildtools/check-example .build/examples-hosted/error.html.png examples/error-ref.png )
307
308
touch $@
308
309
309
310
# Add --generate as argument to buildtools/check-example to regenerate the reference images
Original file line number Diff line number Diff line change @@ -85,8 +85,15 @@ def main():
85
85
)
86
86
result = float (result .stdout .decode ().splitlines ()[- 1 ].split ()[1 ])
87
87
if result > 0.01 :
88
- print (f"{ result } > 0.01 => { diff } " )
89
- sys .exit (1 )
88
+ if os .environ .get ("REGENERATE_EXAMPLES" ) == "true" :
89
+ shutil .copyfile (current , old_ref )
90
+ print ("Regenerate the ref image: " + old_ref )
91
+
92
+ else :
93
+ print (f"{ result } > 0.01 => { diff } " )
94
+ sys .exit (1 )
95
+ elif os .environ .get ("REGENERATE_EXAMPLES" ) == "true" :
96
+ os .remove (old_ref )
90
97
91
98
92
99
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments