6
6
on :
7
7
push :
8
8
branches : main
9
- paths : ' programs/x86_64/**'
9
+ paths :
10
+ - ' programs/x86_64/**'
11
+ - .github/workflows/test-apps.yml
10
12
11
13
# pull_request:
12
14
# branches: main
50
52
fi
51
53
git fetch origin main
52
54
if [[ $(git rev-list HEAD...origin/main --count) -gt 0 ]]; then
53
- echo "Changes detected between 'main' and 'testing'. Rebasing ..."
55
+ echo "Changes detected between 'main' and 'testing'. Merging ..."
54
56
git merge origin/main --no-edit
55
57
git push origin testing
56
58
fi
@@ -64,18 +66,34 @@ jobs:
64
66
needs : update-testing-branch
65
67
66
68
steps :
67
- - name : " Check out repository 🏃"
69
+ - name : " Check out main branch (for programs count) 🏃"
68
70
uses : actions/checkout@v4
69
71
with :
70
- ref : testing # Work on testing branch
72
+ ref : main # Work on main branch
71
73
72
- - name : " Show stats 📝 "
74
+ - name : " Count programs 📊 "
73
75
run : |
74
76
x64Count=$(find programs/x86_64/ -type f | wc -l)
75
77
i68Count=$(find programs/i686/ -type f | wc -l)
76
78
a64Count=$(find programs/aarch64/ -type f | wc -l)
79
+ echo "x64Count=$x64Count" >> $GITHUB_ENV
80
+ echo "i68Count=$i68Count" >> $GITHUB_ENV
81
+ echo "a64Count=$a64Count" >> $GITHUB_ENV
82
+
83
+ - name : " Check out testing branch (for tested & failed) 🏃"
84
+ uses : actions/checkout@v4
85
+ with :
86
+ ref : testing # Work on testing branch
87
+
88
+ - name : " Count tested & failed 📊"
89
+ run : |
77
90
tested=$(wc -l < tested.list 2>/dev/null || echo 0)
78
91
failed=$(wc -l < failed.list 2>/dev/null || echo 0)
92
+ echo "x86_64: $x64Count"
93
+ echo "i686: $i68Count"
94
+ echo "aarch64: $a64Count"
95
+ echo "🏁 Tested: $tested"
96
+ echo "❌ Failed: $failed"
79
97
echo "### 🎬 apps" >> $GITHUB_STEP_SUMMARY
80
98
echo "$x64Count x86_64" >> $GITHUB_STEP_SUMMARY
81
99
echo "$i68Count i686" >> $GITHUB_STEP_SUMMARY
@@ -105,18 +123,22 @@ jobs:
105
123
find programs/x86_64/ -maxdepth 1 -type f -printf "%f\n" | sort > all.list
106
124
if [[ -f tested.list ]]; then
107
125
if diff -q all.list tested.list; then
126
+ echo "Everything tested" >> $GITHUB_STEP_SUMMARY
108
127
echo "skip=true" >> $GITHUB_OUTPUT
109
128
exit 0
110
129
else
111
130
comm -23 all.list tested.list > totest_tmp.list
112
131
fi
113
132
else
133
+ echo "First run!" >> $GITHUB_STEP_SUMMARY
114
134
cp all.list totest_tmp.list
115
135
fi
116
136
if [[ -f failed.list ]]; then
117
137
comm -23 totest_tmp.list failed.list > totest.list
118
- echo "Excluding failed!"
138
+ echo "Excluding failed:" >> $GITHUB_STEP_SUMMARY
139
+ cat failed.list >> $GITHUB_STEP_SUMMARY
119
140
if [ ! -s totest.list ]; then
141
+ echo " 🏁 Nothing to test 🏁" >> $GITHUB_STEP_SUMMARY
120
142
echo "skip=true" >> $GITHUB_OUTPUT
121
143
exit 0
122
144
fi
@@ -140,7 +162,7 @@ jobs:
140
162
fail-fast : false
141
163
matrix : ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
142
164
env :
143
- TIMEOUT : 10
165
+ TIMEOUT : 23
144
166
steps :
145
167
- name : " Check out repository 🏃"
146
168
uses : actions/checkout@v4
@@ -164,9 +186,6 @@ jobs:
164
186
mkdir -p results
165
187
script_content=$(curl -Ls https://raw.githubusercontent.com/ivan-hc/AM/main/programs/x86_64/"${{ matrix.file }}")
166
188
pure_arg=$(echo "${{ matrix.file }}" | sed 's/\.appimage//g; s/\^debian-testing-//g; s/\-appimage$//g' | sed 's:.*/::')
167
- to_failed() {
168
- echo "${{ matrix.file }}" > results/ko-${{ matrix.file }}
169
- }
170
189
if timeout "$TIMEOUT"m am -i "${{ matrix.file }}" --debug 2>&1 | tee -a results/log-"${{ matrix.file }}"; then
171
190
echo ""
172
191
echo " Structure of the directory in /opt"
@@ -183,12 +202,10 @@ jobs:
183
202
echo /opt/avidemux | tee -a results/log-"${{ matrix.file }}"
184
203
elif [[ "$pure_arg" =~ (bat-extras|code|deadbeef*|libfuse2|libreoffice|microsoft-edge*|mpv|node|npm|swift|wine) ]]; then
185
204
echo "App not installed, this is a Known error related to GitHub Actions" | tee -a results/log-"${{ matrix.file }}"
186
- OK="1"
187
205
elif test -d /opt/"$pure_arg"*; then
188
206
ls /opt/"$pure_arg"* | tee -a results/log-"${{ matrix.file }}"
189
207
elif echo "$script_content" | grep -q "spooky"; then
190
208
echo "App not installed because marked as \"spooky\", require to be tested manually" | tee -a results/log-"${{ matrix.file }}"
191
- OK="1"
192
209
else
193
210
ls /opt/"${{ matrix.file }}" | tee -a results/log-"${{ matrix.file }}"
194
211
fi
@@ -210,34 +227,32 @@ jobs:
210
227
fi
211
228
echo ""
212
229
echo "-------------------------------------------------------------"
213
- am -R "${{ matrix.file }}" && echo "${{ matrix.file }}" > results/ok-${{ matrix.file }} || [ "OK" =1 ] && echo "${{ matrix.file }}" > results/ok -${{ matrix.file }} || to_failed
230
+ am -R "${{ matrix.file }}" && echo "${{ matrix.file }}" >> results/ok-${{ matrix.file }} || echo "${{ matrix.file }}" >> results/log -${{ matrix.file }}
214
231
else
215
232
if [[ $? -eq 124 ]]; then
216
233
echo "### 💥 ${{ matrix.file }} timeout!" >> $GITHUB_STEP_SUMMARY
217
- echo "Installation timeout in 10 minutes" >> results/log-"${{ matrix.file }}"
218
- to_failed
234
+ echo "Installation timeout in 23 minutes" >> results/log-"${{ matrix.file }}"
235
+ echo "${{ matrix.file }}" >> results/log-${{ matrix.file }}
219
236
else
220
237
echo "### 💀 ${{ matrix.file }}" >> $GITHUB_STEP_SUMMARY
221
- to_failed
238
+ echo "${{ matrix.file }}" >> results/log-${{ matrix.file }}
222
239
fi
223
240
exit 1
224
241
fi
225
242
226
- - name : " Upload Failed Results ☝️"
243
+ - name : " Rename Failed Results ☝️"
227
244
if : failure()
228
- uses : actions/upload-artifact@v4
229
- with :
230
- name : ko-${{ matrix.file }}
231
- path : results/ko-${{ matrix.file }}
245
+ run : |
246
+ mv results/log-${{ matrix.file }} results/ko-${{ matrix.file }}
232
247
233
- - name : " Upload Log Results ☝️"
248
+ - name : " Upload KO Results ☝️"
234
249
if : failure()
235
250
uses : actions/upload-artifact@v4
236
251
with :
237
- name : log -${{ matrix.file }}
238
- path : results/log -${{ matrix.file }}
252
+ name : ko -${{ matrix.file }}
253
+ path : results/ko -${{ matrix.file }}
239
254
240
- - name : " Upload Test Results ⬆️"
255
+ - name : " Upload OK Results ⬆️"
241
256
if : success()
242
257
uses : actions/upload-artifact@v4
243
258
with :
@@ -248,28 +263,31 @@ jobs:
248
263
name : " results 📰"
249
264
needs : run-actions
250
265
runs-on : ubuntu-22.04
251
- if : ${{ needs.generate-matrix.outputs.skip != 'true' }}
266
+ if : always()
252
267
steps :
253
268
- name : " Check out repository 🏃"
254
269
uses : actions/checkout@v4
255
270
with :
256
271
ref : testing
257
272
258
273
- name : " Download Test Results ⬇️"
274
+ if : success()
259
275
uses : actions/download-artifact@v4
260
276
with :
261
277
path : results
262
278
merge-multiple : true
263
- - run : ls -R results
279
+ - run : ls -R results || echo "Nothing tested"
264
280
265
281
- name : " Git Config"
282
+ if : always()
266
283
run : |
267
284
git config user.name "github-actions[bot]"
268
285
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
269
286
270
287
- name : " Aggregate and push results"
288
+ if : always()
271
289
run : |
272
- ls -R results
290
+ ls -R results || echo "Nothing tested"
273
291
#git checkout -b testing
274
292
#git push --set-upstream origin testing
275
293
if compgen -G "results/ok-*" > /dev/null; then
@@ -284,17 +302,16 @@ jobs:
284
302
fi
285
303
if compgen -G "results/ko-*" > /dev/null; then
286
304
for file in results/ko-*; do
287
- cat "$file" >> fail.list
305
+ echo "$file" | cut -d'-' -f2- >> fail.list
288
306
done
289
307
mkdir -p logs
290
- cp results/log -* logs/
308
+ cp results/ko -* logs/
291
309
fail=$(wc -l < fail.list)
292
310
cat fail.list >> failed.list
293
311
sort -u failed.list -o failed.list
294
312
git add failed.list logs
295
313
else
296
314
echo "Nothing failed? Great!"
297
- fail="0"
298
315
fi
299
316
if git diff --cached --quiet; then
300
317
echo "No changes to commit?"
@@ -319,12 +336,16 @@ jobs:
319
336
echo "## 🛅 $remaining to test" >> $GITHUB_STEP_SUMMARY
320
337
echo "😱 $failed fails listed" >> $GITHUB_STEP_SUMMARY
321
338
echo ":x: $fail failed now" >> $GITHUB_STEP_SUMMARY
339
+ if [[ -f fail.list ]]; then
340
+ echo "💀" >> $GITHUB_STEP_SUMMARY
341
+ cat fail.list >> $GITHUB_STEP_SUMMARY
342
+ fi
322
343
323
344
delete-all-artifacts :
324
345
name : " cleanup 🧹"
325
346
runs-on : ubuntu-22.04
326
347
needs : update-tested-list
327
- if : ${{ needs.generate-matrix.outputs.skip != 'true' }}
348
+ if : always()
328
349
steps :
329
350
- name : " Check out repository 🏃"
330
351
uses : actions/checkout@v4
@@ -357,7 +378,7 @@ jobs:
357
378
echo "Successfully deleted $DELETED artifacts."
358
379
359
380
already-tested :
360
- name : " tested"
381
+ name : " all tested"
361
382
runs-on : ubuntu-22.04
362
383
needs : generate-matrix
363
384
if : ${{ needs.generate-matrix.outputs.skip == 'true' }}
0 commit comments