Skip to content

The project architecture has been updated #2

The project architecture has been updated

The project architecture has been updated #2

Workflow file for this run

# Continuous Integration workflow
# This workflow runs on push to main and pull requests
# It builds, tests, and creates NuGet packages
name: CI
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
CONFIGURATION: Release
MINVERBUILDMETADATA: build.${{ github.run_id }}.${{ github.run_attempt }}
permissions:
contents: read
packages: write
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration ${{ env.CONFIGURATION }} --no-restore
- name: Test
run: dotnet test --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
directory: ./coverage
fail_ci_if_error: false
verbose: true
continue-on-error: true
- name: Pack
run: dotnet pack --configuration ${{ env.CONFIGURATION }} --no-build --output ./artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ./artifacts/*.nupkg
retention-days: 7
publish:
name: Publish NuGet
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: nuget-packages
path: ./artifacts
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Push to NuGet
run: dotnet nuget push "./artifacts/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Push symbol packages
run: dotnet nuget push "./artifacts/*.snupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
continue-on-error: true