forked from bigbluebutton/bigbluebutton
-
Notifications
You must be signed in to change notification settings - Fork 0
733 lines (722 loc) · 30.3 KB
/
Copy pathautomated-tests.yml
File metadata and controls
733 lines (722 loc) · 30.3 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
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
name: "Automated tests"
on:
push:
branches:
- "develop"
- "v2.[5-9].x-release"
- "v[3-9].*.x-release"
paths-ignore:
- "docs/**"
- "**/*.md"
- "bigbluebutton-html5/public/locales/*.json"
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- "docs/**"
- "**/*.md"
- "bigbluebutton-html5/public/locales/*.json"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-package:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
package:
[
bbb-apps-akka,
bbb-config,
bbb-export-annotations,
bbb-learning-dashboard,
bbb-playback-record,
bbb-graphql-server,
bbb-shared-notes-server,
bbb-etherpad,
bbb-web,
bbb-fsesl-akka,
bbb-html5,
bbb-freeswitch,
bbb-webrtc,
others,
]
include:
- package: bbb-apps-akka
cache-files-list: akka-bbb-apps bbb-common-message
- package: bbb-config
cache-files-list: bigbluebutton-config
- package: bbb-export-annotations
cache-files-list: bbb-export-annotations
- package: bbb-learning-dashboard
cache-files-list: bbb-learning-dashboard
- package: bbb-playback-record
build-list: bbb-playback bbb-playback-notes bbb-playback-podcast bbb-playback-presentation bbb-playback-screenshare bbb-playback-video bbb-record-core
cache-files-list: bbb-playback.placeholder.sh bbb-presentation-video.placeholder.sh record-and-playback
- package: bbb-graphql-server
build-name: bbb-graphql-server
build-list: bbb-graphql-server bbb-graphql-middleware bbb-graphql-actions
cache-files-list: bbb-graphql-server bbb-graphql-middleware bbb-graphql-actions
- package: bbb-shared-notes-server
cache-files-list: bbb-shared-notes-server
- package: bbb-etherpad
cache-files-list: bbb-etherpad.placeholder.sh
cache-urls-list: https://api.github.com/repos/mconf/ep_pad_ttl/commits https://api.github.com/repos/alangecker/bbb-etherpad-plugin/commits https://api.github.com/repos/mconf/ep_redis_publisher/commits https://api.github.com/repos/alangecker/bbb-etherpad-skin/commits
- package: bbb-web
cache-files-list: bigbluebutton-web bbb-common-message bbb-common-web
- package: bbb-fsesl-akka
cache-files-list: akka-bbb-fsesl bbb-common-message
- package: bbb-html5
build-list: bbb-html5
cache-files-list: bigbluebutton-html5
- package: bbb-freeswitch
build-list: bbb-freeswitch-core bbb-freeswitch-sounds
cache-files-list: freeswitch.placeholder.sh
cache-urls-list: https://ubuntu.bigbluebutton.org/sounds.tar.gz
- package: bbb-webrtc
build-list: bbb-webrtc-sfu bbb-webrtc-recorder
cache-files-list: bbb-webrtc-sfu.placeholder.sh bbb-webrtc-recorder.placeholder.sh
- package: others
build-list: bbb-mkclean bbb-pads bbb-libreoffice-docker bbb-transcription-controller bbb-livekit
cache-files-list: bbb-pads.placeholder.sh bbb-libreoffice bbb-transcription-controller.placeholder.sh
steps:
- name: Checkout PR's source merged into its target branch
if: github.event_name == 'pull_request'
uses: actions/checkout@v5
with:
ref: refs/pull/${{ github.event.number }}/merge
- name: Checkout commit/branch
if: github.event_name != 'pull_request'
uses: actions/checkout@v5
with:
ref: ${{ github.ref }}
- name: Set cache-key vars
run: |
BUILD_DIRS="$(echo '${{ matrix.build-list || matrix.package }}' | sed 's/[^ ]\+/build\/packages-template\/&/g')"
echo "Including build dirs: $BUILD_DIRS"
LIST="${{ matrix.cache-files-list }} $BUILD_DIRS .gitlab-ci.yml build/deb-helper.sh"
TREE_HASHES=$(echo $LIST | tr ' ' '\n' | xargs -I {} git rev-parse HEAD:{} 2>/dev/null)
CACHE_DIGEST=$(printf "%s" "$TREE_HASHES" | (sha256sum 2>/dev/null || shasum -a 256) | awk '{print $1}')
echo "CACHE_KEY_FILES=$CACHE_DIGEST" >> $GITHUB_ENV
echo "CACHE_KEY_URLS=$(echo '${{ matrix.cache-urls-list }}' | xargs -r -n 1 curl -Is | grep -i 'Last-Modified' | md5sum | cut -c1-10)" >> $GITHUB_ENV
cat bigbluebutton-config/bigbluebutton-release >> $GITHUB_ENV
# GIT_REV and COMMIT_DATE are not forced to 0 — each package gets
# a unique version based on its build time. The bigbluebutton meta-package
# is built in unify-artifacts where it reads actual .deb versions.
- name: Handle cache
if: matrix.cache-files-list != ''
id: cache-action
uses: actions/cache@v5
with:
path: artifacts/
key: ${{ runner.os }}-${{ matrix.package }}-${{ env.BIGBLUEBUTTON_RELEASE }}-commits-${{ env.CACHE_KEY_FILES }}-urls-${{ env.CACHE_KEY_URLS }}
- if: ${{ steps.cache-action.outputs.cache-hit != 'true' }}
name: Generate artifacts
shell: bash
run: |
./build/get_external_dependencies.sh
echo "${{ matrix.build-list || matrix.package }}" | xargs -n 1 ./build/setup.sh
- name: Include external dependency .debs in artifacts
shell: bash
run: |
mkdir -p artifacts
# Download external deps if not already present (e.g. from cache hit)
if [ ! -d "bbb-presentation-video" ]; then
bash -xe bbb-presentation-video.placeholder.sh || true
fi
# Copy any external dep .debs into artifacts
for dir in bbb-presentation-video; do
if [ -d "$dir" ]; then
echo "Including external deps from $dir/"
ls "$dir"/*.deb 2>/dev/null
cp "$dir"/*.deb artifacts/ 2>/dev/null || true
fi
done
- name: Sanitize artifact filenames
shell: bash
run: |
if [ -d "artifacts" ]; then
echo "Sanitizing filenames to remove problematic characters..."
find artifacts -name "*:*" -type f | while read -r file; do
# Replace colons with underscores
newfile=$(echo "$file" | sed 's/:/_/g')
echo "Renaming: $file -> $newfile"
mv "$file" "$newfile"
done
echo "Final artifacts contents:"
ls -la artifacts/
fi
- name: Archive packages
uses: actions/upload-artifact@v6
with:
name: artifacts_${{ matrix.package }}
path: artifacts/
bbb-libreoffice-image:
runs-on: ubuntu-24.04
steps:
- name: Checkout PR's source merged into its target branch
if: github.event_name == 'pull_request'
uses: actions/checkout@v5
with:
ref: refs/pull/${{ github.event.number }}/merge
- name: Checkout commit/branch
if: github.event_name != 'pull_request'
uses: actions/checkout@v5
with:
ref: ${{ github.ref }}
- name: LIBREOFFICE CACHE - Set cache-key vars
run: |
echo "BBB_LIBREOFFICE_IMAGE_NAME=$(head -n 1 bbb-libreoffice/docker/Dockerfile | cut -d ' ' -f 2)" >> $GITHUB_ENV
- name: LIBREOFFICE CACHE - Restore docker image from cache
id: libreoffice-cache
uses: actions/cache@v5
with:
path: bbb-libreoffice.tar
key: ${{ env.BBB_LIBREOFFICE_IMAGE_NAME }}
- name: LIBREOFFICE CACHE - Pull and save docker image (first time / cache miss)
if: steps.libreoffice-cache.outputs.cache-hit != 'true'
run: |
docker pull docker.io/${{ env.BBB_LIBREOFFICE_IMAGE_NAME }}
docker save docker.io/${{ env.BBB_LIBREOFFICE_IMAGE_NAME }} -o bbb-libreoffice.tar
unify-artifacts:
needs: build-package
runs-on: ubuntu-24.04
steps:
- name: Create all-artifacts directory
run: mkdir -p all-artifacts
- name: Download artifacts_bbb-apps-akka
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-apps-akka
path: all-artifacts
- name: Download artifacts_bbb-config
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-config
path: all-artifacts
- name: Download artifacts_bbb-export-annotations
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-export-annotations
path: all-artifacts
- name: Download artifacts_bbb-learning-dashboard
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-learning-dashboard
path: all-artifacts
- name: Download artifacts_bbb-playback-record
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-playback-record
path: all-artifacts
- name: Download artifacts_bbb-graphql-server
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-graphql-server
path: all-artifacts
- name: Download artifacts_bbb-etherpad
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-etherpad
path: all-artifacts
- name: Download artifacts_bbb-shared-notes-server
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-shared-notes-server
path: all-artifacts
- name: Download artifacts_bbb-freeswitch
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-freeswitch
path: all-artifacts
- name: Download artifacts_bbb-webrtc
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-webrtc
path: all-artifacts
- name: Download artifacts_bbb-web
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-web
path: all-artifacts
- name: Download artifacts_bbb-fsesl-akka
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-fsesl-akka
path: all-artifacts
- name: Download artifacts_bbb-html5
uses: actions/download-artifact@v7
with:
name: artifacts_bbb-html5
path: all-artifacts
- name: Download artifacts_others
uses: actions/download-artifact@v7
with:
name: artifacts_others
path: all-artifacts
- name: List final artifacts
run: |
echo "Final contents of all-artifacts:"
ls -la all-artifacts/
- name: Build bigbluebutton meta-package
run: |
sudo apt-get install -y -qq equivs
DEBS_DIR="all-artifacts"
PKGS="bbb-apps-akka bbb-config bbb-etherpad bbb-export-annotations
bbb-freeswitch-core bbb-freeswitch-sounds bbb-fsesl-akka bbb-html5
bbb-learning-dashboard bbb-libreoffice-docker bbb-mkclean bbb-pads
bbb-playback bbb-playback-presentation bbb-record-core bbb-web
bbb-webrtc-sfu bbb-webrtc-recorder"
# Use the version from the first .deb we find as the meta-package version
FIRST_DEB=$(ls "$DEBS_DIR"/*.deb | head -1)
META_VERSION=$(dpkg-deb --show --showformat='${Version}' "$FIRST_DEB")
echo "Meta-package version: $META_VERSION"
# Build dependency list with real versions from actual .debs
DEPENDENCIES=""
for PKG in $PKGS; do
DEB_FILE=$(find "$DEBS_DIR" -maxdepth 1 -name "${PKG}_*.deb" 2>/dev/null | head -1)
if [ -z "$DEB_FILE" ]; then
# Try with underscores (e.g. bbb_apps_akka)
DEB_FILE=$(find "$DEBS_DIR" -maxdepth 1 -name "${PKG//-/_}_*.deb" 2>/dev/null | head -1)
fi
if [ -n "$DEB_FILE" ]; then
PKG_VERSION=$(dpkg-deb --show --showformat='${Version}' "$DEB_FILE")
echo " $PKG = $PKG_VERSION (from $(basename $DEB_FILE))"
else
echo " WARNING: No .deb found for $PKG, using meta version"
PKG_VERSION="$META_VERSION"
fi
if [ -n "$DEPENDENCIES" ]; then DEPENDENCIES="${DEPENDENCIES},"; fi
DEPENDENCIES="${DEPENDENCIES} ${PKG} (= ${PKG_VERSION})"
done
cat > /tmp/control <<EOF
Section: web
Priority: optional
Homepage: https://bigbluebutton.org/
Standards-Version: 3.9.2
Package: bigbluebutton
Version: $META_VERSION
Maintainer: Fred Dixon <ffdixon@bigbluebutton.org>
Depends: $DEPENDENCIES
Architecture: amd64
Description: Virtual Classroom
BigBlueButton is a virtual classroom for online teaching and learning.
EOF
cd /tmp && equivs-build control
cp /tmp/bigbluebutton_*.deb "$GITHUB_WORKSPACE/all-artifacts/"
echo "Built bigbluebutton meta-package:"
dpkg-deb --info "$GITHUB_WORKSPACE"/all-artifacts/bigbluebutton_*.deb | head -20
- name: Upload unified all-artifacts directory
uses: actions/upload-artifact@v6
with:
name: all-bbb-artifacts
path: all-artifacts/
- name: Remove individual artifacts
uses: geekyeggo/delete-artifact@v6
with:
name: |
artifacts_bbb-apps-akka
artifacts_bbb-config
artifacts_bbb-export-annotations
artifacts_bbb-learning-dashboard
artifacts_bbb-playback-record
artifacts_bbb-graphql-server
artifacts_bbb-etherpad
artifacts_bbb-shared-notes-server
artifacts_bbb-freeswitch
artifacts_bbb-webrtc
artifacts_bbb-web
artifacts_bbb-fsesl-akka
artifacts_bbb-html5
artifacts_others
failOnError: false
install-and-run-bbb-tests:
needs:
- unify-artifacts
- bbb-libreoffice-image
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8]
env:
shard: ${{ matrix.shard }}/8
MATRIX_SHARD_UNDERSCORED: ${{ matrix.shard }}_8
steps:
- name: Checkout PR's source merged into its target branch
if: github.event_name == 'pull_request'
uses: actions/checkout@v5
with:
ref: refs/pull/${{ github.event.number }}/merge
- name: Checkout commit/branch
if: github.event_name != 'pull_request'
uses: actions/checkout@v5
with:
ref: ${{ github.ref }}
- name: Install BBB
timeout-minutes: 60
uses: ./.github/actions/install-bbb
- uses: actions/setup-node@v5
name: PLAYWRIGHT CACHE - Restore Playwright node modules from cache
with:
cache: "npm"
cache-dependency-path: bigbluebutton-tests/playwright/package-lock.json
- name: PLAYWRIGHT CACHE - Restore Playwright binaries from cache
id: cache
uses: actions/cache@v5
with:
path: /home/runner/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-bins-${{ hashFiles('bigbluebutton-tests/playwright/package-lock.json') }}
- name: Install test dependencies
working-directory: ./bigbluebutton-tests/playwright
timeout-minutes: 25
run: |
npm ci
npx playwright install-deps
npx playwright install
- name: Run tests
working-directory: ./bigbluebutton-tests/playwright
timeout-minutes: 25
env:
NODE_EXTRA_CA_CERTS: /usr/local/share/ca-certificates/bbb-dev/bbb-dev-ca.crt
ACTIONS_RUNNER_DEBUG: true
BBB_URL: https://bbb-ci.test/bigbluebutton/
BBB_SECRET: bbbci
run: npm run test-chromium-ci -- --shard=${{ env.shard }}
- name: Run Firefox tests
working-directory: ./bigbluebutton-tests/playwright
if: |
contains(join(github.event.pull_request.labels.*.name, ' '), 'test Firefox') ||
contains(join(github.event.pull_request.labels.*.name, ' '), 'Test Firefox')
env:
NODE_EXTRA_CA_CERTS: /usr/local/share/ca-certificates/bbb-dev/bbb-dev-ca.crt
ACTIONS_RUNNER_DEBUG: true
BBB_URL: https://bbb-ci.test/bigbluebutton/
BBB_SECRET: bbbci
# patch playwright's firefox so that it uses the system's root certificate authority
run: |
find $HOME/.cache/ms-playwright -name libnssckbi.so -exec rm {} \; -exec ln -s /usr/lib/x86_64-linux-gnu/pkcs11/p11-kit-trust.so {} \;
npm run test-firefox-ci -- --shard=${{ env.shard }}
- if: failure()
name: Upload blob report to GitHub Actions Artifacts
uses: actions/upload-artifact@v6
with:
name: blob-report-${{ matrix.shard }}
path: bigbluebutton-tests/playwright/blob-report
if-no-files-found: ignore
- if: failure()
name: Generate the shard HTML report from blob report
shell: bash
working-directory: ./bigbluebutton-tests/playwright
run: |
if [ -d "./blob-report" ]; then
npx playwright merge-reports --reporter html ./blob-report
else
echo "blob-report directory not found, skipping HTML report generation"
fi
- if: failure()
name: Upload shard HTML report to GitHub Actions Artifacts
uses: actions/upload-artifact@v6
with:
name: test-report_shard-${{ matrix.shard }}
path: bigbluebutton-tests/playwright/playwright-report
- if: always()
name: Upload logs folder
uses: actions/upload-artifact@v6
with:
name: browser-logs-${{ matrix.shard }}
path: bigbluebutton-tests/playwright/logs
- if: failure()
name: Prepare artifacts
uses: ./.github/actions/prepare-artifacts
- if: failure()
name: Upload bbb-configs artifact
uses: actions/upload-artifact@v6
with:
name: bbb-configs-${{ env.MATRIX_SHARD_UNDERSCORED }}
path: configs
- if: failure()
name: Upload bbb-logs artifact
uses: actions/upload-artifact@v6
with:
name: bbb-logs-${{ env.MATRIX_SHARD_UNDERSCORED }}
path: ./bbb-logs.tar.gz
- name: APT CACHE - Check for changes using packages hash
if: success() && matrix.shard == 1 && github.event_name != 'pull_request'
id: apt-manifest
shell: bash
run: |
sudo chown -R "$USER:$USER" /var/cache/apt/archives || true
sudo chmod 755 /var/cache/apt/archives /var/cache/apt/archives/partial 2>/dev/null || true
hash=$(find /var/cache/apt/archives -type f -name '*.deb' \
| sort \
| sha256sum \
| cut -d' ' -f1)
echo "hash=$hash" >> $GITHUB_OUTPUT
- name: APT CACHE - Upload new packages (if changed)
if: success() && matrix.shard == 1 && github.event_name != 'pull_request'
uses: actions/cache/save@v5
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('bigbluebutton-config/bigbluebutton-release') }}-${{ steps.apt-manifest.outputs.hash }}
push-debs-to-package-repo:
needs: unify-artifacts
if: github.event_name == 'push'
runs-on: ubuntu-24.04
environment: apt-repo
steps:
- name: Download unified artifacts
uses: actions/download-artifact@v4
with:
name: all-bbb-artifacts
path: all-artifacts
- name: Add repo host to known_hosts
env:
REPO_HOST: ${{ secrets.PKG_REPO_HOST }}
run: |
mkdir -p ~/.ssh
[ -n "$REPO_HOST" ] && ssh-keyscan -H "$REPO_HOST" >> ~/.ssh/known_hosts || echo "PKG_REPO_HOST not set, skipping"
- name: Push .deb to package repo
env:
SSH_KEY: ${{ secrets.PKG_REPO_SSH_KEY }}
REPO_HOST: ${{ secrets.PKG_REPO_HOST }}
REPO_USER: ${{ secrets.PKG_REPO_USER }}
run: |
eval $(ssh-agent -s)
trap 'ssh-agent -k' EXIT
echo "$SSH_KEY" | tr -d '\r' | ssh-add -
rsync -avz -e "ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=10" \
all-artifacts/*.deb ${REPO_USER}@${REPO_HOST}:/srv/apt-incoming/
# Trigger processing for the target codename (e.g. noble-40 or noble-41 or noble-41-dev)
ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=10 \
${REPO_USER}@${REPO_HOST} \
"sudo -u aptrepo /usr/local/bin/repo-process-incoming noble-40-dev"
install-and-run-plugin-tests:
needs:
- unify-artifacts
- bbb-libreoffice-image
runs-on: ubuntu-24.04
strategy:
fail-fast: false
env:
SAMPLES_WITH_TESTS: "sample-action-button-dropdown-plugin sample-actions-bar-plugin sample-audio-settings-dropdown-plugin sample-camera-settings-dropdown-plugin sample-custom-subscription-hook sample-data-channel-plugin"
steps:
- name: Checkout PR's source merged into its target branch
if: github.event_name == 'pull_request'
uses: actions/checkout@v5
with:
ref: refs/pull/${{ github.event.number }}/merge
- name: Checkout commit/branch
if: github.event_name != 'pull_request'
uses: actions/checkout@v5
with:
ref: ${{ github.ref }}
- name: Install BBB
timeout-minutes: 60
uses: ./.github/actions/install-bbb
- name: Extract download URL of the SDK version information from bigbluebutton-html5/package.json
working-directory: ./bigbluebutton-html5
run: |
SDK_DEP=$(jq -r '.dependencies["bigbluebutton-html-plugin-sdk"]' package.json)
if echo "$SDK_DEP" | grep -q "codeload.github.com"; then
echo "SDK_URL=$SDK_DEP" >> $GITHUB_ENV
else
SDK_VERSION=$(jq -r '.packages["node_modules/bigbluebutton-html-plugin-sdk"]["version"]' package-lock.json)
echo "SDK_URL=https://github.com/${{ github.repository_owner }}/bigbluebutton-html-plugin-sdk/archive/refs/tags/v${SDK_VERSION}.tar.gz" >> $GITHUB_ENV
fi
- name: Plugins SDK - Download bigbluebutton-html-plugin-sdk.tar.gz
working-directory: bigbluebutton-tests
run: |
wget -O bigbluebutton-html-plugin-sdk.tar.gz $SDK_URL
mkdir -p bigbluebutton-html-plugin-sdk
tar -xzf bigbluebutton-html-plugin-sdk.tar.gz -C bigbluebutton-html-plugin-sdk --strip-components=1
- name: PLAYWRIGHT CACHE (Plugins SDK) - Restore Playwright node modules from cache
uses: actions/setup-node@v5
with:
cache: "npm"
cache-dependency-path: |
bigbluebutton-tests/bigbluebutton-html-plugin-sdk/package-lock.json
bigbluebutton-tests/bigbluebutton-html-plugin-sdk/samples/**/package-lock.json
- name: PLAYWRIGHT CACHE - Restore Playwright binaries from cache
id: cache
uses: actions/cache@v5
with:
path: /home/runner/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-bins-${{ hashFiles('bigbluebutton-tests/bigbluebutton-html-plugin-sdk/package-lock.json') }}
- name: Plugins SDK - Install node dependencies
working-directory: ./bigbluebutton-tests/bigbluebutton-html-plugin-sdk
run: |
echo "Installing plugins SDK dependencies"
npm ci
- name: Install sample plugin dependencies
working-directory: ./bigbluebutton-tests/bigbluebutton-html-plugin-sdk
run: |
echo "Installing plugin samples dependencies"
for sample in $SAMPLES_WITH_TESTS; do
if [ -d "./samples/$sample" ]; then
echo "Installing dependencies for sample: $sample"
cd "./samples/$sample"
npm ci
cd - > /dev/null
else
echo "Sample not found: $sample"
fi
done
- name: Build plugins SDK and publish to samples
working-directory: ./bigbluebutton-tests/bigbluebutton-html-plugin-sdk
run: |
npm ci
npm run build
./scripts/publish-to-samples.sh
- name: Build sample plugins (that contain tests) and copy built files to the plugin assets directory
working-directory: ./bigbluebutton-tests/bigbluebutton-html-plugin-sdk
run: |
echo "Building all samples inside the 'samples' directory that contain tests"
for sample in $SAMPLES_WITH_TESTS; do
if [ -d "./samples/$sample" ]; then
echo "Building sample: $sample"
cd "./samples/$sample"
npm run build-bundle
sudo mkdir -p /var/www/bigbluebutton-default/assets/plugins/$sample
sudo cp -r dist /var/www/bigbluebutton-default/assets/plugins/$sample/
cd - > /dev/null
else
echo "Sample not found: $sample"
fi
done
- name: Install test dependencies
working-directory: ./bigbluebutton-tests/bigbluebutton-html-plugin-sdk
timeout-minutes: 25
run: |
npm ci
npx playwright install-deps
npx playwright install
- name: Prepare flaky test exclusions
working-directory: ./bigbluebutton-tests/bigbluebutton-html-plugin-sdk
run: |
# Read flaky tests from core repo and build a grep-invert parameter
FLAKY_TESTS_FILE="../playwright/sdk-flaky-tests.txt"
FLAKY_TESTS_LINES=""
if [ -f "$FLAKY_TESTS_FILE" ]; then
echo "Reading flaky tests from $FLAKY_TESTS_FILE"
# Process the file:
# - remove CRLF if present (Windows line endings)
# - ignore comments (#...) and empty lines
# - escape regex metacharacters to avoid breaking grep
# - replace " › " with ".*" to allow flexible matching
# - join all patterns into a single alternation regex separated by '|'
FLAKY_TESTS_LINES="$(
sed 's/\r$//' "$FLAKY_TESTS_FILE" \
| grep -Ev '^[[:space:]]*(#|$)' \
| sed -E 's/[][(){}.^$*+?|\]/\\&/g' \
| sed 's/ › /.*/g' \
| paste -sd'|' -
)"
# If we have patterns, print them; otherwise, say none found
if [ -n "$FLAKY_TESTS_LINES" ]; then
echo "Will skip flaky tests: $FLAKY_TESTS_LINES"
else
echo "No flaky tests to skip"
fi
else
# If the file does not exist, just run all tests
echo "Flaky tests file not found, running all tests"
fi
# Export the variable so it can be used in later GitHub Actions steps
echo "SDK_FLAKY_TESTS=$FLAKY_TESTS_LINES" >> "$GITHUB_ENV"
- name: Run tests
working-directory: ./bigbluebutton-tests/bigbluebutton-html-plugin-sdk
timeout-minutes: 25
env:
NODE_EXTRA_CA_CERTS: /usr/local/share/ca-certificates/bbb-dev/bbb-dev-ca.crt
ACTIONS_RUNNER_DEBUG: true
BBB_URL: https://bbb-ci.test/bigbluebutton/
BBB_SECRET: bbbci
run: |
if [ -n "$SDK_FLAKY_TESTS" ]; then
npm run test-chromium-ci -- --grep-invert "$SDK_FLAKY_TESTS"
else
npm run test-chromium-ci
fi
- if: failure()
name: Upload blob report to GitHub Actions Artifacts
uses: actions/upload-artifact@v6
with:
name: blob-report-plugins
path: bigbluebutton-tests/bigbluebutton-html-plugin-sdk/blob-report
if-no-files-found: ignore
- if: failure()
name: Generate the plugins HTML report from blob report
shell: bash
working-directory: ./bigbluebutton-tests/bigbluebutton-html-plugin-sdk
run: |
if [ -d "./blob-report" ]; then
npx playwright merge-reports --reporter html ./blob-report
else
echo "blob-report directory not found, skipping HTML report generation"
fi
- if: failure()
name: Upload shard HTML report to GitHub Actions Artifacts
uses: actions/upload-artifact@v6
with:
name: test-report_plugins
path: bigbluebutton-tests/bigbluebutton-html-plugin-sdk/playwright-report
- if: always()
name: Upload logs folder
uses: actions/upload-artifact@v6
with:
name: browser-logs-plugin
path: bigbluebutton-tests/bigbluebutton-html-plugin-sdk/logs
if-no-files-found: ignore
- if: failure()
name: Prepare artifacts
uses: ./.github/actions/prepare-artifacts
- if: failure()
name: Upload bbb-configs artifact
uses: actions/upload-artifact@v6
with:
name: bbb-configs-plugins
path: configs
- if: failure()
name: Upload bbb-logs artifact
uses: actions/upload-artifact@v6
with:
name: bbb-logs-plugins
path: ./bbb-logs.tar.gz
publish-report:
if: always() && !contains(github.event.head_commit.message, 'Merge pull request')
needs:
- install-and-run-bbb-tests
- install-and-run-plugin-tests
runs-on: ubuntu-24.04
env:
hasFailure: ${{ needs.install-and-run-bbb-tests.result == 'failure' || needs.install-and-run-plugin-tests.result == 'failure' }}
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
- name: Check if blob reports exist
if: ${{ fromJSON(env.hasFailure) }}
id: check-blob-reports
uses: ./.github/actions/check-artifact-exists
with:
artifact-name: blob-report-
- name: Merge and upload the blob reports
if: ${{ fromJSON(env.hasFailure) && fromJSON(steps.check-blob-reports.outputs.result || 'false') }}
uses: ./.github/actions/merge-and-upload-blob-reports
- name: Write PR data for auto-comment
if: github.event_name == 'pull_request'
working-directory: ./
run: |
mkdir -p ./pr-comment-data
echo ${{ github.event.number }} > ./pr-comment-data/pr_number
echo ${{ github.run_id }} > ./pr-comment-data/workflow_id
- name: Upload PR data for auto-comment
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v6
with:
name: pr-comment-data
path: pr-comment-data