Files
jellyfin-ha-src/.github/workflows/ci-tests.yml
T
ZoltyMat f405e17c96 ci: Phase 5.0.4b - add run-phase5-tests gate to ci-tests.yml (#16)
Add a dedicated 'run-phase5-tests' job that runs the three test assemblies
most affected by Phase 5 HLS session-sharing and PostgreSQL media-encoding
changes in parallel with the existing full-matrix run-tests job.

Targeted assemblies:
- tests/Jellyfin.Api.Tests (HLS controller surface)
- tests/Jellyfin.MediaEncoding.Hls.Tests (transcode lifecycle)
- tests/Jellyfin.Server.Implementations.Tests (RedisTranscodeSessionStore)

Each test step filters Category!=RequiresDocker to exclude Docker-dependent
tests that require Testcontainers. Coverage results are merged separately
into merged-phase5/ to avoid collisions with the full-matrix merged/ dir.

Closes #(Phase 5.0.4b)
2026-03-31 22:56:30 -04:00

103 lines
4.1 KiB
YAML

name: Tests
on:
push:
branches:
- master
# Run tests against the forked branch, but
# do not allow access to secrets
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflows-in-forked-repositories
pull_request:
env:
SDK_VERSION: "9.0.x"
jobs:
run-tests:
runs-on: [self-hosted, k3s, linux, amd64]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Install .NET — use GITHUB_ENV (not GITHUB_PATH) to set PATH because
# ARC self-hosted runner pods don't pick up GITHUB_PATH between steps.
- name: Install .NET SDK
run: |
DOTNET_INSTALL_DIR="$HOME/.dotnet"
mkdir -p "$DOTNET_INSTALL_DIR"
curl -fsSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 10.0 --install-dir "$DOTNET_INSTALL_DIR"
echo "DOTNET_ROOT=$DOTNET_INSTALL_DIR" >> "$GITHUB_ENV"
echo "PATH=$DOTNET_INSTALL_DIR:$PATH" >> "$GITHUB_ENV"
- name: Run DotNet CLI Tests
run: |
export PATH="$HOME/.dotnet:$PATH"
dotnet test Jellyfin.sln \
--configuration Release \
--collect:"XPlat Code Coverage" \
--settings tests/coverletArgs.runsettings \
--verbosity minimal \
--filter "Category!=RequiresDocker&FullyQualifiedName!~Integration"
- name: Merge code coverage results
uses: danielpalme/ReportGenerator-GitHub-Action@ee0ae774f6d3afedcbd1683c1ab21b83670bdf8e # v5.5.1
with:
reports: "**/coverage.cobertura.xml"
targetdir: "merged/"
reporttypes: "Cobertura"
# TODO - which action / tool to use to publish code coverage results?
# - name: Publish code coverage results
# Phase 5 transcode coverage gate — runs in parallel with run-tests.
# Explicitly targets the three test assemblies most affected by Phase 5 HLS
# session-sharing and PostgreSQL media-encoding changes so failures surface
# with a dedicated check status independent of the full test matrix.
run-phase5-tests:
runs-on: [self-hosted, k3s, linux, amd64]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install .NET SDK
run: |
DOTNET_INSTALL_DIR="$HOME/.dotnet"
mkdir -p "$DOTNET_INSTALL_DIR"
curl -fsSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 10.0 --install-dir "$DOTNET_INSTALL_DIR"
echo "DOTNET_ROOT=$DOTNET_INSTALL_DIR" >> "$GITHUB_ENV"
echo "PATH=$DOTNET_INSTALL_DIR:$PATH" >> "$GITHUB_ENV"
- name: Run Phase 5 Transcode Tests (API)
run: |
export PATH="$HOME/.dotnet:$PATH"
dotnet test tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj \
--configuration Release \
--collect:"XPlat Code Coverage" \
--settings tests/coverletArgs.runsettings \
--verbosity minimal \
--filter "Category!=RequiresDocker"
- name: Run Phase 5 Transcode Tests (HLS)
run: |
export PATH="$HOME/.dotnet:$PATH"
dotnet test tests/Jellyfin.MediaEncoding.Hls.Tests/Jellyfin.MediaEncoding.Hls.Tests.csproj \
--configuration Release \
--collect:"XPlat Code Coverage" \
--settings tests/coverletArgs.runsettings \
--verbosity minimal \
--filter "Category!=RequiresDocker"
- name: Run Phase 5 Transcode Tests (Server.Implementations)
run: |
export PATH="$HOME/.dotnet:$PATH"
dotnet test tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj \
--configuration Release \
--collect:"XPlat Code Coverage" \
--settings tests/coverletArgs.runsettings \
--verbosity minimal \
--filter "Category!=RequiresDocker"
- name: Merge Phase 5 code coverage results
uses: danielpalme/ReportGenerator-GitHub-Action@2a7030e9775aab6c78e80cb66843051acdacee3e # v5.5.2
with:
reports: "**/coverage.cobertura.xml"
targetdir: "merged-phase5/"
reporttypes: "Cobertura"