Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing on netcoreapp2.1 #17

Merged
merged 4 commits into from
Jan 18, 2021
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
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