This repository was archived by the owner on Jul 6, 2026. It is now read-only.
Merging to develop #3
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| quality: | |
| name: Lint, Test, Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Frontend lint | |
| shell: bash | |
| run: | | |
| if [ -f frontend/package.json ]; then | |
| cd frontend | |
| npm ci | |
| if npm run | grep -q " lint"; then | |
| npm run lint | |
| else | |
| echo "No frontend lint script found. Skipping." | |
| fi | |
| else | |
| echo "No frontend/package.json found. Skipping frontend lint." | |
| fi | |
| - name: Backend lint | |
| shell: bash | |
| run: | | |
| if [ -n "$(find backend -name '*.sln' -o -name '*.csproj')" ]; then | |
| dotnet tool update -g dotnet-format || true | |
| export PATH="$PATH:$HOME/.dotnet/tools" | |
| dotnet format backend --verify-no-changes --verbosity minimal || true | |
| else | |
| echo "No .NET solution/project found in backend/. Skipping backend lint." | |
| fi | |
| - name: Frontend test | |
| shell: bash | |
| run: | | |
| if [ -f frontend/package.json ]; then | |
| cd frontend | |
| if npm run | grep -q " test"; then | |
| npm test -- --ci | |
| else | |
| echo "No frontend test script found. Skipping." | |
| fi | |
| else | |
| echo "No frontend/package.json found. Skipping frontend tests." | |
| fi | |
| - name: Backend test | |
| shell: bash | |
| run: | | |
| if [ -n "$(find backend -name '*.sln' -o -name '*.csproj')" ]; then | |
| dotnet test backend --configuration Release --verbosity normal | |
| else | |
| echo "No .NET solution/project found in backend/. Skipping backend tests." | |
| fi | |
| - name: Frontend build | |
| shell: bash | |
| run: | | |
| if [ -f frontend/package.json ]; then | |
| cd frontend | |
| if npm run | grep -q " build"; then | |
| npm run build | |
| else | |
| echo "No frontend build script found. Skipping." | |
| fi | |
| else | |
| echo "No frontend/package.json found. Skipping frontend build." | |
| fi | |
| - name: Backend build | |
| shell: bash | |
| run: | | |
| if [ -n "$(find backend -name '*.sln' -o -name '*.csproj')" ]; then | |
| dotnet build backend --configuration Release --no-restore | |
| else | |
| echo "No .NET solution/project found in backend/. Skipping backend build." | |
| fi | |
| security: | |
| name: Trivy Scan | |
| runs-on: ubuntu-latest | |
| needs: quality | |
| if: always() | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Run Trivy filesystem scan | |
| uses: aquasecurity/trivy-action@0.28.0 | |
| with: | |
| scan-type: fs | |
| scan-ref: . | |
| format: sarif | |
| output: trivy-results.sarif | |
| severity: CRITICAL,HIGH | |
| - name: Upload Trivy SARIF report | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: trivy-results.sarif | |
| notify: | |
| name: Discord Notify | |
| runs-on: ubuntu-latest | |
| needs: | |
| - quality | |
| - security | |
| if: always() | |
| steps: | |
| - name: Send Discord notification | |
| if: env.DISCORD_WEBHOOK_URL != '' | |
| env: | |
| DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| QUALITY_RESULT: ${{ needs.quality.result }} | |
| SECURITY_RESULT: ${{ needs.security.result }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| shell: bash | |
| run: | | |
| STATUS="success" | |
| if [ "$QUALITY_RESULT" != "success" ] || [ "$SECURITY_RESULT" != "success" ]; then | |
| STATUS="failed" | |
| fi | |
| PAYLOAD=$(cat <<EOF | |
| { | |
| "content": "CI run **$STATUS** for `${{ github.repository }}` on `${{ github.ref_name }}`.\\nQuality: **$QUALITY_RESULT** | Security: **$SECURITY_RESULT**\\n$RUN_URL" | |
| } | |
| EOF | |
| ) | |
| curl -sS -X POST "$DISCORD_WEBHOOK_URL" \ | |
| -H "Content-Type: application/json" \ | |
| -d "$PAYLOAD" | |
| - name: Skip notification | |
| if: env.DISCORD_WEBHOOK_URL == '' | |
| run: echo "DISCORD_WEBHOOK_URL secret is not configured. Skipping notification." |