-
-
Notifications
You must be signed in to change notification settings - Fork 69
144 lines (126 loc) · 5 KB
/
Copy pathvisio-showcase-artifacts.yml
File metadata and controls
144 lines (126 loc) · 5 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
135
136
137
138
139
140
141
142
143
144
name: Visio Showcase Artifacts
on:
pull_request:
branches:
- master
paths:
- 'OfficeIMO.Visio/**'
- 'OfficeIMO.Drawing/**'
- 'OfficeIMO.Examples/OfficeIMO.Examples.csproj'
- 'OfficeIMO.Examples/Visio/**'
- 'OfficeIMO.Examples/Program.cs'
- 'OfficeIMO.Examples/README.md'
- 'Docs/officeimo.visio*.md'
- '.github/scripts/Assert-VisioShowcase*.ps1'
- '.github/workflows/visio-showcase-artifacts.yml'
push:
branches:
- master
paths:
- 'OfficeIMO.Visio/**'
- 'OfficeIMO.Drawing/**'
- 'OfficeIMO.Examples/OfficeIMO.Examples.csproj'
- 'OfficeIMO.Examples/Visio/**'
- 'OfficeIMO.Examples/Program.cs'
- 'OfficeIMO.Examples/README.md'
- 'Docs/officeimo.visio*.md'
- '.github/scripts/Assert-VisioShowcase*.ps1'
- '.github/workflows/visio-showcase-artifacts.yml'
workflow_dispatch:
inputs:
run_desktop_preview:
description: 'Run the optional Microsoft Visio desktop preview lane'
required: false
default: false
type: boolean
permissions:
contents: read
env:
DOTNET_VERSION: |
8.0.418
10.0.103
BUILD_CONFIGURATION: Release
SHOWCASE_PATH: OfficeIMO.Examples/bin/Release/net8.0/Documents/Visio Showcase
jobs:
visio-showcase:
name: Generate native preview bundle
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build examples
run: dotnet build OfficeIMO.Examples/OfficeIMO.Examples.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --framework net8.0
- name: Generate Visio showcase and native previews
run: dotnet OfficeIMO.Examples/bin/Release/net8.0/OfficeIMO.Examples.dll --visio-showcase --visio-native-preview
- name: Validate showcase summary
shell: pwsh
run: ./.github/scripts/Assert-VisioShowcaseSummary.ps1 -ShowcasePath "${{ env.SHOWCASE_PATH }}" -RequirePreviewsPerDiagram -RequireProofsPerDiagram -RequireNativePreviewFormatsPerDiagram
- name: Upload Visio showcase artifacts
uses: actions/upload-artifact@v7
with:
name: officeimo-visio-showcase-native-preview
if-no-files-found: error
path: |
${{ env.SHOWCASE_PATH }}/showcase-summary.md
${{ env.SHOWCASE_PATH }}/showcase-summary.json
${{ env.SHOWCASE_PATH }}/showcase-gallery.html
${{ env.SHOWCASE_PATH }}/**/*.vsdx
${{ env.SHOWCASE_PATH }}/Native Preview/**
${{ env.SHOWCASE_PATH }}/Structural Proof/**
visio-desktop-showcase:
name: Generate desktop Visio preview bundle
if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_desktop_preview }}
runs-on: [self-hosted, Windows, Visio]
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Cache NuGet packages
uses: actions/cache@v5
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Verify Microsoft Visio desktop automation
shell: pwsh
run: |
$type = [type]::GetTypeFromProgID('Visio.Application')
if ($null -eq $type) {
throw 'Microsoft Visio desktop automation is not registered on this runner.'
}
- name: Build examples
run: dotnet build OfficeIMO.Examples/OfficeIMO.Examples.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --framework net8.0
- name: Generate Visio showcase and desktop previews
run: dotnet OfficeIMO.Examples/bin/Release/net8.0/OfficeIMO.Examples.dll --visio-showcase --visio-preview
- name: Validate showcase summary
shell: pwsh
run: ./.github/scripts/Assert-VisioShowcaseSummary.ps1 -ShowcasePath "${{ env.SHOWCASE_PATH }}" -RequirePreviewsPerDiagram -RequireProofsPerDiagram -RequireDesktopPreviewFormatsPerDiagram
- name: Upload Visio desktop showcase artifacts
uses: actions/upload-artifact@v7
with:
name: officeimo-visio-showcase-desktop-preview
if-no-files-found: error
path: |
${{ env.SHOWCASE_PATH }}/showcase-summary.md
${{ env.SHOWCASE_PATH }}/showcase-summary.json
${{ env.SHOWCASE_PATH }}/showcase-gallery.html
${{ env.SHOWCASE_PATH }}/**/*.vsdx
${{ env.SHOWCASE_PATH }}/Preview/**
${{ env.SHOWCASE_PATH }}/Structural Proof/**