Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: sarmkadan
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -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.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -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.
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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)
139 changes: 14 additions & 125 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
Loading