mateusz-opoka/KustoWrapper-Schema-AttributeMappings

View on GitHub
.github/workflows/main.yml

Summary

Maintainability
Test Coverage
name: build
on:
  push:
    branches:
      - master
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: '8.0.x'
    - name: Build with dotnet
      run: |
        cd src
        dotnet build --configuration Release
    - name: Run unit tests
      run: |
        cd src/KustoWrapper.Schema.AttributeMappings.Tests
        dotnet test --no-build --configuration Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
    - name: Publish coverage report to codecov.io
      uses: codecov/codecov-action@v3
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        files: src/KustoWrapper.Schema.AttributeMappings.Tests/coverage.opencover.xml
        flags: unittests
    - name: Generate NuGet package
      run: |
        cd src/KustoWrapper.Schema.AttributeMappings
        dotnet pack --nologo --no-build --configuration Release -o out
        dotnet nuget push out/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_APIKEY }} --skip-duplicate