-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (112 loc) · 4.83 KB
/
Copy pathintegration.yml
File metadata and controls
125 lines (112 loc) · 4.83 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
name: integration
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
schedule:
# Nightly — catches regressions introduced by nuget.org / dnx / runtime changes.
- cron: "0 6 * * *"
workflow_dispatch:
inputs:
package_version:
description: "GroupDocs.Viewer.Mcp version on nuget.org to test"
required: false
default: "26.5.1"
# Triggered from the main repo's publish workflow right after a NuGet push.
# Payload: { "package_version": "x.y.z" }
repository_dispatch:
types: [nuget-published]
jobs:
test:
name: ${{ matrix.os }} · dnx
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
env:
MCP_PACKAGE_VERSION: >-
${{ github.event.inputs.package_version
|| github.event.client_payload.package_version
|| '26.5.1' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
# GroupDocs.Viewer's page-rendering paths (PDF, presentations, image-
# bearing documents) call System.Drawing internally on .NET — Linux
# runners need:
# - libgdiplus : managed System.Drawing implementation
# - libfontconfig1 : font discovery
# - ttf-mscorefonts-installer : Arial / Times New Roman / etc. The
# `render_page` tool rasterizes pages to PNG and lays out text glyphs;
# without MS core fonts the engine fails on font resolution and the
# wrapped error reads "An error occurred invoking 'render_page'."
# Pattern lifted from the sibling python-conversion Dockerfile. EULA
# accepted via debconf-set-selections; fc-cache refresh post-install.
# Note: the .NET Docker base aspnet:10.0 inherits these fonts from
# Debian-bookworm-slim; bare ubuntu-24.04 runners do not.
- name: Install Linux native deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | sudo debconf-set-selections
sudo apt-get install -y --no-install-recommends \
libgdiplus libfontconfig1 ttf-mscorefonts-installer
# Refresh font cache so newly-installed MS fonts are discoverable.
sudo fc-cache -f -v > /dev/null
# macOS runners ship neither GDI+ nor libgdiplus. GroupDocs engines that
# touch image / spreadsheet content P/Invoke System.Drawing, which loads
# libgdiplus. The dnx-spawned server's dyld does NOT search the Homebrew
# prefix or /usr/local/lib (a failing run showed its dlopen only probes the
# package dir, the .NET shared-framework dir, and /usr/lib). So install via
# Homebrew and copy the dylib into the .NET runtime's shared-framework dir,
# a path .NET's System.Drawing explicitly probes; libgdiplus's own deps
# (cairo, glib, …) stay resolvable via the absolute Homebrew paths baked
# into its load commands. (Windows has GDI+ built in; Linux: apt above.)
- name: Install macOS native deps
if: runner.os == 'macOS'
run: |
set -euxo pipefail
brew install mono-libgdiplus
GDIP="$(brew --prefix mono-libgdiplus)/lib/libgdiplus.dylib"
otool -L "$GDIP" || true
for d in "$HOME/.dotnet/shared/Microsoft.NETCore.App/"*/ ; do
cp -f "$GDIP" "$d"
echo "installed libgdiplus -> $d"
done
- name: Show environment
shell: bash
run: |
dotnet --info
echo "Testing GroupDocs.Viewer.Mcp@${MCP_PACKAGE_VERSION}"
dnx --help || true
- name: Write GroupDocs license (optional)
# If the repo defines a GROUPDOCS_LICENSE secret (base64 of a .lic file),
# write it to disk and point GROUPDOCS_LICENSE_PATH at it. Unlocks the
# licensed-mode tests; evaluation-mode tests still run.
env:
GROUPDOCS_LICENSE: ${{ secrets.GROUPDOCS_LICENSE }}
if: env.GROUPDOCS_LICENSE != ''
shell: bash
run: |
echo "$GROUPDOCS_LICENSE" | base64 -d > "$RUNNER_TEMP/GroupDocs.lic"
echo "GROUPDOCS_LICENSE_PATH=$RUNNER_TEMP/GroupDocs.lic" >> "$GITHUB_ENV"
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Integration tests
run: >-
dotnet test --configuration Release --no-build
--logger "trx;LogFileName=integration.trx"
--logger "console;verbosity=detailed"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: trx-${{ matrix.os }}
path: "**/TestResults/*.trx"
if-no-files-found: ignore