Skip to content

Feature/userinfo

Feature/userinfo #918

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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
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@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
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@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
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@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
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@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./test-report.junit.xml
flags: backend
report-type: test_results