Feature/implement data related logic for ranges #9
Workflow file for this run
This file contains hidden or 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: CI/CD - Intervals.NET | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| paths: | |
| - 'src/Intervals.NET/**' | |
| - 'tests/Intervals.NET.Tests/**' | |
| - '.github/workflows/intervals-net.yml' | |
| pull_request: | |
| branches: [ master, main ] | |
| paths: | |
| - 'src/Intervals.NET/**' | |
| - 'tests/Intervals.NET.Tests/**' | |
| workflow_dispatch: | |
| env: | |
| DOTNET_VERSION: '8.x.x' | |
| PROJECT_PATH: 'src/Intervals.NET/Intervals.NET.csproj' | |
| TEST_PATH: 'tests/Intervals.NET.Tests/Intervals.NET.Tests.csproj' | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-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 ${{ env.TEST_PATH }} | |
| - name: Build test project and dependencies | |
| run: dotnet build ${{ env.TEST_PATH }} --configuration Release --no-restore | |
| - name: Run Intervals.NET tests with coverage | |
| run: dotnet test ${{ env.TEST_PATH }} --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./TestResults/**/coverage.cobertura.xml | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| publish-nuget: | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| 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 ${{ env.PROJECT_PATH }} | |
| - name: Build Intervals.NET | |
| run: dotnet build ${{ env.PROJECT_PATH }} --configuration Release --no-restore | |
| - name: Pack Intervals.NET | |
| run: dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --no-build --output ./artifacts | |
| - name: Publish Intervals.NET to NuGet | |
| run: dotnet nuget push ./artifacts/Intervals.NET.*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| - name: Upload package artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: intervals-net-package | |
| path: ./artifacts/*.nupkg |