ci: Updated openvidu-components e2e tests

pull/839/head
Carlos Santos 2024-07-24 17:21:19 +02:00
parent aa437be8cf
commit 25ef634757
1 changed files with 124 additions and 134 deletions

View File

@ -1,10 +1,11 @@
name: openvidu-components-angular E2E name: openvidu-components-angular E2E
on: on:
push: push:
branches:
- master
paths: paths:
- 'openvidu-components-angular/**' - 'openvidu-components-angular/**'
- 'openvidu-browser/**'
- 'openvidu-node-client/**'
- '.github/workflows/openvidu-components-angular-E2E.yml' - '.github/workflows/openvidu-components-angular-E2E.yml'
pull_request: pull_request:
branches: branches:
@ -12,147 +13,136 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
commit_sha: commit_sha:
description: 'Commit SHA' description: 'Commit SHA'
required: false required: false
default: '' default: ''
jobs: jobs:
test_setup: test_setup:
name: Test setup name: Test setup
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout Repository
with: uses: actions/checkout@v4
ref: ${{ inputs.commit_sha || github.sha }} with:
- uses: actions/setup-node@v4 ref: ${{ inputs.commit_sha || github.sha }}
with: - name: Set up Node.js
node-version: '20' uses: actions/setup-node@v4
- name: Commit URL with:
run: echo https://github.com/OpenVidu/openvidu/commit/${{ inputs.commit_sha || github.sha }} node-version: '20'
- name: Send repository dispatch event - name: Commit URL
env: run: echo https://github.com/OpenVidu/openvidu/commit/${{ inputs.commit_sha || github.sha }}
GITHUB_TOKEN: ${{ secrets.OPENVIDU_DISPATCH_EVENT_GA }} - name: Send Dispatch Event
COMMIT_MESSAGE: ${{ github.event.head_commit.message || 'Manually' }} env:
COMMIT_URL: ${{ github.event.commits[0].url || 'Manually' }} GITHUB_TOKEN: ${{ secrets.OPENVIDU_DISPATCH_EVENT_GA }}
BRANCH_NAME: ${{ github.ref_name }} COMMIT_MESSAGE: ${{ github.event.head_commit.message || 'Manually' }}
run: | COMMIT_URL: ${{ github.event.commits[0].url || 'Manually' }}
curl \ BRANCH_NAME: ${{ github.ref_name }}
-X POST \ run: |
-H "Accept: application/vnd.github+json" \ curl -X POST \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ -H "Accept: application/vnd.github+json" \
https://api.github.com/repos/OpenVidu/openvidu-call/dispatches \ -H "Authorization: Bearer ${GITHUB_TOKEN}" \
-d '{"event_type":"openvidu-components-angular","client_payload":{"commit-message":"'"$COMMIT_MESSAGE"'","commit-ref":"'"$COMMIT_URL"'", "branch-name":"'"$BRANCH_NAME"'"}}' https://api.github.com/repos/OpenVidu/openvidu-call/dispatches \
- name: Build openvidu-browser -d '{"event_type":"openvidu-components-angular","client_payload":{"commit-message":"'"$COMMIT_MESSAGE"'","commit-ref":"'"$COMMIT_URL"'", "branch-name":"'"$BRANCH_NAME"'"}}'
run: |
cd openvidu-browser
npm install
npm run build && \
npm pack
- uses: actions/upload-artifact@v4
with:
name: openvidu-browser
path: openvidu-browser/openvidu-browser-*.tgz
openvidu__components_angular_e2e:
openvidu_angular_e2e:
needs: test_setup needs: test_setup
name: OpenVidu Angular E2E tests name: OpenVidu Components Angular E2E tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout Repository
with: uses: actions/checkout@v4
ref: ${{ inputs.commit_sha || github.sha }} with:
- uses: actions/setup-node@v4 ref: ${{ inputs.commit_sha || github.sha }}
with: - name: Setup Node.js
node-version: '20' uses: actions/setup-node@v4
- uses: actions/download-artifact@v4 with:
with: node-version: '20'
name: openvidu-browser - name: Run Browserless Chrome
path: openvidu-components-angular run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Browserless Chrome - name: Run openvidu-local-deployment
run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable run: |
- name: Run openvidu-server-kms git clone --depth 1 https://github.com/OpenVidu/openvidu-local-deployment
run: | cd openvidu-local-deployment/community
docker run -p 4443:4443 --rm -d \ ./configure_lan_private_ip_linux.sh
-e OPENVIDU_SECRET=MY_SECRET \ docker compose up
openvidu/openvidu-dev:latest
- name: Install openvidu-browser and dependencies
run: |
cd openvidu-components-angular
npm install openvidu-browser-*.tgz
- name: Build openvidu-angular
run: npm run lib:build --prefix openvidu-components-angular
- name: Build openvidu-angular-testapp
run: npm run build --prefix openvidu-components-angular
- name: Serve openvidu-angular-testapp
run: npm run start-prod --prefix openvidu-components-angular &
- name: Run openvidu-angular E2E
run: npm run lib:e2e-ci --prefix openvidu-components-angular
webcomponent_e2e: - name: Install dependencies
needs: test_setup run: |
name: Webcomponent E2E CE tests cd openvidu-components-angular
runs-on: ubuntu-latest npm install
steps: - name: Build openvidu-components-angular
- uses: actions/checkout@v4 run: npm run lib:build --prefix openvidu-components-angular
with: - name: Build openvidu-components-angular Testapp
ref: ${{ inputs.commit_sha || github.sha }} run: npm run build --prefix openvidu-components-angular
- uses: actions/setup-node@v4 - name: Serve openvidu-components-angular Testapp
with: run: npm run start-prod --prefix openvidu-components-angular &
node-version: '20' - name: Run openvidu-components-angular E2E
- uses: actions/download-artifact@v4 run: npm run lib:e2e-ci --prefix openvidu-components-angular
with:
name: openvidu-browser
path: openvidu-components-angular
- name: Run Browserless Chrome
run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run openvidu-server-kms
run: |
docker run -p 4443:4443 --rm -d \
-e OPENVIDU_SECRET=MY_SECRET \
openvidu/openvidu-dev:latest
- name: Install openvidu-browser and dependencies
run: |
cd openvidu-components-angular
npm install openvidu-browser-*.tgz
- name: Build openvidu-angular
run: npm run lib:build --prefix openvidu-components-angular
- name: Build openvidu-webcomponent
run: npm run webcomponent:build --prefix openvidu-components-angular
- name: Serve Webcomponent Testapp
run: npm run webcomponent:serve-testapp --prefix openvidu-components-angular &
- name: Run Webcomponent E2E
run: npm run webcomponent:e2e-ci --prefix openvidu-components-angular
webcomponent_e2e_pro: # webcomponent_e2e:
if: false #Skip PRO test because infra is unstable # needs: test_setup
needs: test_setup # name: Webcomponent E2E CE tests
name: Webcomponent E2E PRO tests # runs-on: ubuntu-latest
runs-on: ubuntu-latest # steps:
steps: # - uses: actions/checkout@v4
- uses: actions/checkout@v4 # with:
- uses: actions/setup-node@v4 # ref: ${{ inputs.commit_sha || github.sha }}
with: # - uses: actions/setup-node@v4
node-version: '20' # with:
- uses: actions/download-artifact@v4 # node-version: '20'
with: # - uses: actions/download-artifact@v4
name: openvidu-browser # with:
path: openvidu-components-angular # name: openvidu-browser
- name: Run Browserless Chrome # path: openvidu-components-angular
run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable # - name: Run Browserless Chrome
- name: Install openvidu-browser and dependencies # run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
run: | # - name: Run openvidu-server-kms
cd openvidu-components-angular # run: |
npm install openvidu-browser-*.tgz # docker run -p 4443:4443 --rm -d \
- name: Build openvidu-angular # -e OPENVIDU_SECRET=MY_SECRET \
run: npm run lib:build --prefix openvidu-components-angular # openvidu/openvidu-dev:latest
- name: Build openvidu-webcomponent # - name: Install openvidu-browser and dependencies
run: npm run webcomponent:build --prefix openvidu-components-angular # run: |
- name: Serve Webcomponent Testapp # cd openvidu-components-angular
run: npm run webcomponent:serve-testapp --prefix openvidu-components-angular & # npm install openvidu-browser-*.tgz
- name: Run Webcomponent E2E PRO # - name: Build openvidu-angular
env: # run: npm run lib:build --prefix openvidu-components-angular
OPENVIDU_SERVER_URL: ${{ secrets.OPENVIDU_CALL_NEXT_URL }} # - name: Build openvidu-webcomponent
OPENVIDU_SECRET: ${{ secrets.OPENVIDU_CALL_NEXT_SECRET }} # run: npm run webcomponent:build --prefix openvidu-components-angular
run: npm run webcomponent:e2e-pro-ci --prefix openvidu-components-angular # - name: Serve Webcomponent Testapp
# run: npm run webcomponent:serve-testapp --prefix openvidu-components-angular &
# - name: Run Webcomponent E2E
# run: npm run webcomponent:e2e-ci --prefix openvidu-components-angular
# webcomponent_e2e_pro:
# if: false #Skip PRO test because infra is unstable
# needs: test_setup
# name: Webcomponent E2E PRO tests
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# with:
# node-version: '20'
# - uses: actions/download-artifact@v4
# with:
# name: openvidu-browser
# path: openvidu-components-angular
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
# - name: Install openvidu-browser and dependencies
# run: |
# cd openvidu-components-angular
# npm install openvidu-browser-*.tgz
# - name: Build openvidu-angular
# run: npm run lib:build --prefix openvidu-components-angular
# - name: Build openvidu-webcomponent
# run: npm run webcomponent:build --prefix openvidu-components-angular
# - name: Serve Webcomponent Testapp
# run: npm run webcomponent:serve-testapp --prefix openvidu-components-angular &
# - name: Run Webcomponent E2E PRO
# env:
# OPENVIDU_SERVER_URL: ${{ secrets.OPENVIDU_CALL_NEXT_URL }}
# OPENVIDU_SECRET: ${{ secrets.OPENVIDU_CALL_NEXT_SECRET }}
# run: npm run webcomponent:e2e-pro-ci --prefix openvidu-components-angular