From 6005dd43ac83b3882f47f3f2209c58798ec0a0d3 Mon Sep 17 00:00:00 2001 From: Vladyslav Zaiets Date: Fri, 22 May 2026 04:49:55 +0000 Subject: [PATCH] Add CI/CD workflows, issue templates, and project configuration - Add GitHub Actions build and test workflow - Add bug report and feature request issue templates - Add pull request template - Add GitHub Sponsors funding configuration - Improve .gitignore for better development experience --- .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/bug_report.md | 29 +++++ .github/ISSUE_TEMPLATE/feature_request.md | 19 +++ .github/PULL_REQUEST_TEMPLATE.md | 24 ++++ .github/workflows/build.yml | 139 +++------------------- .github/workflows/publish.yml | 30 +++++ 6 files changed, 117 insertions(+), 125 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/publish.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..061422d --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: sarmkadan diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..e08d130 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug Report +about: Report a bug to help improve signalr-map-realtime +title: '[BUG] ' +labels: bug +assignees: '' +--- + +## Description +A clear and concise description of the bug. + +## Steps to Reproduce +1. Step one +2. Step two +3. Step three + +## Expected Behavior +What you expected to happen. + +## Actual Behavior +What actually happened. + +## Environment +- OS: [e.g., Windows 11, Ubuntu 22.04] +- .NET Version: [e.g., 8.0] +- Package Version: [e.g., 1.0.0] + +## Additional Context +Add any other context, logs, or screenshots. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..9cc6f80 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: Feature Request +about: Suggest a feature for signalr-map-realtime +title: '[FEATURE] ' +labels: enhancement +assignees: '' +--- + +## Problem Statement +A clear description of the problem or limitation. + +## Proposed Solution +Describe the solution you'd like to see. + +## Alternatives Considered +List any alternative solutions or workarounds you've considered. + +## Additional Context +Any other context, mockups, or examples. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..a970c97 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +## Summary +Brief description of what this PR does. + +## Changes +- Change 1 +- Change 2 + +## Type of Change +- [ ] Bug fix (non-breaking change that fixes an issue) +- [ ] New feature (non-breaking change that adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) +- [ ] Documentation update +- [ ] Refactoring / code cleanup + +## Testing +- [ ] Unit tests pass +- [ ] Integration tests pass (if applicable) +- [ ] Manual testing performed + +## Checklist +- [ ] Code follows the project style guidelines +- [ ] Self-review completed +- [ ] Documentation updated (if needed) +- [ ] No breaking changes (or documented in summary) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7bd1400..60013ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,27 +1,17 @@ -# ============================================================================= -# Author: Vladyslav Zaiets | https://sarmkadan.com -# CTO & Software Architect -# ============================================================================= - -name: Build and Test +name: Build & Test on: push: - branches: [ main, develop ] + branches: [ main, master, develop ] pull_request: - branches: [ main, develop ] - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + branches: [ main, master, develop ] jobs: build: runs-on: ubuntu-latest - strategy: matrix: - dotnet-version: ['10.0.x'] + dotnet-version: ['8.0.x'] steps: - uses: actions/checkout@v4 @@ -35,117 +25,16 @@ jobs: run: dotnet restore - name: Build - run: dotnet build --no-restore -c Release - - - name: Run tests - run: dotnet test --no-build --verbosity normal -c Release - - - name: Code analysis - run: dotnet build /p:EnforceCodeStyleInBuild=true - - - name: Publish - run: dotnet publish -c Release -o ./publish src/SignalRMapRealtime - - docker: - needs: build - runs-on: ubuntu-latest - - permissions: - contents: read - packages: write - - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - - steps: - - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=sha - type=raw,value=latest,enable={{is_default_branch}} - - - name: Build and push Docker image - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - security: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master - with: - scan-type: 'fs' - scan-ref: '.' - format: 'sarif' - output: 'trivy-results.sarif' - - - name: Upload Trivy results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: 'trivy-results.sarif' - - code-quality: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '10.0.x' - - - name: Install tools - run: dotnet tool install --global dotnet-format - - - name: Check code formatting - run: dotnet format --verify-no-changes --verbosity diagnostic - - coverage: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '10.0.x' - - - name: Restore dependencies - run: dotnet restore + run: dotnet build --no-restore --configuration Release - - name: Run tests with coverage - run: dotnet test --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverageFormat=cobertura + - name: Test + run: dotnet test --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx" + continue-on-error: false - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + - name: Upload test results + uses: actions/upload-artifact@v4 + if: always() with: - fail_ci_if_error: false - verbose: true + name: test-results-${{ matrix.dotnet-version }} + path: '**/TestResults/*.trx' + retention-days: 7 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a851add --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Publish NuGet + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.0.x' + + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Pack + run: dotnet pack --configuration Release --no-build --output ./nupkg + + - name: Push to NuGet + run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate