-
Notifications
You must be signed in to change notification settings - Fork 43
Add codecoverage, CodeQL analysis, dotnet-format #89
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
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5be04b5
Add code coverage
sungam3r 680b552
return coverage badge
sungam3r 5cc22a1
tag
sungam3r c42e974
add script for uploading nupng to release, shorten api approval file …
sungam3r b76f9a7
fix
sungam3r e4595af
Add CodeQL analysis and dotnet-format
sungam3r daaf293
Merge branch 'master' into tweaks
sungam3r 9883e40
fix
sungam3r d8d9ee0
Merge branch 'master' of github.com:graphql-dotnet/parser into tweaks
sungam3r 1eb9752
1
sungam3r 024827c
Merge branch 'master' of github.com:graphql-dotnet/parser into tweaks
sungam3r 654c178
Merge branch 'develop' of github.com:graphql-dotnet/parser into tweaks
sungam3r f2a3ff6
update coverlet
sungam3r 895ac12
add check
sungam3r dbf4346
fix ci
sungam3r ccfa469
one more fix
sungam3r b5402c4
ci
sungam3r e22ac0e
1
sungam3r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,20 @@ | ||
name: CodeQL analysis | ||
|
||
on: | ||
push: | ||
branches: [master, develop] | ||
pull_request: | ||
branches: [master, develop] | ||
|
||
jobs: | ||
analyze: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
- uses: github/codeql-action/init@v1 | ||
with: | ||
languages: csharp | ||
- uses: github/codeql-action/autobuild@v1 | ||
- uses: github/codeql-action/analyze@v1 |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -2,12 +2,17 @@ name: Run unit tests | |
|
||
on: | ||
pull_request: | ||
branches: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
paths: | ||
- src/** | ||
- .github/workflows/** | ||
# save code coverage reports when PRs are merged | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
env: | ||
DOTNET_NOLOGO: true | ||
|
@@ -23,10 +28,13 @@ jobs: | |
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
- name: Use .NET Core 3.1 LTS SDK | ||
- name: Setup .NET Core 3.1 LTS SDK | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- name: Install dependencies | ||
working-directory: src | ||
run: dotnet restore | ||
|
@@ -44,4 +52,60 @@ jobs: | |
run: dotnet build --no-restore -c Debug | ||
- name: Test solution [Debug] | ||
working-directory: src | ||
run: dotnet test --no-restore | ||
run: dotnet test --no-restore -p:CollectCoverage=true -p:CoverletOutputFormat=lcov -p:Include=[GraphQL-Parser]* -p:CoverletOutput=../../${{ matrix.os }}.lcov.info | ||
- name: Convert coverage report to clover format | ||
if: ${{ startsWith(matrix.os, 'ubuntu') }} | ||
uses: danielpalme/[email protected] | ||
with: | ||
reports: '${{ matrix.os }}.lcov.info' | ||
targetdir: '.' | ||
reporttypes: 'Clover' | ||
tag: 'test_${{ github.run_number }}' | ||
- name: Monitor coverage | ||
if: ${{ startsWith(matrix.os, 'ubuntu') }} | ||
uses: slavcodev/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
clover_file: "Clover.xml" | ||
threshold_alert: 80 | ||
threshold_warning: 90 | ||
# https://github.com/marketplace/actions/coveralls-github-action | ||
- name: Upload coverage to Coveralls | ||
if: ${{ startsWith(matrix.os, 'ubuntu') }} | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN }} | ||
path-to-lcov: ${{ matrix.os }}.lcov.info | ||
parallel: true | ||
flag-name: ${{ matrix.os }} | ||
- name: Upload coverage to Codecov | ||
if: ${{ 0 == 1 }} #now disabled | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ${{ matrix.os }}.lcov.info | ||
flags: unittests # optional | ||
name: codecov-umbrella # optional | ||
fail_ci_if_error: true # optional (default = false) | ||
verbose: true # optional (default = false) | ||
finish: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
parallel-finished: true | ||
|
||
buildcheck: | ||
needs: | ||
- test | ||
runs-on: ubuntu-latest | ||
if: always() | ||
steps: | ||
- name: Pass build check | ||
if: ${{ needs.test.result == 'success' }} | ||
run: exit 0 | ||
- name: Fail build check | ||
if: ${{ needs.test.result != 'success' }} | ||
run: exit 1 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 @@ | ||
<!-- This target must be imported into Directory.Build.targets --> | ||
<!-- Workaround. Remove once we're on 3.1.300+ | ||
https://github.com/dotnet/sourcelink/issues/572 --> | ||
<Project> | ||
<PropertyGroup> | ||
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<SourceRoot Include="$(NuGetPackageRoot)" /> | ||
</ItemGroup> | ||
|
||
<Target Name="CoverletGetPathMap" | ||
DependsOnTargets="InitializeSourceRootMappedPaths" | ||
Returns="@(_LocalTopLevelSourceRoot)" | ||
Condition="'$(DeterministicSourcePaths)' == 'true'"> | ||
<ItemGroup> | ||
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.