Added basic Actions workflow for linting, analyzing code and building
All checks were successful
Code Quality / Lint, Analyze & Build (push) Successful in 2m15s
All checks were successful
Code Quality / Lint, Analyze & Build (push) Successful in 2m15s
This commit is contained in:
38
.gitea/workflows/ci.yml
Normal file
38
.gitea/workflows/ci.yml
Normal file
@ -0,0 +1,38 @@
|
||||
name: Code Quality
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
quality-check:
|
||||
name: Lint, Analyze & Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '9.0.300'
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
|
||||
- name: Check code formatting
|
||||
run: dotnet format --verify-no-changes --verbosity minimal
|
||||
|
||||
- name: Build with static analysis
|
||||
run: dotnet build --configuration Release --no-restore /p:TreatWarningsAsErrors=true
|
||||
|
||||
- name: Run tests (if any exist)
|
||||
run: |
|
||||
if find . -name "*Test*.csproj" | grep -q .; then
|
||||
dotnet test --configuration Release --no-build --verbosity minimal
|
||||
else
|
||||
echo "No test projects found, skipping tests"
|
||||
fi
|
||||
Reference in New Issue
Block a user