Skip to content

openvidu-components-angular #72

openvidu-components-angular

openvidu-components-angular #72

name: E2E Test Angular Components tutorials
on:
push:
pull_request:
repository_dispatch:
types: [openvidu-components-angular]
workflow_dispatch:
inputs:
openvidu_components_angular_version:
description: 'Version of openvidu-components-angular (empty = build from source)'
required: false
default: ''
jobs:
# Build from source only if no version specified
build_components:
runs-on: ubuntu-latest
if: github.event.inputs.openvidu_components_angular_version == '' || github.event.inputs.openvidu_components_angular_version == null
outputs:
artifact_name: ${{ steps.build.outputs.artifact_name }}
package_filename: ${{ steps.build.outputs.package_filename }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Build OpenVidu Components Angular
id: build
uses: OpenVidu/actions/build-openvidu-components-angular@main
build_and_start_tutorials:
runs-on: ubuntu-latest
needs: [build_components]
if: always() && (needs.build_components.result == 'success' || needs.build_components.result == 'skipped')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
# Download artifact if built from source - place it in the parent directory
- name: Download OpenVidu Components Angular package
if: needs.build_components.result == 'success'
uses: actions/download-artifact@v4
with:
name: ${{ needs.build_components.outputs.artifact_name }}
path: './openvidu-components-angular'
- name: Run tests
run: |
cd openvidu-components-angular/test
npm install
if [ -n "${{ needs.build_components.outputs.package_filename }}" ]; then
# Use local package - pass absolute path
./run-test.sh --openvidu-components-version "file:$PWD/../${{ needs.build_components.outputs.package_filename }}"
else
# Use npm version
./run-test.sh --openvidu-components-version "${{ github.event.inputs.openvidu_components_angular_version }}"
fi
demo_app_e2e_test:
runs-on: ubuntu-latest
needs: [build_components]
if: always() && (needs.build_components.result == 'success' || needs.build_components.result == 'skipped')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
# Download artifact if built from source
- name: Download OpenVidu Components Angular package
if: needs.build_components.result == 'success'
uses: actions/download-artifact@v4
with:
name: ${{ needs.build_components.outputs.artifact_name }}
path: './openvidu-components-angular/openvidu-demo-app'
- name: Setup OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: "development"
openvidu-edition: "community"
- name: Install demo app dependencies
run: |
cd openvidu-components-angular/openvidu-demo-app
if [ -n "${{ needs.build_components.outputs.package_filename }}" ]; then
echo "Installing from built artifact: ${{ needs.build_components.outputs.package_filename }}"
npm install ./${{ needs.build_components.outputs.package_filename }} --prefix frontend
else
VERSION="${{ github.event.inputs.openvidu_components_angular_version }}"
echo "Installing from npm: openvidu-components-angular@${VERSION}"
npm install "openvidu-components-angular@${VERSION}" --prefix frontend
fi
npm install --prefix backend
npm run build --prefix backend
npm run build-prod --prefix frontend
- name: Run demo app
env:
DEMO_APP_PRIVATE_ACCESS: false
run: npm start --prefix openvidu-components-angular/openvidu-demo-app/backend &
- name: Create downloads directory
run: |
mkdir -p /tmp/openvidu-components-angular-demo-app-downloads
chmod 777 /tmp/openvidu-components-angular-demo-app-downloads
- name: Run Chrome Browser
run: docker run --network=host -d -v /tmp/openvidu-components-angular-demo-app-downloads:/tmp/openvidu-components-angular-demo-app-downloads selenium/standalone-chrome:127.0
- name: Wait for Selenium to be ready
run: |
echo "Waiting for Selenium to be ready..."
for i in {1..30}; do
if curl -s http://localhost:4444/wd/hub/status > /dev/null; then
echo "Selenium is ready!"
break
fi
echo "Attempt $i: Selenium not ready yet, waiting..."
sleep 2
done
curl -s http://localhost:4444/wd/hub/status || (echo "Selenium failed to start" && exit 1)
- name: Run E2E Home tests
env:
LAUNCH_MODE: CI
run: npm run e2e:home --prefix openvidu-components-angular/openvidu-demo-app/frontend
- name: Run Room Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:room --prefix openvidu-components-angular/openvidu-demo-app/frontend
- name: Run Recordings Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:recordings --prefix openvidu-components-angular/openvidu-demo-app/frontend