-
Notifications
You must be signed in to change notification settings - Fork 246
Expand file tree
/
Copy pathe2e-components-angular-tutorials.yml
More file actions
145 lines (130 loc) · 5.54 KB
/
e2e-components-angular-tutorials.yml
File metadata and controls
145 lines (130 loc) · 5.54 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
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