- Tooling and automation: - update Dependabot and the frontend test workflow to read frontend-owned paths - keep published frontend test reports aligned with the renamed project directory - extend ignore rules for frontend-generated test output and local dependencies - Local developer entrypoints: - repoint the root Justfile ui module at frontend/Justfile - update the dev compose bind mount to use ./frontend - update the Weblate setup script to source translations from frontend/src/i18n - Build integration: - repoint the Docker frontend build stage to /workspace/frontend and the renamed source paths - update the backend Gradle fallback dist location to ../frontend/dist/grimmory/browser - Repository guidance: - rewrite root docs and AGENTS references that still pointed at booklore-ui so contributor guidance matches the new directory name - Validation: - not run; this commit is scoped to staged path rewrites only
162 lines
4.9 KiB
YAML
162 lines
4.9 KiB
YAML
name: Reusable - Test Suite
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
checkout_ref:
|
|
description: 'The ref to check out before running tests'
|
|
required: true
|
|
type: string
|
|
publish_test_results:
|
|
description: 'Whether to publish test results directly from this workflow'
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
save_gradle_cache:
|
|
description: 'Whether this run should persist the shared Gradle cache'
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
backend-tests:
|
|
name: Backend Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
checks: write
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ inputs.checkout_ref }}
|
|
|
|
- name: Install just
|
|
uses: taiki-e/install-action@0d865d5cc6d507df4765f1f866bfae8bab4e2a73 # v2.69.7
|
|
with:
|
|
tool: just
|
|
|
|
- name: Set Up JDK 25
|
|
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
|
with:
|
|
java-version: '25'
|
|
distribution: 'temurin'
|
|
|
|
- name: Restore Gradle Cache
|
|
id: restore_gradle_cache
|
|
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('booklore-api/**/*.gradle*', 'booklore-api/settings.gradle*', 'booklore-api/gradle.properties', 'booklore-api/gradle/wrapper/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
gradle-${{ runner.os }}-
|
|
|
|
- name: Execute Backend Tests
|
|
id: backend_tests
|
|
run: |
|
|
echo "Running backend tests..."
|
|
just api test
|
|
continue-on-error: true
|
|
|
|
- name: Publish Backend Test Results
|
|
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
|
|
if: ${{ always() && inputs.publish_test_results }}
|
|
with:
|
|
files: booklore-api/build/test-results/**/*.xml
|
|
check_name: Backend Test Results
|
|
|
|
- name: Upload Backend Test Reports
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
if: always()
|
|
with:
|
|
name: backend-test-reports
|
|
path: |
|
|
booklore-api/build/reports/tests/
|
|
booklore-api/build/test-results/
|
|
retention-days: 30
|
|
|
|
- name: Save Gradle Cache
|
|
if: ${{ always() && inputs.save_gradle_cache }}
|
|
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ steps.restore_gradle_cache.outputs.cache-primary-key }}
|
|
|
|
- name: Validate Backend Test Results
|
|
if: steps.backend_tests.outcome == 'failure'
|
|
run: |
|
|
echo "❌ Backend tests failed"
|
|
exit 1
|
|
|
|
frontend-tests:
|
|
name: Frontend Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
checks: write
|
|
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ inputs.checkout_ref }}
|
|
|
|
- name: Install just
|
|
uses: taiki-e/install-action@0d865d5cc6d507df4765f1f866bfae8bab4e2a73 # v2.69.7
|
|
with:
|
|
tool: just
|
|
|
|
- name: Set Up Node.js
|
|
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
|
|
with:
|
|
node-version: '24'
|
|
cache: 'npm'
|
|
cache-dependency-path: booklore-ui/package-lock.json
|
|
|
|
- name: Install Frontend Dependencies
|
|
run: just ui install-ci
|
|
|
|
- name: Audit Frontend Dependencies
|
|
run: just ui audit-ci
|
|
|
|
- name: Validate Dependency Tree
|
|
run: just ui deps
|
|
|
|
- name: Execute Frontend Tests
|
|
id: frontend_tests
|
|
run: |
|
|
echo "Running frontend tests..."
|
|
just ui test
|
|
continue-on-error: true
|
|
|
|
- name: Publish Frontend Test Results
|
|
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2
|
|
if: ${{ always() && inputs.publish_test_results }}
|
|
with:
|
|
files: frontend/test-results/vitest-results.xml
|
|
check_name: Frontend Test Results
|
|
|
|
- name: Upload Frontend Test Reports
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
if: always()
|
|
with:
|
|
name: frontend-test-reports
|
|
path: |
|
|
frontend/test-results/vitest-results.xml
|
|
retention-days: 30
|
|
|
|
- name: Validate Frontend Test Results
|
|
if: steps.frontend_tests.outcome == 'failure'
|
|
run: |
|
|
echo "❌ Frontend tests failed"
|
|
exit 1
|