Skip to content

Commit

Permalink
Merge branch 'main' into package-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
twsouthwick committed Jul 11, 2023
2 parents 88e008c + 31289b6 commit cc8a522
Show file tree
Hide file tree
Showing 8 changed files with 868 additions and 34 deletions.
113 changes: 81 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:
- 'release/*'
- '!/docs/'
- '!/*.md'

env:
RunPeVerify: true

jobs:
event_file: # Used for test reporting
Expand All @@ -25,31 +22,87 @@ jobs:
with:
name: Event File
path: ${{ github.event_path }}
pack:
name: "Pack"
runs-on: ubuntu-latest
env:
Configuration: Release
ProjectLoadStyle: All
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.x'
- name: GitVersion
run: |
dotnet tool install --global GitVersion.Tool --version 5.12.0
dotnet gitversion /output buildserver /nofetch
- name: Restore
run: dotnet restore --verbosity normal
- name: Build
run: dotnet build --no-restore --verbosity normal
- name: Pack
run: dotnet pack --no-build
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Unsigned
path: "bin/${{ env.Configuration }}/packages/shipping/*"
validate_gen:
name: "Validate generated files"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Remove generated files for baseline
run: Remove-Item generated/ -Include *.g.cs -Recurse
shell: pwsh
- name: Install .NET Core
uses: actions/setup-dotnet@v3
- 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:
matrix:
configuration: [ debug, release ]
projectloadstyle: [ net35, net40, net46, net6_0, net7_0 ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
exclude:
- projectloadstyle: net35
os: ubuntu-latest
- projectloadstyle: net40
os: ubuntu-latest
- projectloadstyle: net46
os: ubuntu-latest
- projectloadstyle: net35
os: macos-latest
- projectloadstyle: net40
os: macos-latest
- projectloadstyle: net46
os: macos-latest
fail-fast: false
matrix:
configuration: [ debug, release ]
projectloadstyle: [ net35, net40, net46, net6_0, net7_0 ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
exclude:
- projectloadstyle: net35
os: ubuntu-latest
- projectloadstyle: net40
os: ubuntu-latest
- projectloadstyle: net46
os: ubuntu-latest
- projectloadstyle: net35
os: macos-latest
- projectloadstyle: net40
os: macos-latest
- projectloadstyle: net46
os: macos-latest

env:
Solution_Name: Open-XML-SDK.sln
Configuration: ${{ matrix.configuration }}
ProjectLoadStyle: ${{ matrix.projectloadstyle }}
RunPeVerify: true
Solution_Name: Open-XML-SDK.sln
Configuration: ${{ matrix.configuration }}
ProjectLoadStyle: ${{ matrix.projectloadstyle }}

runs-on: ${{ matrix.os }}

Expand All @@ -63,16 +116,12 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Restore the Projects
run: dotnet restore --verbosity normal

- name: Build the Projects
run: dotnet build --no-restore --verbosity normal

- name: Run All Tests
- 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@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
path: 'artifacts/Code Coverage/code-coverage-results.md'
path: 'artifacts/Code Coverage/SummaryGithub.md'
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Collections.Generic;

namespace DocumentFormat.OpenXml
{
/// <summary>
/// Equality comparer for determining value equality for <see cref="OpenXmlElement"/>.
/// </summary>
public static class OpenXmlElementComparers
{
/// <summary>
/// Gets the default equality comparer.
/// </summary>
public static IEqualityComparer<OpenXmlElement> Default { get; } = Create(new OpenXmlElementEqualityOptions());

/// <summary>
/// Creates a <see cref="IEqualityComparer{OpenXmlElement}"/> based on the given options./>
/// </summary>
/// <param name="openXmlElementEqualityOptions">The options defining equality.</param>
/// <returns></returns>
public static IEqualityComparer<OpenXmlElement> Create(OpenXmlElementEqualityOptions openXmlElementEqualityOptions)
{
return new OpenXmlElementEqualityComparer(openXmlElementEqualityOptions);
}
}
}
Loading

0 comments on commit cc8a522

Please sign in to comment.