aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci-tests.yml
blob: 7586e826b94a4c6682a1549bbad0a03a3ebf6b4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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: "10.0.x"

jobs:
  run-tests:
    strategy:
      matrix:
        os: ["ubuntu-latest", "macos-latest", "windows-latest"]
      fail-fast: false

    runs-on: "${{ matrix.os }}"
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
        with:
          dotnet-version: ${{ env.SDK_VERSION }}

      - name: Run DotNet CLI Tests
        run: >
          dotnet test Jellyfin.sln
          --configuration Release
          --collect:"XPlat Code Coverage"
          --settings tests/coverletArgs.runsettings
          --verbosity minimal

      - name: Merge code coverage results
        uses: danielpalme/ReportGenerator-GitHub-Action@2a82782178b2816d9d6960a7345fdd164791b323 # v5.5.3
        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