ci: Add GitHub Actions workflow for unit tests
This commit is contained in:
parent
23da76806d
commit
8b89a72754
57
.github/workflows/unit-test.yaml
vendored
Normal file
57
.github/workflows/unit-test.yaml
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
name: Unit Tests
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
unit-test:
|
||||
name: Unit Tests
|
||||
runs-on: ov-actions-runner
|
||||
steps:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: Setup yarn # Needed for the redlock package
|
||||
run: npm install -g yarn
|
||||
- name: Install wait-on
|
||||
run: npm install -g wait-on
|
||||
- name: Install LK CLI
|
||||
run: curl -sSL https://get.livekit.io/cli | bash
|
||||
- name: Checkout OpenVidu Meet
|
||||
uses: actions/checkout@v4
|
||||
- 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
|
||||
run: wait-on --timeout 60000 http://localhost:7880
|
||||
- name: Setup OpenVidu Meet
|
||||
shell: bash
|
||||
run: |
|
||||
./prepare.sh
|
||||
cd backend
|
||||
npm install
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd backend
|
||||
npm run test:unit
|
||||
env:
|
||||
JEST_JUNIT_OUTPUT_DIR: './reports/'
|
||||
- name: Publish Test Report
|
||||
uses: mikepenz/action-junit-report@v4
|
||||
if: always()
|
||||
with:
|
||||
report_paths: '**/reports/junit.xml'
|
||||
fail_on_failure: true
|
||||
require_tests: true
|
||||
- name: Clean up
|
||||
if: always()
|
||||
uses: ./.github/actions/cleanup
|
||||
Loading…
x
Reference in New Issue
Block a user