Skip to content

Commit 3bbcd40

Browse files
authored
Merge pull request #122 from bmazzarol/chore/ci
feat: upgrade to dotnet 8
2 parents f314b99 + c95197c commit 3bbcd40

24 files changed

Lines changed: 198 additions & 442 deletions

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "nuget"
4-
directory: "/"
3+
- package-ecosystem: nuget
4+
directory: /
55
schedule:
6-
interval: "monthly"
6+
interval: monthly

.github/workflows/build-deploy-docs.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,16 @@
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: [ main ]
66

77
jobs:
8-
build:
8+
build-and-deploy-docs:
99
runs-on: ubuntu-latest
1010
permissions:
1111
pages: write
1212
id-token: write
1313
steps:
14-
- uses: actions/checkout@v3
15-
- name: Setup .NET
16-
uses: actions/setup-dotnet@v3
14+
- uses: bmazzarol/bmazzarol/.github/actions/build-deploy-docs@main
1715
with:
18-
dotnet-version: |
19-
6.0.x
20-
7.0.x
21-
- name: Build
22-
run: dotnet build --configuration Release src/Docs/HttpBuildR.Docs/HttpBuildR.Docs.csproj
23-
- name: Upload Site
24-
uses: actions/upload-pages-artifact@v1
25-
with:
26-
path: src/Docs/HttpBuildR.Docs/_site
27-
- name: Publish Site
28-
uses: actions/upload-pages-artifact@v1
29-
with:
30-
path: src/Docs/HttpBuildR.Docs/_site
31-
- name: Deploy to GitHub Pages
32-
uses: actions/deploy-pages@v2
16+
docsProjectPath: src/Docs/HttpBuildR.Docs
17+
csProjFileName: HttpBuildR.Docs.csproj

.github/workflows/cd-build.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Release Version'
7+
description: Release Version
88
required: true
99
release:
1010
types: [ published ]
11-
11+
1212
env:
1313
PACKAGE_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}
1414

@@ -17,14 +17,7 @@ jobs:
1717
name: Publish to Nuget
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v3
21-
- name: Setup .NET
22-
uses: actions/setup-dotnet@v3
20+
- uses: bmazzarol/bmazzarol/.github/actions/cd-build@main
2321
with:
24-
dotnet-version: |
25-
6.0.x
26-
7.0.x
27-
- name: Release Build
28-
run: dotnet pack --configuration Release -p:ContinuousIntegrationBuild=true -p:PackageVersion=${{ env.PACKAGE_VERSION }}
29-
- name: Push to Nuget
30-
run: dotnet nuget push **\*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
22+
version: ${{ env.PACKAGE_VERSION }}
23+
nugetKey: ${{ secrets.NUGET_API_KEY }}
Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
name: "Check C# Formatting"
1+
name: Check C# Formatting
22

33
on:
44
pull_request:
5-
branches: [ 'main' ]
5+
branches: [ main ]
66

77
jobs:
88
check_formatting:
99
runs-on: ubuntu-latest
1010
name: Check C# Formatting
1111
steps:
12-
- uses: actions/checkout@v3
13-
with:
14-
fetch-depth: 0
15-
- name: Setup .NET
16-
uses: actions/setup-dotnet@v3
17-
with:
18-
dotnet-version: |
19-
6.0.x
20-
7.0.x
21-
- name: Install dotnet Tooling
22-
run: dotnet tool restore
23-
- name: Check format
24-
run: dotnet csharpier . --check
12+
- uses: bmazzarol/bmazzarol/.github/actions/check-code-format@main
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
name: "Check Commit Message"
1+
name: Check Commit Message
22

33
on:
44
pull_request:
5-
branches: [ 'main' ]
5+
branches: [ main ]
66

77
jobs:
88
commitlint:
99
if: ${{ github.actor != 'dependabot[bot]' }}
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
with:
14-
fetch-depth: 0
15-
- uses: wagoid/commitlint-github-action@v5
12+
- uses: bmazzarol/bmazzarol/.github/actions/check-commit-message@main
Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
name: "Check Markdown"
1+
name: Check Markdown
22

33
on:
44
push:
5-
branches: [ 'main' ]
5+
branches: [ main ]
66
paths:
77
- "**/*.md"
8-
- ".github/workflows/check-markdown.yml"
8+
- .github/workflows/check-markdown.yml
99
pull_request:
10-
branches: [ 'main' ]
10+
branches: [ main ]
1111

