Skip to content

Commit 4b646e1

Browse files
committed
NET6 for CI, tests and examples; enable dependabot for github-actions; embedded readme; apply ShouldBeSkipped for VariableReference branch
1 parent c853fe1 commit 4b646e1

18 files changed

+43
-45
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
version: 2
22
updates:
3-
- package-ecosystem: nuget
3+
- package-ecosystem: "nuget"
44
directory: "/"
55
schedule:
6-
interval: daily
7-
time: '02:00'
8-
open-pull-requests-limit: 10
6+
interval: "daily"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v2
22-
- name: Setup .NET Core 5.0 SDK
22+
- name: Setup .NET Core SDK
2323
uses: actions/setup-dotnet@v1
2424
with:
25-
dotnet-version: "5.0.x"
25+
dotnet-version: "6.0.x"
2626
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
2727
env:
2828
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup .NET Core SDK
2020
uses: actions/setup-dotnet@v1
2121
with:
22-
dotnet-version: "5.0.x"
22+
dotnet-version: "6.0.x"
2323
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
2424
env:
2525
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
version="${github_ref:10}"
2828
echo version=$version
2929
echo "version=$version" >> $GITHUB_ENV
30-
- name: Setup .NET Core 5.0 SDK
30+
- name: Setup .NET Core SDK
3131
uses: actions/setup-dotnet@v1
3232
with:
33-
dotnet-version: "5.0.x"
33+
dotnet-version: "6.0.x"
3434
source-url: https://api.nuget.org/v3/index.json
3535
env:
3636
NUGET_AUTH_TOKEN: ${{secrets.NUGET_AUTH_TOKEN}}
@@ -53,7 +53,7 @@ jobs:
5353
working-directory: src
5454
run: dotnet nuget push "out/*" -k ${{secrets.NUGET_AUTH_TOKEN}}
5555
- name: Upload Nuget packages as release artifacts
56-
uses: actions/github-script@v2
56+
uses: actions/github-script@v5
5757
with:
5858
github-token: ${{secrets.GITHUB_TOKEN}}
5959
script: |
@@ -64,7 +64,7 @@ jobs:
6464
for (let file of await fs.readdir('src/out')) {
6565
console.log('uploading', file);
6666
67-
await github.repos.uploadReleaseAsset({
67+
await github.rest.repos.uploadReleaseAsset({
6868
owner,
6969
repo,
7070
release_id: ${{ github.event.release.id }},

.github/workflows/test.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,13 @@ jobs:
3434
steps:
3535
- name: Checkout source
3636
uses: actions/checkout@v2
37-
- name: Setup .NET Core 3.1 SDK
37+
- name: Setup .NET Core SDKs
3838
uses: actions/setup-dotnet@v1
3939
with:
40-
dotnet-version: "3.1.x"
41-
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
42-
env:
43-
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
44-
- name: Setup .NET Core 5.0 SDK
45-
uses: actions/setup-dotnet@v1
46-
with:
47-
dotnet-version: "5.0.x"
40+
dotnet-version: |
41+
3.1.x
42+
5.0.x
43+
6.0.x
4844
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
4945
env:
5046
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
@@ -59,8 +55,9 @@ jobs:
5955
working-directory: src
6056
run: |
6157
dotnet tool install -g dotnet-format --version 6.0.243104 --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
62-
dotnet format --check --fix-whitespace || (echo "Run 'dotnet format' to fix formatting issues" && exit 1)
63-
dotnet format --check -v diag --fix-style warn --fix-analyzers warn || (echo "Run 'dotnet format' to fix formatting issues" && exit 1)
58+
dotnet format --no-restore --verify-no-changes -v diag --severity warn whitespace || (echo "Run 'dotnet format' to fix whitespace issues" && exit 1)
59+
dotnet format --no-restore --verify-no-changes -v diag --severity warn analyzers || (echo "Run 'dotnet format' to fix analyzers issues" && exit 1)
60+
dotnet-format --no-restore --verify-no-changes -v diag --severity warn style || (echo "Run 'dotnet format' to fix style issues" && exit 1)
6461
- name: Build solution [Release]
6562
working-directory: src
6663
run: dotnet build --no-restore -c Release -p:GraphQLTestVersion=${{ matrix.graphqlversion }}

src/BasicSample/BasicSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net5</TargetFramework>
5+
<TargetFramework>net6</TargetFramework>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

src/BasicSample/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ public class Query
7575
/// Resolver for 'Query.viewer' field.
7676
/// </summary>
7777
[GraphQLAuthorize("AdminPolicy")]
78-
public User Viewer() => new User { Id = Guid.NewGuid().ToString(), Name = "Quinn" };
78+
public User Viewer() => new() { Id = Guid.NewGuid().ToString(), Name = "Quinn" };
7979

8080
/// <summary>
8181
/// Resolver for 'Query.users' field.
8282
/// </summary>
83-
public List<User> Users() => new List<User> { new User { Id = Guid.NewGuid().ToString(), Name = "Quinn" } };
83+
public List<User> Users() => new() { new User { Id = Guid.NewGuid().ToString(), Name = "Quinn" } };
8484
}
8585

8686
/// <summary>

src/Directory.Build.props

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<VersionPrefix>5.0.0-preview</VersionPrefix>
5-
<LangVersion>8.0</LangVersion>
5+
<LangVersion>latest</LangVersion>
66
<Authors>Joe McBride</Authors>
77
<PackageLicenseExpression>MIT</PackageLicenseExpression>
88
<PackageIcon>logo.64x64.png</PackageIcon>
@@ -17,14 +17,13 @@
1717
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1818
<EnableNETAnalyzers>true</EnableNETAnalyzers>
1919
<Nullable>enable</Nullable>
20+
<PackageReadmeFile Condition="'$(IsPackable)' == 'true'">README.md</PackageReadmeFile>
2021
</PropertyGroup>
2122

22-
<ItemGroup>
23-
<None Include="..\..\assets\logo.64x64.png" Pack="true" PackagePath="\" Condition="'$(IsPackable)' == 'true'" />
24-
</ItemGroup>
25-
26-
<ItemGroup>
27-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="'$(IsPackable)' == 'true'"/>
23+
<ItemGroup Condition="'$(IsPackable)' == 'true'">
24+
<None Include="..\..\assets\logo.64x64.png" Pack="true" PackagePath="\" />
25+
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
26+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
2827
</ItemGroup>
2928

3029
</Project>

src/GraphQL.Authorization.ApiTests/GraphQL.Authorization.ApiTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="../Tests.props" />
33

44
<PropertyGroup>
5-
<TargetFramework>net5</TargetFramework>
5+
<TargetFramework>net6</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

src/GraphQL.Authorization.Tests/AuthorizationValidationRuleTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void issue5_with_fragment_should_fail()
148148
{
149149
config.Query = "query a { article { ...frag } } query b { article { ...frag } } fragment frag on Article { content }";
150150
config.Schema = TypedSchema();
151-
config.ValidateResult = result => result.Errors.Single(x => x.Message == $"You are not authorized to run this query.\nRequired claim 'admin' is not present.");
151+
config.ValidateResult = result => _ = result.Errors.Single(x => x.Message == $"You are not authorized to run this query.\nRequired claim 'admin' is not present.");
152152
});
153153
}
154154

0 commit comments

Comments
 (0)