aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci-tests.yml
blob: 36686e64bada0b31a4360069c28519a27f3de62b (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
46
47
48
49
50
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: "7.0.x"

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

    runs-on: "${{ matrix.os }}"
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

      - uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3
        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@873ee34c88a6234bdab7fd264d3666fd1ab417f7 # 5
        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

      - name: Publish OpenAPI Artifact
        uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
        with:
          name: "OpenAPI Spec"
          path: "tests/Jellyfin.Server.Integration.Tests/bin/Release/net*/openapi.json"