Skip to content

Commit

Permalink
Testing on netcoreapp2.1 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros authored Jan 18, 2021
1 parent 44d5fec commit 7ebd50d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ jobs:
DOTNET_CLI_TELEMETRY_OPTOUT: 1

steps:
- uses: actions/checkout@v2
- name: Checkout source code
uses: actions/checkout@v2

- name: Setup dotnet 2.1
uses: actions/setup-dotnet@v1
with:
Expand Down
23 changes: 18 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,34 @@ jobs:
DOTNET_CLI_TELEMETRY_OPTOUT: 1

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
- name: Checkout source code
uses: actions/checkout@v2

- name: Setup dotnet 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.1.*

- name: Setup dotnet 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.*

- name: Setup dotnet 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.*
- name: Install dependencies
run: dotnet restore

- name: Test
run: dotnet test -c Release --framework net5.0
run: dotnet test --configuration Release

- name: Pack with dotnet
run: |
arrTag=(${GITHUB_REF//\// })
VERSION="${arrTag[2]}"
VERSION="${VERSION//v}"
echo "$VERSION"
dotnet pack --output artifacts --configuration Release -p:Version=$VERSION
- name: Push with dotnet
run: dotnet nuget push artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
2 changes: 1 addition & 1 deletion src/Parlot/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private static string CreateString<TState>(int length, TState state, SpanAction<

action(array, state);

return array.ToString();
return new string(array);
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion src/Parlot/Fluent/DecimalLiteral.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public override bool Parse(ParseContext context, ref ParseResult<decimal> result
{
var end = context.Scanner.Cursor.Offset;
#if NETSTANDARD2_0
var sourceToParse = context.Scanner.Buffer.ToString();
var sourceToParse = context.Scanner.Buffer.Substring(start, end -start);
#else
var sourceToParse = context.Scanner.Buffer.AsSpan(start, end - start);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Parlot/Fluent/IntegerLiteral.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override bool Parse(ParseContext context, ref ParseResult<long> result)
var end = context.Scanner.Cursor.Offset;

#if NETSTANDARD2_0
var sourceToParse = context.Scanner.Buffer.ToString();
var sourceToParse = context.Scanner.Buffer.Substring(start, end - start);
#else
var sourceToParse = context.Scanner.Buffer.AsSpan(start, end - start);
#endif
Expand Down
2 changes: 1 addition & 1 deletion test/Parlot.Tests/Parlot.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;net5.0;netcoreapp3.1</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>9.0</LangVersion>
</PropertyGroup>
Expand Down

0 comments on commit 7ebd50d

Please sign in to comment.