Include additional test coverage #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
pull_request: | |
branches: [ main, dev ] | |
jobs: | |
build_and_pack: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup .NET 8 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore Dependencies | |
run: dotnet restore | |
- name: Test And Collect CodeCov | |
run: | | |
dotnet tool install --global dotnet-coverage | |
dotnet-coverage collect "dotnet test --no-restore -c Release" -f xml | |
- name: Generate report | |
uses: danielpalme/ReportGenerator-GitHub-Action@5.3.11 | |
with: | |
reports: './output.xml' | |
targetdir: './tests/TestResults' | |
reporttypes: 'lcov' | |
filefilters: '-*\*.g.cs' | |
- name: Coveralls | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
path-to-lcov: ./tests/TestResults/lcov.info | |
- name: Pack NuGet Packages | |
# run: dotnet pack --configuration Release --no-build --output ./packages --version 0.0.1-dev.$GITHUB_RUN_ID | |
run: dotnet pack --configuration Release --no-build --output ./packages /p:Version=0.0.1-dev | |
- name: Upload NuGet Packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nuget-packages | |
path: ./packages | |
test_linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet: | |
- '6.0' | |
- '7.0' | |
- '8.0' | |
- '9.0' | |
env: | |
ContinuousIntegrationBuild: true | |
LATEST_DOTNET_VERSION: '9.0' | |
needs: build_and_pack | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ matrix.dotnet }} | |
- name: Download NuGet Packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: nuget-packages | |
path: ./packages | |
- name: Create local package feed | |
run: dotnet nuget add source ${{ github.workspace }}/packages --name localNuGet | |
- name: Print NuGet Sources | |
run: dotnet nuget list source | |
- name: Restore dependencies | |
run: dotnet restore /p:MockMeNugetPackageVersion="0.0.1-dev" | |
- name: Build | |
run: dotnet build ./tests/MockMe.Tests.slnf --no-restore -c Release /p:MockMeNugetPackageVersion="0.0.1-dev" | |
- name: Test | |
run: dotnet test ./tests/MockMe.Tests.slnf --no-build -c Release --verbosity normal | |
# test-windows: | |
# runs-on: windows-latest | |
# strategy: | |
# matrix: | |
# dotnet: | |
# - '6.0' | |
# - '7.0' | |
# - '8.0' | |
# - '9.0' | |
# needs: build_and_pack | |
# steps: | |
# - name: Checkout Code | |
# uses: actions/checkout@v4 | |
# - name: Setup .NET ${{ matrix.dotnet }} | |
# uses: actions/setup-dotnet@v3 | |
# with: | |
# dotnet-version: ${{ matrix.dotnet }} | |
# - name: Download NuGet Packages | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: nuget-packages | |
# path: ./packages | |
# - name: Create local package feed | |
# run: dotnet nuget add source ${{ github.workspace }}/packages --name localNuGet | |
# - name: Print NuGet Sources | |
# run: dotnet nuget list source | |
# - name: Restore dependencies | |
# run: dotnet restore /p:MockMeNugetPackageVersion="0.0.1-dev" | |
# - name: Build | |
# run: dotnet build ./tests/MockMe.Tests.slnf --no-restore -c Release /p:MockMeNugetPackageVersion="0.0.1-dev" | |
# - name: Test | |
# run: dotnet test ./tests/MockMe.Tests.slnf --no-build -c Release --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=openCover |