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
68 changes: 63 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,35 @@ permissions:
contents: read

jobs:
# ------------------------------------------------------------------
# Changed-path detection
# ------------------------------------------------------------------
changes:
name: detect-changes
runs-on: ubuntu-latest
outputs:
web_client: ${{ steps.manual.outputs.web_client || steps.pr_changes.outputs.web_client }}
steps:
- name: Default changed paths for non-PR runs
id: manual
if: github.event_name != 'pull_request'
run: echo "web_client=true" >> "$GITHUB_OUTPUT"

- name: Checkout repository
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changed paths
id: pr_changes
if: github.event_name == 'pull_request'
uses: dorny/paths-filter@v3
with:
filters: |
web_client:
- 'web-client/**'

# ------------------------------------------------------------------
# Java / Spring Boot - organization-service
# ------------------------------------------------------------------
Expand Down Expand Up @@ -283,6 +312,8 @@ jobs:
# ------------------------------------------------------------------
web-client:
name: web-client (Node)
needs: changes
if: ${{ needs.changes.outputs.web_client == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
Expand All @@ -307,14 +338,25 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Typecheck (TypeScript)
run: pnpm typecheck

- name: Lint (ESLint)
run: pnpm run lint
run: pnpm lint

- name: Run tests (Vitest)
run: pnpm test
- name: Run tests with coverage (Vitest)
run: pnpm test:coverage

- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: web-client-coverage
path: web-client/coverage/
if-no-files-found: ignore

- name: Build (Vite)
run: pnpm run build
run: pnpm build

# ------------------------------------------------------------------
# Whole-system Docker build
Expand All @@ -323,6 +365,7 @@ jobs:
name: docker-build
runs-on: ubuntu-latest
timeout-minutes: 30
if: ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
needs:
- member-service
- organization-service
Expand Down Expand Up @@ -472,6 +515,7 @@ jobs:
runs-on: ubuntu-latest
if: always()
needs:
- changes
- member-service
- organization-service
- event-service
Expand All @@ -489,8 +533,22 @@ jobs:
run: |
results='${{ toJSON(needs) }}'
echo "Job results: $results"
if echo "$results" | grep -E '"result":\s*"(failure|cancelled|skipped)"' > /dev/null; then
if echo "$results" | jq -e '
to_entries[]
| select(.value.result == "failure" or .value.result == "cancelled")
' > /dev/null; then
echo "::error::One or more required jobs did not succeed."
exit 1
fi

# web-client and docker-build are allowed to be skipped together
# (docker-build cascades when web-client is skipped via path filter)
if echo "$results" | jq -e '
to_entries[]
| select(.value.result == "skipped" and (.key | IN("web-client", "docker-build") | not))
' > /dev/null; then
echo "::error::A required job was skipped unexpectedly."
exit 1
fi

echo "All required jobs passed."
1 change: 1 addition & 0 deletions web-client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lerna-debug.log*
node_modules
dist
dist-ssr
coverage
*.local
progress/

Expand Down
2 changes: 2 additions & 0 deletions web-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"verify": "npm run lint && npm run typecheck && npm run test && npm run build",
"preview": "vite preview",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:watch": "vitest"
},
"dependencies": {
Expand Down Expand Up @@ -55,6 +56,7 @@
"typescript": "~6.0.2",
"typescript-eslint": "^8.59.2",
"vite": "^8.0.12",
"@vitest/coverage-v8": "^2.1.9",
"vitest": "^2.1.9"
}
}
Loading
Loading