Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Unit Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
unit-tests:
runs-on: self-hosted

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: |
Write-Host "Installing dependencies..."
npm ci
shell: powershell

- name: Run unit tests
run: |
Write-Host "Running unit tests..."
npm run test
shell: powershell
env:
LOG_LEVEL: silent
NODE_ENV: test

- name: Run test coverage
run: |
Write-Host "Running test coverage..."
npm run test:cov
shell: powershell
env:
LOG_LEVEL: silent
NODE_ENV: test

- name: Upload coverage reports
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage/
retention-days: 7

- name: Display test results
if: always()
run: |
Write-Host "Test execution completed"
if (Test-Path "coverage/lcov-report/index.html") {
Write-Host "Coverage report generated successfully"
} else {
Write-Host "Coverage report not found"
}
shell: powershell