From 2d4e71929565d6fcf5234f5b06db8e8e3fdad5a3 Mon Sep 17 00:00:00 2001 From: Kaan Date: Sun, 1 Jun 2025 20:29:32 +0200 Subject: [PATCH] Added basic Actions workflow for linting, analyzing code and building --- .gitea/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..bc4de7b --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -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 \ No newline at end of file