-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
131 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: dotnet build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' #${{ matrix.dotnet-version }} | ||
- name: Install dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --configuration Release --no-restore | ||
- name: Test | ||
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}" | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dotnet-results-${{ matrix.dotnet-version }} | ||
path: TestResults-${{ matrix.dotnet-version }} | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: dotnet package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' # SDK Version to use. | ||
# source-url: https://nuget.pkg.github.com/<owner>/index.json | ||
|
||
- run: dotnet build | ||
- name: Create the package | ||
run: dotnet pack --include-symbols --include-source --configuration Release Terradue.OpenSearch.GeoJson/Terradue.OpenSearch.GeoJson.csproj | ||
- name: Publish the package to Nuget | ||
run: dotnet nuget push Terradue.OpenSearch.GeoJson/bin/Release/*.nupkg -s https://www.nuget.org/api/v2/package -k ${{secrets.NUGET_API_KEY}} --skip-duplicate | ||
- name: Publish the package to GPR | ||
run: dotnet nuget push Terradue.OpenSearch.GeoJson/bin/Release/*.nupkg -s https://nuget.pkg.github.com/emmanuelmathot/index.json -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Terradue.OpenSearch.GeoJson.Test | ||
{ | ||
public class Startup | ||
{ | ||
public IConfiguration Configuration { get; private set; } | ||
|
||
public void ConfigureServices(IServiceCollection services) | ||
{ | ||
Configuration = GetApplicationConfiguration(); | ||
services.AddLogging(builder => | ||
{ | ||
builder.AddConfiguration(Configuration.GetSection("Logging")); | ||
}); | ||
services.AddOptions(); | ||
} | ||
|
||
public void Configure(ILoggerFactory loggerfactory) | ||
{ | ||
// loggerfactory.AddProvider(new XunitTestOutputLoggerProvider(accessor)); | ||
loggerfactory.AddLog4Net(); | ||
} | ||
|
||
public IConfiguration GetApplicationConfiguration() | ||
{ | ||
var builder = new ConfigurationBuilder() | ||
.AddJsonFile("appsettings.json", optional: true) | ||
.AddEnvironmentVariables() | ||
.Build(); | ||
|
||
return builder; | ||
} | ||
} | ||
} |
19 changes: 7 additions & 12 deletions
19
Terradue.OpenSearch.GeoJson.Test/Terradue.OpenSearch.GeoJson.Test.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<Project ToolsVersion="Current" Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<ProjectGuid>{0A38D877-708C-4092-91BB-8B89303EC56D}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>Terradue.OpenSearch.GeoJson.Test</RootNamespace> | ||
<AssemblyName>Terradue.OpenSearch.GeoJson.Test</AssemblyName> | ||
<_ExtraTargetFrameworks Condition="'$(OS)' == 'Windows_NT' or '$(MSBuildRuntimeType)' == 'Mono'">net472</_ExtraTargetFrameworks> | ||
<TargetFrameworks>netcoreapp2.1;$(RoslynPortableTargetFrameworks);$(_ExtraTargetFrameworks)</TargetFrameworks> | ||
<TargetFrameworks>netcoreapp3.1</TargetFrameworks> | ||
<RuntimeIdentifiers>win;linux</RuntimeIdentifiers> | ||
<PackageOutputPath>$(SolutionDir)\build</PackageOutputPath> | ||
<RestorePackagesPath>$(SolutionDir)\packages</RestorePackagesPath> | ||
<IsPackable>false</IsPackable> | ||
<NoWarn>$(NoWarn);NU1605</NoWarn> | ||
</PropertyGroup> | ||
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' "> | ||
<Reference Include="System"/> | ||
<Reference Include="System.Xml"/> | ||
<Reference Include="System.Xml.Linq"/> | ||
<Reference Include="System.Xml.Serialization"/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Terradue.OpenSearch.GeoJson\Terradue.OpenSearch.GeoJson.csproj"/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.*" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.*" /> | ||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.*" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="3.1.*" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> | ||
<PackageReference Include="NUnit" Version="3.12.0"/> | ||
<PackageReference Include="NUnit.Runners" Version="3.10.0"/> | ||
<PackageReference Include="NUnit.ConsoleRunner" Version="3.10.0"/> | ||
<PackageReference Include="NUnit3TestAdapter" Version="3.16.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" /> | ||
<PackageReference Include="Terradue.Metadata.EarthObservation" Version="1.6.6"/> | ||
<PackageReference Include="log4net" Version="2.0.8"/> | ||
<PackageReference Include="log4net" Version="2.0.11"/> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"AllowedHosts": "*", | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Debug", | ||
"Microsoft": "Warning", | ||
"Microsoft.Hosting.Lifetime": "Information" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<log4net> | ||
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender"> | ||
<file value="test.log" /> | ||
<rollingStyle value="Date" /> | ||
<appendToFile value="true" /> | ||
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> | ||
<datePattern value="yyyyMMdd" /> | ||
<layout type="log4net.Layout.PatternLayout"> | ||
<conversionPattern value="%date %level [%thread] %logger{1} - %message%newline" /> | ||
</layout> | ||
</appender> | ||
<root> | ||
<level value="DEBUG" /> | ||
<appender-ref ref="RollingFile" /> | ||
</root> | ||
</log4net> |
23 changes: 5 additions & 18 deletions
23
Terradue.OpenSearch.GeoJson/Terradue.OpenSearch.GeoJson.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters