Skip to content

Commit

Permalink
Merge pull request #122 from bmazzarol/chore/ci
Browse files Browse the repository at this point in the history
feat: upgrade to dotnet 8
  • Loading branch information
bmazzarol authored Dec 16, 2023
2 parents f314b99 + c95197c commit 3bbcd40
Show file tree
Hide file tree
Showing 24 changed files with 198 additions and 442 deletions.
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
- package-ecosystem: "nuget"
directory: "/"
- package-ecosystem: nuget
directory: /
schedule:
interval: "monthly"
interval: monthly
25 changes: 5 additions & 20 deletions .github/workflows/build-deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,16 @@

on:
push:
branches: [ "main" ]
branches: [ main ]

jobs:
build:
build-and-deploy-docs:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
- uses: bmazzarol/bmazzarol/.github/actions/build-deploy-docs@main
with:
dotnet-version: |
6.0.x
7.0.x
- name: Build
run: dotnet build --configuration Release src/Docs/HttpBuildR.Docs/HttpBuildR.Docs.csproj
- name: Upload Site
uses: actions/upload-pages-artifact@v1
with:
path: src/Docs/HttpBuildR.Docs/_site
- name: Publish Site
uses: actions/upload-pages-artifact@v1
with:
path: src/Docs/HttpBuildR.Docs/_site
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2
docsProjectPath: src/Docs/HttpBuildR.Docs
csProjFileName: HttpBuildR.Docs.csproj
17 changes: 5 additions & 12 deletions .github/workflows/cd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Release Version'
description: Release Version
required: true
release:
types: [ published ]

env:
PACKAGE_VERSION: ${{ github.event.inputs.version || github.event.release.tag_name }}

Expand All @@ -17,14 +17,7 @@ jobs:
name: Publish to Nuget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
- uses: bmazzarol/bmazzarol/.github/actions/cd-build@main
with:
dotnet-version: |
6.0.x
7.0.x
- name: Release Build
run: dotnet pack --configuration Release -p:ContinuousIntegrationBuild=true -p:PackageVersion=${{ env.PACKAGE_VERSION }}
- name: Push to Nuget
run: dotnet nuget push **\*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
version: ${{ env.PACKAGE_VERSION }}
nugetKey: ${{ secrets.NUGET_API_KEY }}
18 changes: 3 additions & 15 deletions .github/workflows/check-code-format.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
name: "Check C# Formatting"
name: Check C# Formatting

on:
pull_request:
branches: [ 'main' ]
branches: [ main ]

jobs:
check_formatting:
runs-on: ubuntu-latest
name: Check C# Formatting
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Install dotnet Tooling
run: dotnet tool restore
- name: Check format
run: dotnet csharpier . --check
- uses: bmazzarol/bmazzarol/.github/actions/check-code-format@main
9 changes: 3 additions & 6 deletions .github/workflows/check-commit-message.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: "Check Commit Message"
name: Check Commit Message

on:
pull_request:
branches: [ 'main' ]
branches: [ main ]

jobs:
commitlint:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v5
- uses: bmazzarol/bmazzarol/.github/actions/check-commit-message@main
19 changes: 7 additions & 12 deletions .github/workflows/check-markdown.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
name: "Check Markdown"
name: Check Markdown

on:
push:
branches: [ 'main' ]
branches: [ main ]
paths:
- "**/*.md"
- ".github/workflows/check-markdown.yml"
- .github/workflows/check-markdown.yml
pull_request:
branches: [ 'main' ]
branches: [ main ]

jobs:
lint:
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
- uses: bmazzarol/bmazzarol/.github/actions/check-markdown@main
with:
node-version: 16.x
- name: Run Markdownlint
run: |
npm i
npx markdownlint-cli2 "HttpBuildR*/**/*.md" "*.md" "!LICENSE.md"
targetMdFiles: |
"HttpBuildR*/**/*.md" "*.md" "!LICENSE.md"
81 changes: 11 additions & 70 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,22 @@
name: CI Build

on:
push:
branches: [ "main" ]
branches: [ main ]
pull_request:
branches: [ "main" ]
branches: [ main ]

jobs:
build:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Build and analyze
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
- uses: bmazzarol/bmazzarol/.github/actions/ci-build@main
with:
dotnet-version: |
6.0.x
7.0.x
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v3
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: pwsh
run: |
New-Item -Path ./.sonar/scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
dotnet tool install JetBrains.dotCover.GlobalTool
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: pwsh
run: |
./.sonar/scanner/dotnet-sonarscanner begin `
/k:"bmazzarol_Http-BuildR" `
/o:"bmazzarol" `
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.host.url="https://sonarcloud.io" `
/d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html `
/d:sonar.cs.vstest.reportsPaths=**/test-results.trx
dotnet dotcover test `
--dcReportType=HTML `
--dcAttributeFilters=System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute `
--verbosity normal `
--logger "trx;LogFileName=test-results.trx"
./.sonar/scanner/dotnet-sonarscanner end `
/d:sonar.token="${{ secrets.SONAR_TOKEN }}"
- name: Upload Test Results
uses: actions/upload-artifact@v2
if: ${{ always() && github.event_name == 'pull_request' }}
with:
name: test-results
path: '**/test-results.trx'
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ always() && github.event_name == 'pull_request' }}
with:
files: |
**/test-results.trx
githubToken: ${{ secrets.GITHUB_TOKEN }}
sonarToken: ${{ secrets.SONAR_TOKEN }}
sonarProjectKey: bmazzarol_Http-BuildR
78 changes: 0 additions & 78 deletions .github/workflows/codeql.yml

This file was deleted.

13 changes: 7 additions & 6 deletions .github/workflows/test-reporter.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name: "Test Reporter"
name: Test Reporter

on:
workflow_run:
workflows: [ 'CI Build' ]
types: [ 'completed' ]
workflows: [ CI Build ]
types: [ completed ]

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: 'test-results'
name: 'Test Results'
path: '**/test-results.trx'
artifact: test-results
name: Test Results
path: |
**/*.trx
reporter: dotnet-trx
Loading

0 comments on commit 3bbcd40

Please sign in to comment.