Skip to content

PR 6: refactor: per-area small refactors (CTS, Scheduler, Students, CMS) #406

PR 6: refactor: per-area small refactors (CTS, Scheduler, Students, CMS)

PR 6: refactor: per-area small refactors (CTS, Scheduler, Students, CMS) #406

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
frontend:
name: Frontend Tests
runs-on: ubuntu-latest
env:
HAS_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }}
defaults:
run:
working-directory: VueApp
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
cache-dependency-path: VueApp/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build with bundle analysis
run: npx vite build --mode test
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Run tests with coverage
run: npx vitest run --coverage --reporter=junit --outputFile=test-report.junit.xml
- name: Upload coverage to Codecov
if: ${{ !cancelled() && env.HAS_CODECOV_TOKEN == 'true' }}
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./VueApp/coverage/cobertura-coverage.xml
flags: frontend
- name: Upload test results to Codecov
if: ${{ !cancelled() && env.HAS_CODECOV_TOKEN == 'true' }}
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./VueApp/test-report.junit.xml
flags: frontend
report-type: test_results
backend:
name: Backend Tests
runs-on: ubuntu-latest
env:
HAS_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Run tests with coverage
run: >-
dotnet test test/
--collect:"XPlat Code Coverage"
--results-directory ./coverage
--logger "junit;LogFilePath=../test-report.junit.xml"
- name: Upload coverage to Codecov
if: ${{ !cancelled() && env.HAS_CODECOV_TOKEN == 'true' }}
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/**/coverage.cobertura.xml
flags: backend
- name: Upload test results to Codecov
if: ${{ !cancelled() && env.HAS_CODECOV_TOKEN == 'true' }}
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./test-report.junit.xml
flags: backend
report-type: test_results