-
Notifications
You must be signed in to change notification settings - Fork 547
105 lines (97 loc) · 2.76 KB
/
build.yml
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
name: Build
on:
push:
branches:
- 'main'
- 'release/*'
paths-ignore:
- 'docs/**'
- '**.md'
pull_request:
branches:
- 'main'
- 'release/*'
paths-ignore:
- 'docs/**'
- '**.md'
workflow_dispatch:
jobs:
event_file: # Used for test reporting
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
validate_gen:
name: "Validate generated files"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET
uses: actions/setup-dotnet@v4
- name: Remove generated files for baseline
run: Remove-Item generated/ -Include *.g.cs -Recurse
shell: pwsh
- name: Restore
run: dotnet restore --verbosity normal
- name: Build
run: dotnet build --no-restore --verbosity normal
- name: Validate generated files
run: |
if [ "$(git diff --ignore-space-at-eol generated/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
build_and_test:
name: Build and Test
strategy:
fail-fast: false
matrix:
configuration: [ debug, release ]
projectloadstyle: [ net35, net40, All ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
exclude:
- projectloadstyle: net35
os: ubuntu-latest
- projectloadstyle: net40
os: ubuntu-latest
- projectloadstyle: net35
os: macos-latest
- projectloadstyle: net40
os: macos-latest
env:
RunPeVerify: true
Solution_Name: Open-XML-SDK.sln
Configuration: ${{ matrix.configuration }}
ProjectLoadStyle: ${{ matrix.projectloadstyle }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Install global.json .NET
uses: actions/setup-dotnet@v4
- name: Restore
run: dotnet restore --verbosity normal
- name: Build
run: dotnet build --no-restore --verbosity normal
- name: Test
run: dotnet test --no-restore --verbosity normal --logger trx --results-directory test-results/
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (${{ matrix.os }} ${{ matrix.configuration }} ${{ matrix.projectloadstyle }})
path: test-results/*