Skip to content

build(deps): bump dotnet/sdk from 8.0 to 10.0 in /backend #139

build(deps): bump dotnet/sdk from 8.0 to 10.0 in /backend

build(deps): bump dotnet/sdk from 8.0 to 10.0 in /backend #139

Workflow file for this run

name: CI/CD Pipeline - Finance System
on:
push:
branches: [ "main", "master", "develop" ]
pull_request:
branches: [ "main", "master" ]
env:
DOTNET_VERSION: '8.0.x'
NODE_VERSION: '18.x'
jobs:
# Backend CI Job
backend-build:
name: πŸ”§ Backend Build & Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: πŸ› οΈ Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: πŸ“¦ Cache .NET packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: πŸ”„ Restore dependencies
run: dotnet restore
- name: πŸ—οΈ Build backend
run: dotnet build --no-restore --configuration Release
- name: πŸ§ͺ Run backend tests
run: dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage"
- name: πŸ“Š Upload coverage reports
uses: codecov/codecov-action@v3
with:
directory: ./backend/TestResults
fail_ci_if_error: false
# Frontend CI Job
frontend-build:
name: 🎨 Frontend Build & Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend/project
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: πŸ› οΈ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: ./frontend/project/package-lock.json
- name: πŸ“¦ Install dependencies
run: npm ci
- name: πŸ” Lint frontend
run: npm run lint --if-present
- name: πŸ§ͺ Run frontend tests
run: npm test --if-present
- name: πŸ—οΈ Build frontend
run: npm run build
- name: πŸ“€ Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: frontend-build
path: ./frontend/project/dist
# Docker Build & Security
docker-build:
name: 🐳 Docker Build & Security
runs-on: ubuntu-latest
needs: [backend-build, frontend-build]
if: github.event_name == 'push'
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: πŸ› οΈ Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: πŸ—οΈ Build backend Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: false
tags: finace-system-backend:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: πŸ—οΈ Build frontend Docker image
uses: docker/build-push-action@v5
with:
context: ./frontend/project
file: ./frontend/project/Dockerfile
push: false
tags: finace-system-frontend:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: πŸ” Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'finace-system-backend:latest'
format: 'sarif'
output: 'trivy-results.sarif'
- name: πŸ“Š Upload Trivy scan results
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'
# Integration Tests with Docker Compose
integration-tests:
name: πŸ§ͺ Integration Tests
runs-on: ubuntu-latest
needs: [backend-build, frontend-build]
steps:
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
- name: 🐳 Start services with Docker Compose
run: |
docker-compose up -d --build
sleep 30 # Wait for services to be ready
- name: 🩺 Health check backend
run: |
curl -f http://localhost:8080/swagger || exit 1
echo "βœ… Backend is healthy"
- name: 🩺 Health check frontend
run: |
curl -f http://localhost:3000 || exit 1
echo "βœ… Frontend is healthy"
- name: πŸ” Test API endpoints
run: |
# Test basic API endpoints
curl -f http://localhost:8080/swagger/v1/swagger.json || exit 1
echo "βœ… Swagger API documentation accessible"
- name: πŸ“‹ Show container logs
if: failure()
run: |
echo "=== Backend Logs ==="
docker-compose logs backend
echo "=== Frontend Logs ==="
docker-compose logs frontend
echo "=== MySQL Logs ==="
docker-compose logs mysql
- name: πŸ›‘ Stop services
if: always()
run: docker-compose down
# Notify Success
notify-success:
name: πŸŽ‰ Deployment Ready
runs-on: ubuntu-latest
needs: [backend-build, frontend-build, docker-build, integration-tests]
if: success() && github.ref == 'refs/heads/master'
steps:
- name: 🎊 Success notification
run: |
echo "πŸš€ All tests passed! System is ready for deployment."
echo "βœ… Backend: Built and tested"
echo "βœ… Frontend: Built and tested"
echo "βœ… Docker: Images built successfully"
echo "βœ… Integration: All services healthy"