diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f7a3c311 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: Test .NET + +on: + push: + branches: + - master + paths-ignore: + - '*.md' + - 'Docs/**' + - 'Examples/**' + - '.gitignore' + pull_request: + branches: + - master + +env: + DOTNET_VERSION: '8.x' + BUILD_CONFIGURATION: 'Release' + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Restore dependencies + run: dotnet restore DnsClientX.sln + + - name: Build solution + run: dotnet build DnsClientX.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore + + - name: Run tests + run: dotnet test DnsClientX.Tests/DnsClientX.Tests.csproj --configuration ${{ env.BUILD_CONFIGURATION }} --framework net8.0 --no-build --verbosity normal --logger trx --collect:"XPlat Code Coverage" + + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-results-${{ matrix.os }} + path: '**/*.trx' + + - name: Upload coverage reports + uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-reports-${{ matrix.os }} + path: '**/coverage.cobertura.xml' + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: '**/coverage.cobertura.xml' + diff --git a/DnsClientX.Tests/DnsClientX.Tests.csproj b/DnsClientX.Tests/DnsClientX.Tests.csproj index 21e25f18..4b90aa65 100644 --- a/DnsClientX.Tests/DnsClientX.Tests.csproj +++ b/DnsClientX.Tests/DnsClientX.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/README.md b/README.md index 9123f61e..d776c2c5 100644 --- a/README.md +++ b/README.md @@ -61,12 +61,12 @@ This library supports multiple NET versions: - System.Text.Json ## Build Status +[![CI](https://github.com/EvotecIT/DnsClientX/actions/workflows/ci.yml/badge.svg)](https://github.com/EvotecIT/DnsClientX/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/EvotecIT/DnsClientX/branch/master/graph/badge.svg)](https://codecov.io/gh/EvotecIT/DnsClientX) + +Azure DevOps pipelines are kept for reference but remain disabled. + -| Platform | Status | Test Report | Code Coverage | .NET | -| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| Windows | | | | .NET 4.7.2, NET 4.8, .NET 6.0, .NET 7.0, .NET 8.0, .NET Standard 2.0 | -| Linux | | | | .NET 6.0, .NET 7.0, .NET Standard 2.0, .NET 8.0 | -| MacOs | | | | .NET 6.0, .NET 7.0, .NET Standard 2.0, .NET 8.0 | ## Features - [x] Supports multiple built-in DNS Providers (System, Cloudflare, Google, Quad9, OpenDNS, etc.) diff --git a/azure-pipelines-linux.yml b/azure-pipelines-linux.yml.disabled similarity index 100% rename from azure-pipelines-linux.yml rename to azure-pipelines-linux.yml.disabled diff --git a/azure-pipelines-macos.yml b/azure-pipelines-macos.yml.disabled similarity index 100% rename from azure-pipelines-macos.yml rename to azure-pipelines-macos.yml.disabled diff --git a/azure-pipelines.yml b/azure-pipelines.yml.disabled similarity index 100% rename from azure-pipelines.yml rename to azure-pipelines.yml.disabled