-
-
Notifications
You must be signed in to change notification settings - Fork 9
134 lines (116 loc) · 5.08 KB
/
Copy pathunit-tests.yml
File metadata and controls
134 lines (116 loc) · 5.08 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Unit Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
test:
name: ${{ matrix.os }}-${{ matrix.arch }} / ${{ matrix.framework }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
# ---------- Windows x64 ----------
- { runner: windows-latest, os: windows, arch: x64, framework: net462 }
- { runner: windows-latest, os: windows, arch: x64, framework: net6.0 }
- { runner: windows-latest, os: windows, arch: x64, framework: net8.0 }
- { runner: windows-latest, os: windows, arch: x64, framework: net9.0 }
# ---------- Windows ARM64 ----------
# .NET Framework (net462) is not supported on ARM64.
- { runner: windows-11-arm, os: windows, arch: arm64, framework: net6.0 }
- { runner: windows-11-arm, os: windows, arch: arm64, framework: net8.0 }
- { runner: windows-11-arm, os: windows, arch: arm64, framework: net9.0 }
# ---------- Linux x64 ----------
- { runner: ubuntu-latest, os: linux, arch: x64, framework: net6.0 }
- { runner: ubuntu-latest, os: linux, arch: x64, framework: net8.0 }
- { runner: ubuntu-latest, os: linux, arch: x64, framework: net9.0 }
# ---------- Linux ARM64 ----------
- { runner: ubuntu-24.04-arm, os: linux, arch: arm64, framework: net6.0 }
- { runner: ubuntu-24.04-arm, os: linux, arch: arm64, framework: net8.0 }
- { runner: ubuntu-24.04-arm, os: linux, arch: arm64, framework: net9.0 }
# ---------- macOS ARM64 (Apple Silicon) ----------
- { runner: macos-latest, os: macos, arch: arm64, framework: net6.0 }
- { runner: macos-latest, os: macos, arch: arm64, framework: net8.0 }
- { runner: macos-latest, os: macos, arch: arm64, framework: net9.0 }
# ---------- macOS x64 (Intel) ----------
- { runner: macos-13, os: macos, arch: x64, framework: net6.0 }
- { runner: macos-13, os: macos, arch: x64, framework: net8.0 }
- { runner: macos-13, os: macos, arch: x64, framework: net9.0 }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install SkiaSharp Linux dependencies
if: matrix.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y libfontconfig1 libfreetype6 libuuid1
- name: Install common fonts (Linux)
if: matrix.os == 'linux'
env:
DEBIAN_FRONTEND: noninteractive
run: |
# Pre-accept the EULA for the Microsoft Core Fonts package so apt is non-interactive.
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" \
| sudo debconf-set-selections
sudo apt-get install -y \
fonts-liberation \
fonts-liberation2 \
fonts-dejavu \
fonts-noto-core \
fonts-noto-mono \
fonts-noto-cjk \
ttf-mscorefonts-installer
fc-cache -f
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: NuGet cache
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.csproj') }}
restore-keys: |
nuget-${{ runner.os }}-${{ runner.arch }}-
- name: Restore
run: dotnet restore UglyToad.PdfPig.Rendering.Skia.Tests/UglyToad.PdfPig.Rendering.Skia.Tests.csproj
- name: Build
run: >
dotnet build UglyToad.PdfPig.Rendering.Skia.Tests/UglyToad.PdfPig.Rendering.Skia.Tests.csproj
--framework ${{ matrix.framework }}
--configuration Release
--no-restore
- name: Test
run: >
dotnet test UglyToad.PdfPig.Rendering.Skia.Tests/UglyToad.PdfPig.Rendering.Skia.Tests.csproj
--framework ${{ matrix.framework }}
--configuration Release
--no-build
--logger "trx;LogFileName=test-results.trx"
--logger "console;verbosity=normal"
--results-directory ./TestResults
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.framework }}
path: ./TestResults/**/*.trx
if-no-files-found: ignore
- name: Upload rendered diff images (failures only)
if: failure()
uses: actions/upload-artifact@v4
with:
name: error-images-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.framework }}
# PdfToImageHelper writes diff + rendered PNGs here on assertion failure.
path: UglyToad.PdfPig.Rendering.Skia.Tests/**/ErrorImages/**
if-no-files-found: ignore