Skip to content

Commit 0eaa4b8

Browse files
authored
Added codecov and sonarcloud to CI
* codecov 1 * codecov 2 * codecov 3 * codecov 4 * codecov 5 * sonarcloud 1 * sonarcloud 2 * sonarcloud 3 * sonarcloud 4 * sonarcloud 4 * sonarcloud 5 * sonarcloud 6 * sonarcloud 6 * sonarcloud 7 * sonarcloud 8 * sonarclou * done
1 parent ea45498 commit 0eaa4b8

File tree

8 files changed

+217
-313
lines changed

8 files changed

+217
-313
lines changed

.github/workflows/codeql.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: "CodeQL Scanning"
22

33
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
paths:
10+
- 'src/**'
411
push:
512
branches:
613
- dev

.github/workflows/format-code.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Format code"
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
branches:
10+
- dev
11+
paths:
12+
- 'src/**'
13+
14+
jobs:
15+
dotnet-format:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
ref: ${{ github.head_ref }}
23+
24+
- uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: '3.1.x'
27+
- uses: actions/setup-dotnet@v1
28+
with:
29+
dotnet-version: '5.0.100-preview.7.20366.6'
30+
- name: Move .net SDK's to shared folder (hack)
31+
shell: pwsh
32+
run: |
33+
$version = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Leaf;
34+
$root = Split-Path (Split-Path $ENV:DOTNET_ROOT -Parent) -Parent;
35+
$directories = Get-ChildItem $root | Where-Object { $_.Name -ne $version };
36+
foreach ($dir in $directories) {
37+
$from = $dir.FullName;
38+
$to = "$root/$version";
39+
Write-Host Copying from $from to $to;
40+
Copy-Item "$from\*" $to -Recurse -Force;
41+
}
42+
43+
- name: Install dotnet-format
44+
run: dotnet tool install -g dotnet-format
45+
46+
- name: Run dotnet-format
47+
run: dotnet format src --verbosity diag
48+
49+
- name: Commit formatted files
50+
uses: EndBug/add-and-commit@v4.1.0
51+
with:
52+
add: 'src'
53+
author_name: Github Actions
54+
author_email: actions@github.com
55+
message: Automated dotnet-format update
56+
ref: ${{ github.head_ref }}
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-nightly-to-gpr.yml

Lines changed: 10 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Push nightly to GPR
1+
name: "Push nightly to GPR"
22

33
on:
44
push:
@@ -14,7 +14,7 @@ env:
1414
VERSION: ''
1515
BRANCH: ''
1616

17-
jobs:
17+
jobs:
1818
push-to-gpr:
1919
runs-on: ubuntu-latest
2020
steps:
@@ -57,64 +57,18 @@ jobs:
5757
}
5858
5959
- name: Building library
60-
run: dotnet build src -c Release -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
60+
run: dotnet build src -c Release -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
6161

6262
- name: Running unit tests
63-
run: dotnet test src --verbosity normal /nowarn:CS1591 /p:CollectCoverage=true /p:CoverletOutput=./coverage/ /p:CoverletOutputFormat=lcov
64-
65-
- name: Creating library package
66-
run: |
67-
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
68-
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
69-
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
70-
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
63+
run: dotnet test src -c Release /nowarn:CS1591
7164

72-
- name: Buidling template package
73-
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages
74-
- name: Verifying template
65+
- name: Creating library package
7566
run: |
76-
dotnet new --install ${GITHUB_WORKSPACE}/packages/bunit.template.$VERSION.nupkg
77-
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
78-
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/packages
79-
dotnet test ${GITHUB_WORKSPACE}/Test
80-
81-
- uses: coverallsapp/github-action@v1.1.1
82-
with:
83-
github-token: ${{ secrets.GITHUB_TOKEN }}
84-
path-to-lcov: src/bunit.core.tests/coverage/coverage.net5.0.info
85-
parallel: true
86-
- uses: coverallsapp/github-action@v1.1.1
87-
with:
88-
github-token: ${{ secrets.GITHUB_TOKEN }}
89-
path-to-lcov: src/bunit.core.tests/coverage/coverage.netcoreapp3.1.info
90-
parallel: true
91-
92-
- uses: coverallsapp/github-action@v1.1.1
93-
with:
94-
github-token: ${{ secrets.GITHUB_TOKEN }}
95-
path-to-lcov: src/bunit.web.tests/coverage/coverage.net5.0.info
96-
parallel: true
97-
- uses: coverallsapp/github-action@v1.1.1
98-
with:
99-
github-token: ${{ secrets.GITHUB_TOKEN }}
100-
path-to-lcov: src/bunit.web.tests/coverage/coverage.netcoreapp3.1.info
101-
parallel: true
102-
103-
- uses: coverallsapp/github-action@v1.1.1
104-
with:
105-
github-token: ${{ secrets.GITHUB_TOKEN }}
106-
path-to-lcov: src/bunit.xunit.tests/coverage/coverage.net5.0.info
107-
parallel: true
108-
- uses: coverallsapp/github-action@v1.1.1
109-
with:
110-
github-token: ${{ secrets.GITHUB_TOKEN }}
111-
path-to-lcov: src/bunit.xunit.tests/coverage/coverage.netcoreapp3.1.info
112-
parallel: true
113-
114-
- uses: coverallsapp/github-action@v1.1.1
115-
with:
116-
github-token: ${{ secrets.github_token }}
117-
parallel-finished: true
67+
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
68+
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
69+
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
70+
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
71+
dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages /p:PublicRelease=true
11872
11973
- name: Push packages to GitHub Package Registry
12074
run: |

.github/workflows/publish-nuget-force.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github/workflows/publish-packages.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,15 @@ jobs:
5454
run: dotnet build src -c Release -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
5555

5656
- name: Running unit tests
57-
run: dotnet test src -c Release --verbosity normal /nowarn:CS1591
57+
run: dotnet test src -c Release /nowarn:CS1591
5858

5959
- name: Creating library package
6060
run: |
6161
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
6262
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
6363
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
6464
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/packages -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true /p:PublicRelease=true
65-
66-
- name: Buidling template package
67-
run: dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages /p:PublicRelease=true
65+
dotnet pack src/bunit.template/ -c Release -o ${GITHUB_WORKSPACE}/packages /p:PublicRelease=true
6866
6967
- name: Verifying template
7068
run: |

0 commit comments

Comments
 (0)