1212
jobs:
1313
lint:
1414
runs-on: ubuntu-latest
1515
permissions:
1616
statuses: write
1717
steps:
18-
- uses: actions/checkout@v3
19-
- name: Use Node.js
20-
uses: actions/setup-node@v3
18+
- uses: bmazzarol/bmazzarol/.github/actions/check-markdown@main
2119
with:
22-
node-version: 16.x
23-
- name: Run Markdownlint
24-
run: |
25-
npm i
26-
npx markdownlint-cli2 "HttpBuildR*/**/*.md" "*.md" "!LICENSE.md"
20+
targetMdFiles: |
21+
"HttpBuildR*/**/*.md" "*.md" "!LICENSE.md"

.github/workflows/ci-build.yml

Lines changed: 11 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,22 @@
11
name: CI Build
2+
23
on:
34
push:
4-
branches: [ "main" ]
5+
branches: [ main ]
56
pull_request:
6-
branches: [ "main" ]
7-
7+
branches: [ main ]
8+
89
jobs:
910
build:
1011
if: ${{ github.actor != 'dependabot[bot]' }}
1112
name: Build and analyze
1213
runs-on: ubuntu-latest
14+
permissions:
15+
checks: write
16+
pull-requests: write
1317
steps:
14-
- name: Setup .NET
15-
uses: actions/setup-dotnet@v3
18+
- uses: bmazzarol/bmazzarol/.github/actions/ci-build@main
1619
with:
17-
dotnet-version: |
18-
6.0.x
19-
7.0.x
20-
- name: Set up JDK 17
21-
uses: actions/setup-java@v3
22-
with:
23-
java-version: 17
24-
distribution: 'zulu'
25-
- uses: actions/checkout@v3
26-
with:
27-
fetch-depth: 0
28-
- name: Cache SonarCloud packages
29-
uses: actions/cache@v3
30-
with:
31-
path: ~\sonar\cache
32-
key: ${{ runner.os }}-sonar
33-
restore-keys: ${{ runner.os }}-sonar
34-
- name: Cache SonarCloud scanner
35-
id: cache-sonar-scanner
36-
uses: actions/cache@v3
37-
with:
38-
path: .\.sonar\scanner
39-
key: ${{ runner.os }}-sonar-scanner
40-
restore-keys: ${{ runner.os }}-sonar-scanner
41-
- name: Install SonarCloud scanner
42-
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
43-
shell: pwsh
44-
run: |
45-
New-Item -Path ./.sonar/scanner -ItemType Directory
46-
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
47-
dotnet tool install JetBrains.dotCover.GlobalTool
48-
- name: Build and analyze
49-
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
52-
shell: pwsh
53-
run: |
54-
./.sonar/scanner/dotnet-sonarscanner begin `
55-
/k:"bmazzarol_Http-BuildR" `
56-
/o:"bmazzarol" `
57-
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" `
58-
/d:sonar.host.url="https://sonarcloud.io" `
59-
/d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html `
60-
/d:sonar.cs.vstest.reportsPaths=**/test-results.trx
61-
62-
dotnet dotcover test `
63-
--dcReportType=HTML `
64-
--dcAttributeFilters=System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute `
65-
--verbosity normal `
66-
--logger "trx;LogFileName=test-results.trx"
67-
68-
./.sonar/scanner/dotnet-sonarscanner end `
69-
/d:sonar.token="${{ secrets.SONAR_TOKEN }}"
70-
- name: Upload Test Results
71-
uses: actions/upload-artifact@v2
72-
if: ${{ always() && github.event_name == 'pull_request' }}
73-
with:
74-
name: test-results
75-
path: '**/test-results.trx'
76-
- name: Publish Test Results
77-
uses: EnricoMi/publish-unit-test-result-action@v2
78-
if: ${{ always() && github.event_name == 'pull_request' }}
79-
with:
80-
files: |
81-
**/test-results.trx
20+
githubToken: ${{ secrets.GITHUB_TOKEN }}
21+
sonarToken: ${{ secrets.SONAR_TOKEN }}
22+
sonarProjectKey: bmazzarol_Http-BuildR

.github/workflows/codeql.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
name: "Test Reporter"
1+
name: Test Reporter
22

33
on:
44
workflow_run:
5-
workflows: [ 'CI Build' ]
6-
types: [ 'completed' ]
5+
workflows: [ CI Build ]
6+
types: [ completed ]
77

88
jobs:
99
report:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: dorny/test-reporter@v1
1313
with:
14-
artifact: 'test-results'
15-
name: 'Test Results'
16-
path: '**/test-results.trx'
14+
artifact: test-results
15+
name: Test Results
16+
path: |
17+
**/*.trx
1718
reporter: dotnet-trx

0 commit comments

Comments
 (0)