ci: migrate actions to use OpenVidu repository for setup and cleanup
This commit is contained in:
parent
de83220e09
commit
df3e0e05bb
96
.github/actions/cleanup/action.yaml
vendored
96
.github/actions/cleanup/action.yaml
vendored
@ -1,96 +0,0 @@
|
||||
name: 'OpenVidu Meet Cleanup'
|
||||
description: 'Clean up OpenVidu Meet test environment'
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Show pre-cleanup status
|
||||
continue-on-error: true
|
||||
run: |
|
||||
echo "=== System status before cleanup ==="
|
||||
df -h
|
||||
free -h
|
||||
echo "=== Running processes ==="
|
||||
ps aux | grep -i 'npm\|node\|livekit' | grep -v grep || true
|
||||
echo "=== Docker containers ==="
|
||||
docker ps -a || true
|
||||
shell: bash
|
||||
|
||||
- name: Kill backend process
|
||||
run: pkill -f "npm run start:prod" || true
|
||||
shell: bash
|
||||
|
||||
- name: Stop OpenVidu Local Deployment containers
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if [ -d "openvidu-local-deployment/community" ]; then
|
||||
cd openvidu-local-deployment/community
|
||||
docker compose down -v || echo "Warning: Failed to stop containers cleanly"
|
||||
else
|
||||
echo "Directory openvidu-local-deployment/community not found, skipping"
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Clean up temporary files
|
||||
continue-on-error: true
|
||||
run: |
|
||||
echo "Cleaning temporary files..."
|
||||
rm -rf /tmp/openvidu-* || echo "Warning: Failed to clean some OpenVidu temp files"
|
||||
rm -rf /tmp/livekit-* || echo "Warning: Failed to clean some LiveKit temp files"
|
||||
shell: bash
|
||||
|
||||
- name: Check for running containers
|
||||
continue-on-error: true
|
||||
run: |
|
||||
CONTAINERS=$(docker ps -q)
|
||||
if [ -n "$CONTAINERS" ]; then
|
||||
echo "Warning: Found running containers. Stopping them before prune."
|
||||
docker stop $CONTAINERS || true
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Clean up Docker resources
|
||||
continue-on-error: true
|
||||
run: |
|
||||
echo "Pruning Docker system..."
|
||||
docker system prune -f --volumes || echo "Warning: Docker system prune failed"
|
||||
shell: bash
|
||||
|
||||
- name: Kill orphaned processes
|
||||
continue-on-error: true
|
||||
run: |
|
||||
echo "Checking for orphaned processes..."
|
||||
ORPHANED=$(ps aux | grep -i 'npm\|node\|livekit' | grep -v grep | awk '{print $2}')
|
||||
if [ -n "$ORPHANED" ]; then
|
||||
echo "Killing processes: $ORPHANED"
|
||||
kill -9 $ORPHANED || echo "Warning: Some processes couldn't be killed"
|
||||
else
|
||||
echo "No orphaned processes found"
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Clean specific directories
|
||||
continue-on-error: true
|
||||
run: |
|
||||
echo "Cleaning specific directories..."
|
||||
# Don't try to remove the entire working directory
|
||||
# Instead, clean specific subdirectories that might cause permission issues
|
||||
|
||||
if [ -d "openvidu-local-deployment" ]; then
|
||||
sudo rm -rf openvidu-local-deployment || echo "Warning: Failed to remove openvidu-local-deployment"
|
||||
fi
|
||||
|
||||
# Clean build and cache directories
|
||||
find . -type d -name "node_modules" -exec rm -rf {} +
|
||||
find . -type d -name "dist" -exec rm -rf {} +
|
||||
find . -type d -name ".cache" -exec rm -rf {} +
|
||||
shell: bash
|
||||
|
||||
- name: Show system status
|
||||
continue-on-error: true
|
||||
run: |
|
||||
echo "=== System status after cleanup ==="
|
||||
df -h
|
||||
free -h
|
||||
docker ps -a
|
||||
echo "=== Cleanup completed ==="
|
||||
shell: bash
|
||||
@ -1,22 +0,0 @@
|
||||
name: Setup OpenVidu Local Deployment
|
||||
description: Checkout and start OpenVidu Local Deployment with Docker Compose
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Checkout OpenVidu Local Deployment
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: OpenVidu/openvidu-local-deployment
|
||||
ref: development
|
||||
path: openvidu-local-deployment
|
||||
|
||||
- name: Configure Local Deployment
|
||||
shell: bash
|
||||
run: |
|
||||
cd openvidu-local-deployment/community
|
||||
./configure_lan_private_ip_linux.sh
|
||||
docker compose up -d
|
||||
|
||||
- name: Wait for OpenVidu Local Deployment to Start
|
||||
shell: bash
|
||||
run: wait-on --timeout 60000 http://localhost:7880
|
||||
19
.github/actions/setup-openvidu-meet/action.yml
vendored
19
.github/actions/setup-openvidu-meet/action.yml
vendored
@ -1,19 +0,0 @@
|
||||
name: Setup OpenVidu Meet Backend
|
||||
description: Prepara y arranca el backend de OpenVidu Meet y espera a que esté disponible
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup yarn # Needed for the redlock package
|
||||
shell: bash
|
||||
run: npm install -g yarn
|
||||
- name: Checkout OpenVidu Meet
|
||||
uses: actions/checkout@v4
|
||||
- name: Prepare OpenVidu Meet
|
||||
shell: bash
|
||||
run: |
|
||||
./prepare.sh
|
||||
cd backend
|
||||
npm run start:prod &
|
||||
- name: Wait for OpenVidu Meet to Start
|
||||
shell: bash
|
||||
run: wait-on --timeout 30000 http://localhost:6080/meet/health
|
||||
42
.github/workflows/backend-integration-test.yaml
vendored
42
.github/workflows/backend-integration-test.yaml
vendored
@ -15,9 +15,9 @@ jobs:
|
||||
- name: Install LK CLI
|
||||
run: curl -sSL https://get.livekit.io/cli | bash
|
||||
- name: Setup OpenVidu Local Deployment
|
||||
uses: ./.github/actions/setup-local-deployment
|
||||
uses: OpenVidu/actions/start-openvidu-local-deployment@main
|
||||
- name: Setup OpenVidu Meet
|
||||
uses: ./.github/actions/setup-openvidu-meet
|
||||
uses: OpenVidu/actions/start-openvidu-meet@main
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
@ -33,7 +33,7 @@ jobs:
|
||||
require_tests: true
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
test-recordings:
|
||||
name: Recordings API Tests
|
||||
@ -49,9 +49,9 @@ jobs:
|
||||
- name: Install LK CLI
|
||||
run: curl -sSL https://get.livekit.io/cli | bash
|
||||
- name: Setup OpenVidu Local Deployment
|
||||
uses: ./.github/actions/setup-local-deployment
|
||||
uses: OpenVidu/actions/start-openvidu-local-deployment@main
|
||||
- name: Setup OpenVidu Meet
|
||||
uses: ./.github/actions/setup-openvidu-meet
|
||||
uses: OpenVidu/actions/start-openvidu-meet@main
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
@ -67,7 +67,7 @@ jobs:
|
||||
require_tests: true
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
test-webhooks:
|
||||
name: Webhook Tests
|
||||
@ -82,9 +82,9 @@ jobs:
|
||||
- name: Install LK CLI
|
||||
run: curl -sSL https://get.livekit.io/cli | bash
|
||||
- name: Setup OpenVidu Local Deployment
|
||||
uses: ./.github/actions/setup-local-deployment
|
||||
uses: OpenVidu/actions/start-openvidu-local-deployment@main
|
||||
- name: Setup OpenVidu Meet
|
||||
uses: ./.github/actions/setup-openvidu-meet
|
||||
uses: OpenVidu/actions/start-openvidu-meet@main
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
@ -100,7 +100,7 @@ jobs:
|
||||
require_tests: true
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
test-security:
|
||||
name: Security API Tests
|
||||
@ -115,9 +115,9 @@ jobs:
|
||||
- name: Install LK CLI
|
||||
run: curl -sSL https://get.livekit.io/cli | bash
|
||||
- name: Setup OpenVidu Local Deployment
|
||||
uses: ./.github/actions/setup-local-deployment
|
||||
uses: OpenVidu/actions/start-openvidu-local-deployment@main
|
||||
- name: Setup OpenVidu Meet
|
||||
uses: ./.github/actions/setup-openvidu-meet
|
||||
uses: OpenVidu/actions/start-openvidu-meet@main
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
@ -133,7 +133,7 @@ jobs:
|
||||
require_tests: true
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
test-global-preferences:
|
||||
name: Global Preferences API Tests
|
||||
@ -148,9 +148,9 @@ jobs:
|
||||
- name: Install LK CLI
|
||||
run: curl -sSL https://get.livekit.io/cli | bash
|
||||
- name: Setup OpenVidu Local Deployment
|
||||
uses: ./.github/actions/setup-local-deployment
|
||||
uses: OpenVidu/actions/start-openvidu-local-deployment@main
|
||||
- name: Setup OpenVidu Meet
|
||||
uses: ./.github/actions/setup-openvidu-meet
|
||||
uses: OpenVidu/actions/start-openvidu-meet@main
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
@ -166,7 +166,7 @@ jobs:
|
||||
require_tests: true
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
test-participants:
|
||||
name: Participants API Tests
|
||||
@ -181,9 +181,9 @@ jobs:
|
||||
- name: Install LK CLI
|
||||
run: curl -sSL https://get.livekit.io/cli | bash
|
||||
- name: Setup OpenVidu Local Deployment
|
||||
uses: ./.github/actions/setup-local-deployment
|
||||
uses: OpenVidu/actions/start-openvidu-local-deployment@main
|
||||
- name: Setup OpenVidu Meet
|
||||
uses: ./.github/actions/setup-openvidu-meet
|
||||
uses: OpenVidu/actions/start-openvidu-meet@main
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
@ -199,7 +199,7 @@ jobs:
|
||||
require_tests: true
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
test-meetings:
|
||||
name: Meetings API Tests
|
||||
@ -214,9 +214,9 @@ jobs:
|
||||
- name: Install LK CLI
|
||||
run: curl -sSL https://get.livekit.io/cli | bash
|
||||
- name: Setup OpenVidu Local Deployment
|
||||
uses: ./.github/actions/setup-local-deployment
|
||||
uses: OpenVidu/actions/start-openvidu-local-deployment@main
|
||||
- name: Setup OpenVidu Meet
|
||||
uses: ./.github/actions/setup-openvidu-meet
|
||||
uses: OpenVidu/actions/start-openvidu-meet@main
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
@ -232,4 +232,4 @@ jobs:
|
||||
require_tests: true
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
4
.github/workflows/backend-unit-test.yaml
vendored
4
.github/workflows/backend-unit-test.yaml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
- name: Install wait-on
|
||||
run: npm install -g wait-on
|
||||
- name: Setup OpenVidu Meet
|
||||
uses: ./.github/actions/setup-openvidu-meet
|
||||
uses: OpenVidu/actions/start-openvidu-meet@main
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
@ -29,4 +29,4 @@ jobs:
|
||||
require_tests: true
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
2
.github/workflows/wc-e2e-test.yaml
vendored
2
.github/workflows/wc-e2e-test.yaml
vendored
@ -77,4 +77,4 @@ jobs:
|
||||
retention-days: 2
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
2
.github/workflows/wc-unit-test.yaml
vendored
2
.github/workflows/wc-unit-test.yaml
vendored
@ -22,4 +22,4 @@ jobs:
|
||||
npm run test:unit
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
uses: OpenVidu/actions/cleanup@main
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user