Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Use .NET Core SDK
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
source-url: https://nuget.pkg.github.com/${{ github.actor }}/index.json
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Pack solution [Release]
run: dotnet pack --no-restore --no-build -c Release -p:VersionSuffix=$GITHUB_RUN_NUMBER -o out
- name: Upload artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: Nuget packages
path: |
Expand All @@ -37,13 +37,13 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Setup .NET Core SDKs
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: x64
- name: Install SHFB
Expand All @@ -56,7 +56,7 @@ jobs:
working-directory: Doc
run: msbuild EPPlusDoc.sln -t:rebuild -verbosity:minimal -property:Configuration=Release
- name: Upload build artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: Documentation
path: Doc/Help
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Check github.ref starts with 'refs/tags/'
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: |
Expand All @@ -25,7 +25,7 @@ jobs:
echo version=$version
echo "version=$version" >> $GITHUB_ENV
- name: Use .NET Core SDK
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
source-url: https://api.nuget.org/v3/index.json
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Publish Nuget packages to NuGet registry
run: dotnet nuget push "out\*" -k ${{secrets.NUGET_AUTH_TOKEN}}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: x64
- name: Install SHFB
Expand All @@ -63,12 +63,12 @@ jobs:
run: Compress-Archive -Path * -DestinationPath ..\..\out\Documentation.zip
# run: zip -r ../../out/Documentation.zip .
- name: Upload workflow documentation artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: Documentation
path: Doc/Help
- name: Upload Nuget packages and documentation as release artifacts
uses: actions/github-script@v6
uses: actions/github-script@v9
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,33 @@ name: Test code

on:
pull_request:
branches:
- master

jobs:
test:
strategy:
matrix:
os: [ubuntu-20.04, windows-latest]
os: [ubuntu-latest, windows-latest]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup .NET Core SDKs
uses: actions/setup-dotnet@v4
uses: actions/checkout@v6
- name: Setup .NET Core SDKs for Windows
if: matrix.os == 'windows-latest'
uses: actions/setup-dotnet@v5
Comment thread
Shane32 marked this conversation as resolved.
with:
dotnet-version: |
2.1.x
3.1.x
6.0.x
Comment thread
Shane32 marked this conversation as resolved.
8.0.x
- name: Setup .NET Core SDKs on Linux
if: matrix.os == 'ubuntu-latest'
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build solution [Debug]
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/test-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ name: Test documentation

on:
pull_request:
branches:
- master

jobs:
buildcheck:
runs-on: windows-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Setup .NET Core SDKs
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: x64
- name: Install SHFB
Expand Down
42 changes: 26 additions & 16 deletions EPPlusTest/DTS_FailingTests.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OfficeOpenXml;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace EPPlusTest
{
[TestClass]
public class DTS_FailingTests
{
#if !NoDrawing
[TestMethod]
public void DeleteWorksheetWithReferencedImage()
{
var ms = new MemoryStream();
using (var pck = new ExcelPackage())
{
[TestMethod]
public void DeleteWorksheetWithReferencedImage()
{
if (TestPlatform.IsLinux)
{
Assert.Inconclusive("Skipping image worksheet tests on Linux.");
}

var ms = new MemoryStream();
using (var pck = new ExcelPackage())
{
var ws = pck.Workbook.Worksheets.Add("original");
ws.Drawings.AddPicture("Pic1", Properties.Resources.Test1);
pck.Workbook.Worksheets.Copy("original", "copy");
Expand All @@ -33,12 +38,17 @@ public void DeleteWorksheetWithReferencedImage()
}
}

[TestMethod]
public void CopyAndDeleteWorksheetWithImage()
{
using (var pck = new ExcelPackage(new MemoryStream()))
{
var ws = pck.Workbook.Worksheets.Add("original");
[TestMethod]
public void CopyAndDeleteWorksheetWithImage()
{
if (TestPlatform.IsLinux)
{
Assert.Inconclusive("Skipping image worksheet tests on Linux.");
}

using (var pck = new ExcelPackage(new MemoryStream()))
{
var ws = pck.Workbook.Worksheets.Add("original");
ws.Drawings.AddPicture("Pic1", Properties.Resources.Test1);
pck.Workbook.Worksheets.Copy("original", "copy");
pck.Workbook.Worksheets.Delete(ws);
Expand Down
27 changes: 16 additions & 11 deletions EPPlusTest/DrawingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
using EPPlusTest.Properties;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OfficeOpenXml;
using OfficeOpenXml.Drawing;
using OfficeOpenXml.Drawing.Chart;
using OfficeOpenXml.Style;
using System.Diagnostics;
using System.Reflection;
using OfficeOpenXml.Drawing;
using OfficeOpenXml.Drawing.Chart;
using OfficeOpenXml.Style;
using System.Diagnostics;
using System.Reflection;

namespace EPPlusTest
{
Expand All @@ -20,12 +20,17 @@ namespace EPPlusTest
[TestClass]
public class DrawingTest : TestBase
{
[TestMethod]
public void RunDrawingTests()
{
BarChart();
Column();
Cone();
[TestMethod]
public void RunDrawingTests()
{
if (TestPlatform.IsLinux)
{
Assert.Inconclusive("Skipping drawing tests on Linux.");
}

BarChart();
Column();
Cone();
Dougnut();
Drawings();
Line();
Expand Down
2 changes: 1 addition & 1 deletion EPPlusTest/EPPlusTest.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' != 'true'">
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net6.0;net8.0;net462;net48;net481</TargetFrameworks>
Expand Down
15 changes: 15 additions & 0 deletions EPPlusTest/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@

namespace EPPlusTest
{
internal static class TestPlatform
{
internal static bool IsLinux
{
get
{
#if NETFRAMEWORK
return Environment.OSVersion.Platform == PlatformID.Unix;
#else
return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux);
#endif
}
}
}

[TestClass]
public abstract class TestBase
{
Expand Down
14 changes: 14 additions & 0 deletions EPPlusTest/WorkSheetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public class WorkSheetTest : TestBase
[TestMethod]
public void RunWorksheetTests()
{
if (TestPlatform.IsLinux)
{
Assert.Inconclusive("Skipping worksheet integration tests on Linux.");
}

InsertDeleteTestRows();
InsertDeleteTestColumns();
LoadData();
Expand Down Expand Up @@ -2274,6 +2279,11 @@ public void CreatePivotMultData()
[TestMethod]
public void SetBackground()
{
if (TestPlatform.IsLinux)
{
Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux.");
}

var ws = _pck.Workbook.Worksheets.Add("backimg");

ws.BackgroundImage.Image = Properties.Resources.Test1;
Expand All @@ -2284,6 +2294,10 @@ public void SetBackground()
[TestMethod]
public void SetHeaderFooterImage()
{
if (TestPlatform.IsLinux)
{
Assert.Inconclusive("Skipping drawing-related worksheet tests on Linux.");
}

var ws = _pck.Workbook.Worksheets.Add("HeaderImage");
ws.HeaderFooter.OddHeader.CenteredText = "Before ";
Expand Down
Loading