Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 14 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,61 +25,24 @@ jobs:
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: xC0dex/setup-dotnet@feat/dotnet-runtime-support
with:
dotnet-version: 10.x
dotnet-runtime: |
6.0.0
7.x
8.x
9.x

- name: List SDKs and Runtimes
run: |
dotnet --list-sdks
dotnet --list-runtimes

- name: Restore dependencies
run: dotnet restore

- name: Build solution
run: dotnet build -c Release --no-restore

- name: Test solution
run: dotnet test -c Release --no-build --results-directory "test-results" --collect "XPlat Code Coverage;Format=opencover"

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: test-results

# - name: Upload results to Codecov
# uses: codecov/codecov-action@v4
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

analyze:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
needs:
- build-test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4

- name: Install sonar scanner
run: dotnet tool install -g dotnet-sonarscanner

- name: Restore dependencies
run: dotnet restore

- name: Download coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
path: test-results

- name: Analyze solution
run: |
dotnet sonarscanner begin /k:"${{ env.PROJECT_KEY }}" /o:"${{ env.ORGANIZATION }}" /d:sonar.token="${{ env.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.scanner.scanAll=true /d:sonar.cs.opencover.reportsPaths="**/test-results/**/coverage.opencover.xml"
dotnet build -c Release --no-restore --no-incremental
dotnet sonarscanner end /d:sonar.token="${{ env.SONAR_TOKEN }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
PROJECT_KEY: xC0dex_APIWeaver
ORGANIZATION: apiweaver