Skip to content

Commit

Permalink
Merge pull request #49 from Archomeda/feature/multitargeting
Browse files Browse the repository at this point in the history
Add multi-targeting support
  • Loading branch information
Archomeda authored Mar 21, 2020
2 parents 82ac152 + 94507d7 commit 3e0de80
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 107 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ jobs:
os:
- ubuntu-latest
- windows-latest
dotnet:
- netcoreapp3.1
- netcoreapp2.1
- net461
exclude:
- os: ubuntu-latest
dotnet: net461
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
name: Install .NET Core 3.1
with:
dotnet-version: "3.1.102"
- name: Run dotnet build
run: dotnet build Gw2Sharp -c Release
- name: Run dotnet test
run: dotnet test -c Release
run: dotnet test -c Release -f ${{ matrix.dotnet }}

nightly:
name: Nightly
Expand All @@ -36,10 +37,6 @@ jobs:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- uses: actions/setup-dotnet@v1
name: Install .NET Core 3.1
with:
dotnet-version: "3.1.102"
- name: Install InheritDocTool
shell: powershell
run: dotnet tool install --global InheritDocTool
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ jobs:
os:
- ubuntu-latest
- windows-latest
dotnet:
- netcoreapp3.1
- netcoreapp2.1
- net461
exclude:
- os: ubuntu-latest
dotnet: net461
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
name: Install .NET Core 3.1
with:
dotnet-version: "3.1.102"
- name: Run dotnet build
run: dotnet build Gw2Sharp -c Release
- name: Run dotnet test
run: dotnet test -c Release
run: dotnet test -c Release -f ${{ matrix.dotnet }}
19 changes: 8 additions & 11 deletions .github/workflows/publish-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ jobs:
os:
- ubuntu-latest
- windows-latest
dotnet:
- netcoreapp3.1
- netcoreapp2.1
- net461
exclude:
- os: ubuntu-latest
dotnet: net461
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
name: Install .NET Core 3.1
with:
dotnet-version: "3.1.102"
- name: Run dotnet build
run: dotnet build Gw2Sharp -c Release
- name: Run dotnet test
run: dotnet test -c Release
run: dotnet test -c Release -f ${{ matrix.dotnet }}

release:
name: Release
Expand All @@ -34,10 +35,6 @@ jobs:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- uses: actions/setup-dotnet@v1
name: Install .NET Core 3.1
with:
dotnet-version: "3.1.102"
- name: Install InheritDocTool
shell: powershell
run: dotnet tool install --global InheritDocTool
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
- uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- uses: actions/setup-dotnet@v1
name: Install .NET Core 3.1
with:
dotnet-version: "3.1.102"
- name: Install Coverlet
run: dotnet tool install --global coverlet.console
- name: Install SonarScanner
Expand Down
4 changes: 4 additions & 0 deletions Gw2Sharp.Tests/ConnectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ public async Task ValidRequestTest()
[InlineData("membership required", HttpStatusCode.Forbidden, typeof(MembershipRequiredException))]
[InlineData("access restricted to guild leaders", HttpStatusCode.Forbidden, typeof(RestrictedToGuildLeadersException))]
[InlineData("not found", HttpStatusCode.NotFound, typeof(NotFoundException))]
#if NET461
[InlineData("too many requests", (HttpStatusCode)429, typeof(TooManyRequestsException))]
#else
[InlineData("too many requests", HttpStatusCode.TooManyRequests, typeof(TooManyRequestsException))]
#endif
[InlineData("server error", HttpStatusCode.InternalServerError, typeof(ServerErrorException))]
[InlineData("service unavailable", HttpStatusCode.ServiceUnavailable, typeof(ServiceUnavailableException))]
public async Task ExceptionRequestTest(string errorText, HttpStatusCode statusCode, Type exceptionType)
Expand Down
2 changes: 1 addition & 1 deletion Gw2Sharp.Tests/Gw2Sharp.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net461</TargetFrameworks>
<LangVersion>preview</LangVersion>
<Nullable>annotations</Nullable>
<IsTestProject>true</IsTestProject>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"level": {
"min": 80,
"max": 80
},
}
},
{
"id": 1839,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"subtoken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ3YlRodVdNNGExMUduZlpYSTdaa0pHck52SVVPUWhMejZHTXpOeE9TUC1rIiwiaWF0IjoxNTU4Mzk3OTUwLCJleHAiOjE1NzczMDYwOTYsInBlcm1pc3Npb25zIjpbInByb2dyZXNzaW9uIiwiYWNjb3VudCIsInVubG9ja3MiXSwidXJscyI6WyIvdjIvY2hhcmFjdGVycy9NeSUyMENvb2wlMjBDaGFyYWN0ZXIiLCIvdjIvYWNjb3VudC9ob21lL2NhdHMiXX0.UdLlafgo8lxkb1Hn88paZT83aw_9mHEYVZJLDgObNSc",
"subtoken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ3YlRodVdNNGExMUduZlpYSTdaa0pHck52SVVPUWhMejZHTXpOeE9TUC1rIiwiaWF0IjoxNTU4Mzk3OTUwLCJleHAiOjE1NzczMDYwOTYsInBlcm1pc3Npb25zIjpbInByb2dyZXNzaW9uIiwiYWNjb3VudCIsInVubG9ja3MiXSwidXJscyI6WyIvdjIvY2hhcmFjdGVycy9NeSUyMENvb2wlMjBDaGFyYWN0ZXIiLCIvdjIvYWNjb3VudC9ob21lL2NhdHMiXX0.UdLlafgo8lxkb1Hn88paZT83aw_9mHEYVZJLDgObNSc"
}
4 changes: 4 additions & 0 deletions Gw2Sharp.Tests/WebApi/Http/TooManyRequestsExceptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ public class TooManyRequestsExceptionTests
public void SerializableTest()
{
var request = new HttpRequest(new Uri("http://localhost"), new Dictionary<string, string> { { "hello", "tyria" } });
#if NET461
var response = new HttpResponse<ErrorObject>(new ErrorObject { Text = "Error" }, (HttpStatusCode)429, null, null);
#else
var response = new HttpResponse<ErrorObject>(new ErrorObject { Text = "Error" }, HttpStatusCode.TooManyRequests, null, null);
#endif
var exception = new TooManyRequestsException(request, response);
exception.Should().BeBinarySerializable();
}
Expand Down
Loading

0 comments on commit 3e0de80

Please sign in to comment.