Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# ── Required ────────────────────────────────────────────────────────────────
# Full URL of the BigBlueButton server API (must end with /bigbluebutton/)
BBB_URL="https://your.bbb.server/bigbluebutton/"

# Shared secret of the BigBlueButton server
BBB_SECRET="yoursupersecretkey"

# ── Optional ────────────────────────────────────────────────────────────────
# Direct URL to the plugin manifest (skips the server-side availability check).
# Use this when the plugin is not deployed to the default BBB plugins path.
# Example: PICK_RANDOM_USER_PLUGIN_URL="https://your.bbb.server/plugins/pick-random-user-plugin/dist/manifest.json"
PICK_RANDOM_USER_PLUGIN_URL=""

# Name of the local Docker container running BigBlueButton (only needed when
# deploying the built plugin into a local container with the copy script).
LOCAL_CONTAINER_NAME="bbb-local-container"

# Multiply all Playwright timeouts by this factor.
# Defaults to 2 in CI and 1 locally when not set.
TIMEOUT_MULTIPLIER=1

# Set to "true" to enable CI mode (1 worker, retries, blob reporter).
CI="false"

# ── S3-compatible storage (publish-plugin-to-s3.sh) ─────────────────────────
# Access key ID for your S3-compatible bucket.
S3_ACCESS_KEY="your-access-key"

# Secret access key.
S3_SECRET_KEY="your-secret-key"

# Full endpoint URL of your S3-compatible provider.
# Examples:
# Digital Ocean Spaces – https://nyc3.digitaloceanspaces.com
# AWS S3 – https://s3.amazonaws.com
# MinIO – https://your.minio.host
S3_ENDPOINT_URL="https://nyc3.digitaloceanspaces.com"

# Name of the bucket.
S3_BUCKET="your-bucket-name"

# Path prefix inside the bucket.
S3_PATH="path/to/plugin/dist"
92 changes: 92 additions & 0 deletions .github/actions/e2e-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build, publish & run E2E tests
description: >
Installs dependencies, builds the plugin, publishes the dist to S3,
and runs the full Playwright E2E suite against a live BBB server.

inputs:
s3_access_key:
description: 'S3 access key ID'
required: true
s3_secret_key:
description: 'S3 secret access key'
required: true
s3_endpoint_url:
description: 'S3 endpoint URL'
required: true
s3_bucket:
description: 'S3 bucket name'
required: true
s3_path:
description: 'Path prefix inside the S3 bucket (computed by the caller)'
required: true
bbb_url:
description: 'BigBlueButton server API URL (must end with /bigbluebutton/)'
required: true
bbb_secret:
description: 'BigBlueButton server shared secret'
required: true

runs:
using: composite
steps:
# ── Step 1: Build ──────────────────────────────────────────────────────────

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
shell: bash
run: npm ci

- name: Build plugin
shell: bash
run: npm run build-bundle

# ── Step 2: Publish to S3 ──────────────────────────────────────────────────

- name: Publish plugin to S3
shell: bash
env:
S3_ACCESS_KEY: ${{ inputs.s3_access_key }}
S3_SECRET_KEY: ${{ inputs.s3_secret_key }}
S3_ENDPOINT_URL: ${{ inputs.s3_endpoint_url }}
S3_BUCKET: ${{ inputs.s3_bucket }}
S3_PATH: ${{ inputs.s3_path }}
run: bash scripts/publish-plugin-to-s3.sh

# ── Step 3: Run tests ──────────────────────────────────────────────────────

- name: Install Playwright browsers
shell: bash
run: npx playwright install chromium --with-deps

- name: Run E2E tests
shell: bash
env:
CI: 'true'
BBB_URL: ${{ inputs.bbb_url }}
BBB_SECRET: ${{ inputs.bbb_secret }}
PICK_RANDOM_USER_PLUGIN_URL: ${{ inputs.s3_endpoint_url }}/${{ inputs.s3_bucket }}/${{ inputs.s3_path }}/manifest.json
TIMEOUT_MULTIPLIER: '2'
run: npm run test-chromium-ci

# ── Artifacts ──────────────────────────────────────────────────────────────

- name: Upload Playwright HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30

- name: Upload blob report
if: always()
uses: actions/upload-artifact@v4
with:
name: blob-report
path: blob-report/
retention-days: 10
47 changes: 47 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: E2E tests - run on PR

on:
workflow_dispatch:
inputs:
pr_number:
description: 'Pull request number to test'
required: true
type: string

permissions:
contents: read
pull-requests: read

jobs:
e2e-tests:
name: 'Build, publish & test PR #${{ github.event.inputs.pr_number }}'
runs-on: ubuntu-22.04

steps:
- name: Resolve PR metadata
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr_number }})
echo "PR_HEAD_REPO=$(echo "$PR_JSON" | jq -r '.head.repo.full_name')" >> $GITHUB_ENV
echo "PR_HEAD_REF=$(echo "$PR_JSON" | jq -r '.head.ref')" >> $GITHUB_ENV
echo "S3_PATH=plugins/ci/pick-random-user-plugin/pr-${{ github.event.inputs.pr_number }}/dist" >> $GITHUB_ENV

- name: Checkout PR code
uses: actions/checkout@v4
with:
repository: ${{ env.PR_HEAD_REPO }}
ref: ${{ env.PR_HEAD_REF }}
fetch-depth: 1

- name: Build, publish & run E2E tests
uses: ./.github/actions/e2e-test
with:
s3_access_key: ${{ secrets.S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
s3_endpoint_url: ${{ secrets.S3_ENDPOINT_URL }}
s3_bucket: ${{ secrets.S3_BUCKET }}
s3_path: ${{ env.S3_PATH }}
bbb_url: ${{ secrets.BBB_URL }}
bbb_secret: ${{ secrets.BBB_SECRET }}
31 changes: 30 additions & 1 deletion .github/workflows/publish-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,37 @@ on:
default: 'patch'

jobs:
e2e-tests:
name: E2E tests (pre-tag)
runs-on: ubuntu-22.04
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Compute S3 path
run: echo "S3_PATH=plugins/ci/pick-random-user-plugin/release-staging/dist" >> $GITHUB_ENV

- name: Build, publish & run E2E tests
uses: ./.github/actions/e2e-test
with:
s3_access_key: ${{ secrets.S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
s3_endpoint_url: ${{ secrets.S3_ENDPOINT_URL }}
s3_bucket: ${{ secrets.S3_BUCKET }}
s3_path: ${{ env.S3_PATH }}
bbb_url: ${{ secrets.BBB_URL }}
bbb_secret: ${{ secrets.BBB_SECRET }}

bump-version:
needs: e2e-tests
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
Expand All @@ -28,7 +57,7 @@ jobs:
user_email="github-actions@github.com"
fi
echo "user_email=$user_email" >> $GITHUB_ENV

- name: Configure Git with the triggering user's info
run: |
git config user.name "${{ github.actor }}"
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ debian/**/copyright
debian/**/changelog.gz
debian/**/md5sums
debian/**/var/www/*
memory
playwright-report
test-results
.env
Loading
Loading