9c6fab8f12
setup-dotnet fails on ARC runners (no permission to /usr/share/dotnet) and dotnet is not pre-installed. Install via dotnet-install.sh into $HOME/.dotnet instead, then add to PATH via GITHUB_PATH.
47 lines
1.6 KiB
YAML
47 lines
1.6 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 to a writable location — self-hosted ARC runners don't allow
|
|
# writes to /usr/share/dotnet, so we redirect via DOTNET_INSTALL_DIR.
|
|
- name: Install .NET SDK
|
|
run: |
|
|
export 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_INSTALL_DIR" >> "$GITHUB_PATH"
|
|
|
|
- name: Run DotNet CLI Tests
|
|
run: >
|
|
dotnet test Jellyfin.sln
|
|
--configuration Release
|
|
--collect:"XPlat Code Coverage"
|
|
--settings tests/coverletArgs.runsettings
|
|
--verbosity minimal
|
|
--filter "Category!=RequiresDocker"
|
|
|
|
- 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
|