55 repository_dispatch :
66 types : [openvidu-components-angular]
77 workflow_dispatch :
8+ inputs :
9+ openvidu_components_angular_version :
10+ description : ' Version of openvidu-components-angular (empty = build from source)'
11+ required : false
12+ default : ' '
13+
814
915jobs :
16+ # Build from source only if no version specified
17+ build_components :
18+ runs-on : ubuntu-latest
19+ if : github.event.inputs.openvidu_components_angular_version == '' || github.event.inputs.openvidu_components_angular_version == null
20+ outputs :
21+ artifact_name : ${{ steps.build.outputs.artifact_name }}
22+ package_filename : ${{ steps.build.outputs.package_filename }}
23+ steps :
24+ - name : Checkout repository
25+ uses : actions/checkout@v4
26+ - name : Set up Node.js
27+ uses : actions/setup-node@v4
28+ with :
29+ node-version : ' 22'
30+ - name : Build OpenVidu Components Angular
31+ id : build
32+ uses : OpenVidu/actions/build-openvidu-components-angular@main
33+
1034 build_and_start_tutorials :
1135 runs-on : ubuntu-latest
36+ needs : [build_components]
37+ if : always() && (needs.build_components.result == 'success' || needs.build_components.result == 'skipped')
1238
1339 steps :
1440 - name : Checkout repository
@@ -19,43 +45,67 @@ jobs:
1945 with :
2046 node-version : ' 22'
2147
48+ # Download artifact if built from source - place it in the parent directory
49+ - name : Download OpenVidu Components Angular package
50+ if : needs.build_components.result == 'success'
51+ uses : actions/download-artifact@v4
52+ with :
53+ name : ${{ needs.build_components.outputs.artifact_name }}
54+ path : ' ./openvidu-components-angular'
55+
2256 - name : Run tests
2357 run : |
2458 cd openvidu-components-angular/test
2559 npm install
26- ./run-test.sh
60+ if [ -n "${{ needs.build_components.outputs.package_filename }}" ]; then
61+ # Use local package - pass absolute path
62+ ./run-test.sh --openvidu-components-version "file:$PWD/../${{ needs.build_components.outputs.package_filename }}"
63+ else
64+ # Use npm version
65+ ./run-test.sh --openvidu-components-version "${{ github.event.inputs.openvidu_components_angular_version }}"
66+ fi
2767
2868 demo_app_e2e_test :
2969 runs-on : ubuntu-latest
70+ needs : [build_components]
71+ if : always() && (needs.build_components.result == 'success' || needs.build_components.result == 'skipped')
3072 steps :
3173 - name : Checkout repository
3274 uses : actions/checkout@v4
3375 - name : Set up Node.js
3476 uses : actions/setup-node@v4
3577 with :
3678 node-version : ' 22'
37- - name : Build OpenVidu Components Angular
38- id : build
39- uses : OpenVidu/actions/build-openvidu-components-angular@main
4079
80+ # Download artifact if built from source
4181 - name : Download OpenVidu Components Angular package
82+ if : needs.build_components.result == 'success'
4283 uses : actions/download-artifact@v4
4384 with :
44- name : ${{ steps.build .outputs.artifact_name }}
85+ name : ${{ needs.build_components .outputs.artifact_name }}
4586 path : ' ./openvidu-components-angular/openvidu-demo-app'
4687
4788 - name : Setup OpenVidu Local Deployment
4889 uses : OpenVidu/actions/start-openvidu-local-deployment@main
4990 with :
5091 ref-openvidu-local-deployment : " development"
5192 openvidu-edition : " community"
93+
5294 - name : Install demo app dependencies
5395 run : |
5496 cd openvidu-components-angular/openvidu-demo-app
55- npm install ${{ steps.build.outputs.package_filename }} --prefix frontend
97+ if [ -n "${{ needs.build_components.outputs.package_filename }}" ]; then
98+ echo "Installing from built artifact: ${{ needs.build_components.outputs.package_filename }}"
99+ npm install ./${{ needs.build_components.outputs.package_filename }} --prefix frontend
100+ else
101+ VERSION="${{ github.event.inputs.openvidu_components_angular_version }}"
102+ echo "Installing from npm: openvidu-components-angular@${VERSION}"
103+ npm install "openvidu-components-angular@${VERSION}" --prefix frontend
104+ fi
56105 npm install --prefix backend
57106 npm run build --prefix backend
58107 npm run build-prod --prefix frontend
108+
59109 - name : Run demo app
60110 env :
61111 DEMO_APP_PRIVATE_ACCESS : false
0 commit comments