Skip to content
Closed
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
39 changes: 22 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [main, develop]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
changes:
name: Detect changes
Expand All @@ -16,8 +20,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect file changes
uses: dorny/paths-filter@v3
Expand Down Expand Up @@ -49,6 +51,13 @@ jobs:
with:
dotnet-version: '8.0.x'

- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('src/backend/**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-

- name: Restore dependencies
run: dotnet restore

Expand All @@ -58,15 +67,6 @@ jobs:
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal --filter "Category!=Email"

backend-skip:
name: Backend (.NET) (pull_request)
needs: changes
if: ${{ needs.changes.outputs.backend == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Skip
run: echo "No backend changes detected - skipping build"

frontend:
name: Frontend (React)
needs: changes
Expand Down Expand Up @@ -102,11 +102,16 @@ jobs:
- name: Test
run: npm run test -- --passWithNoTests

frontend-skip:
name: Frontend (React) (pull_request)
needs: changes
if: ${{ needs.changes.outputs.frontend == 'false' }}
ci-success:
name: CI Success
needs: [changes, backend, frontend]
if: always()
runs-on: ubuntu-latest
steps:
- name: Skip
run: echo "No frontend changes detected - skipping build"
- name: Check results
run: |
if [[ "${{ needs.backend.result }}" == "failure" || "${{ needs.frontend.result }}" == "failure" ]]; then
echo "One or more jobs failed"
exit 1
fi
echo "CI passed successfully"