From b1e3e66d82f36acdfee0e856fce7edc9ed293858 Mon Sep 17 00:00:00 2001 From: Phillip Haydon Date: Thu, 30 Jul 2020 14:18:00 +0800 Subject: [PATCH 1/2] get builds running on linux --- .github/workflows/on-push-run-build.yml | 42 +++++++++++++++++++ .gitignore | 1 + .../AssemblyExtensions.cs | 21 ---------- .../MethodDecorator.Fody.PnP.Tests.csproj | 3 +- .../MethodDecorator.Fody.Tests.csproj | 2 +- MethodDecorator.Fody.sln | 2 +- MethodDecorator/MethodDecorator.csproj | 6 ++- .../AnotherAssemblyAttributeContainer.csproj | 6 ++- .../SimpleTest.PnP/SimpleTest.PnP.csproj | 6 ++- TestAssemblies/SimpleTest/SimpleTest.csproj | 6 ++- 10 files changed, 67 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/on-push-run-build.yml delete mode 100644 MethodDecorator.Fody.PnP.Tests/AssemblyExtensions.cs diff --git a/.github/workflows/on-push-run-build.yml b/.github/workflows/on-push-run-build.yml new file mode 100644 index 00000000..3c24cbd9 --- /dev/null +++ b/.github/workflows/on-push-run-build.yml @@ -0,0 +1,42 @@ +name: on-push-run-build +on: + push: + +env: + # Opt out of telemetry + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + +jobs: + build_linux: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET Core 3.1 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.x' + + - name: Build with dotnet + run: dotnet build --configuration Debug + + - name: Run unit tests + run: dotnet test --no-build -c Debug + + build_windows: + + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET Core 3.1 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '3.1.x' + + - name: Build with dotnet + run: dotnet build --configuration Debug + + - name: Run unit tests + run: dotnet test --no-build -c Debug diff --git a/.gitignore b/.gitignore index c1643193..e1801ea3 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ *.sln.docstates *.pidb *.userprefs +*.idea # Build results [Dd]ebug/ diff --git a/MethodDecorator.Fody.PnP.Tests/AssemblyExtensions.cs b/MethodDecorator.Fody.PnP.Tests/AssemblyExtensions.cs deleted file mode 100644 index 6ead6cae..00000000 --- a/MethodDecorator.Fody.PnP.Tests/AssemblyExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Reflection; - -namespace MethodDecorator.Fody.Tests -{ - public static class AssemblyExtensions - { - public static dynamic GetInstance(this Assembly assembly, string className) - { - var type = assembly.GetType(className, true); - //dynamic instance = FormatterServices.GetUninitializedObject(type); - return Activator.CreateInstance(type); - } - - public static dynamic GetStaticInstance(this Assembly assembly, string className) - { - var type = assembly.GetType(className, true); - return new StaticMembersDynamicWrapper(type); - } - } -} \ No newline at end of file diff --git a/MethodDecorator.Fody.PnP.Tests/MethodDecorator.Fody.PnP.Tests.csproj b/MethodDecorator.Fody.PnP.Tests/MethodDecorator.Fody.PnP.Tests.csproj index 8ca9deb7..58828ec5 100644 --- a/MethodDecorator.Fody.PnP.Tests/MethodDecorator.Fody.PnP.Tests.csproj +++ b/MethodDecorator.Fody.PnP.Tests/MethodDecorator.Fody.PnP.Tests.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp2.2 + netcoreapp3.1 true @@ -11,6 +11,7 @@ + diff --git a/MethodDecorator.Fody.Tests/MethodDecorator.Fody.Tests.csproj b/MethodDecorator.Fody.Tests/MethodDecorator.Fody.Tests.csproj index aeb14965..3c50b9f1 100644 --- a/MethodDecorator.Fody.Tests/MethodDecorator.Fody.Tests.csproj +++ b/MethodDecorator.Fody.Tests/MethodDecorator.Fody.Tests.csproj @@ -1,7 +1,7 @@  - net472;netcoreapp2.2 + netcoreapp3.1 true diff --git a/MethodDecorator.Fody.sln b/MethodDecorator.Fody.sln index 2623bf3f..5f4e1720 100644 --- a/MethodDecorator.Fody.sln +++ b/MethodDecorator.Fody.sln @@ -20,7 +20,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{40A4C9F0-C6C6-467D-B076-E9F0EBB4A7B4}" ProjectSection(SolutionItems) = preProject Directory.Build.props = Directory.Build.props - README.md = README.md + readme.md = readme.md EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MethodDecorator.Fody.PnP.Tests", "MethodDecorator.Fody.PnP.Tests\MethodDecorator.Fody.PnP.Tests.csproj", "{8B02CB9B-FBF7-4D55-AB6E-12122472122C}" diff --git a/MethodDecorator/MethodDecorator.csproj b/MethodDecorator/MethodDecorator.csproj index 360dcdb7..38071473 100644 --- a/MethodDecorator/MethodDecorator.csproj +++ b/MethodDecorator/MethodDecorator.csproj @@ -7,7 +7,7 @@ Simon Cropp, Matt Ellis, Alexey Suvorov, Andy Hoyle, Tony (@megafinz), and contributors Fody add-in to decorate arbitrary methods to run code before and after invocation. ILWeaving Fody AOP - CS1591;NU5228 + CS1591;NU5228;NU5118 $(SolutionDir)nugets https://raw.githubusercontent.com/Fody/MethodDecorator/master/package_icon.png https://github.com/Fody/MethodDecorator @@ -16,4 +16,8 @@ + + + + \ No newline at end of file diff --git a/TestAssemblies/AnotherAssemblyAttributeContainer/AnotherAssemblyAttributeContainer.csproj b/TestAssemblies/AnotherAssemblyAttributeContainer/AnotherAssemblyAttributeContainer.csproj index 688f3a41..a6411412 100644 --- a/TestAssemblies/AnotherAssemblyAttributeContainer/AnotherAssemblyAttributeContainer.csproj +++ b/TestAssemblies/AnotherAssemblyAttributeContainer/AnotherAssemblyAttributeContainer.csproj @@ -1,7 +1,11 @@  - net472;netstandard2.0 + net452;netstandard2.0 true + + + + \ No newline at end of file diff --git a/TestAssemblies/SimpleTest.PnP/SimpleTest.PnP.csproj b/TestAssemblies/SimpleTest.PnP/SimpleTest.PnP.csproj index 3d2f1095..f410faa5 100644 --- a/TestAssemblies/SimpleTest.PnP/SimpleTest.PnP.csproj +++ b/TestAssemblies/SimpleTest.PnP/SimpleTest.PnP.csproj @@ -1,10 +1,14 @@  - net472;netstandard2.0 + net452;netstandard2.0 true + + + + \ No newline at end of file diff --git a/TestAssemblies/SimpleTest/SimpleTest.csproj b/TestAssemblies/SimpleTest/SimpleTest.csproj index 691b424e..1c19550b 100644 --- a/TestAssemblies/SimpleTest/SimpleTest.csproj +++ b/TestAssemblies/SimpleTest/SimpleTest.csproj @@ -1,11 +1,15 @@  - net472;netstandard2.0 + net452;netstandard2.0 true + + + + \ No newline at end of file From 2627ddcf309edf0889b0d5d2d7cccbe44158e420 Mon Sep 17 00:00:00 2001 From: Phillip Haydon Date: Fri, 31 Jul 2020 11:29:35 +0800 Subject: [PATCH 2/2] updated workflow to minimize spam and include PRs --- .github/workflows/on-push-run-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-push-run-build.yml b/.github/workflows/on-push-run-build.yml index 3c24cbd9..229ae324 100644 --- a/.github/workflows/on-push-run-build.yml +++ b/.github/workflows/on-push-run-build.yml @@ -1,10 +1,10 @@ name: on-push-run-build -on: - push: +on: [push, pull_request] env: # Opt out of telemetry DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_NOLOGO: 1 jobs: build_linux: