Merge branch 'bigbluebutton:v4.0.x-release' into v4.0.x-release #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |