refactor jacoco configuration #3
Workflow file for this run
This file contains 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/CD Pipeline | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
backend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./api | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Run Tests & Generate Coverage Report | |
run: ./gradlew test | |
- name: Check Test Coverage | |
run: ./gradlew jacocoTestCoverageVerification | |
- name: Upload coverage reports | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: coverage-report | |
path: api/build/reports/jacoco/ | |
frontend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./client | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
cache-dependency-path: './client/package-lock.json' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build project | |
run: npm run build | |
project-check: | |
needs: [backend, frontend] | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Check build status | |
run: | | |
if [ "${{ needs.backend.result }}" != "success" ] || [ "${{ needs.frontend.result }}" != "success" ]; then | |
echo "❌ Project check failed" | |
exit 1 | |
fi | |
echo "✅ All checks passed successfully!" |