Backend project initialized #4
49
.gitea/README.md
Normal file
49
.gitea/README.md
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# Gitea Actions for Vibing Project
|
||||||
|
|
||||||
|
This directory contains Gitea Actions workflows for the Vibing project (both frontend and backend).
|
||||||
|
|
||||||
|
## Workflows
|
||||||
|
|
||||||
|
### Backend CI (`backend-ci.yml`)
|
||||||
|
|
||||||
|
Runs Maven tests on the backend project.
|
||||||
|
|
||||||
|
**Triggers:**
|
||||||
|
- Push to `main` or `develop` branches
|
||||||
|
- Pull requests to `main` or `develop` branches
|
||||||
|
- Only when changes are made to files in the `backend/` directory
|
||||||
|
|
||||||
|
**What it does:**
|
||||||
|
1. Checks out the code
|
||||||
|
2. Sets up Java 21 (Temurin distribution)
|
||||||
|
3. Caches Maven dependencies for faster builds
|
||||||
|
4. Runs `mvn test` in the backend directory
|
||||||
|
5. Uploads test results as artifacts (retained for 7 days)
|
||||||
|
|
||||||
|
**Requirements:**
|
||||||
|
- Java 21
|
||||||
|
- Maven
|
||||||
|
- Ubuntu runner
|
||||||
|
|
||||||
|
### Frontend CI (`frontend-ci.yml`)
|
||||||
|
|
||||||
|
Runs linting and builds the frontend project.
|
||||||
|
|
||||||
|
**Triggers:**
|
||||||
|
- Push to `main` or `develop` branches
|
||||||
|
- Pull requests to `main` or `develop` branches
|
||||||
|
- Only when changes are made to files in the `frontend/` directory
|
||||||
|
|
||||||
|
**What it does:**
|
||||||
|
1. Checks out the code
|
||||||
|
2. Sets up Node.js 18
|
||||||
|
3. Caches npm dependencies for faster builds
|
||||||
|
4. Installs dependencies with `npm ci`
|
||||||
|
5. Runs ESLint for code quality checks
|
||||||
|
6. Builds the project with `npm run build`
|
||||||
|
7. Uploads build artifacts (retained for 7 days)
|
||||||
|
|
||||||
|
**Requirements:**
|
||||||
|
- Node.js 18
|
||||||
|
- npm
|
||||||
|
- Ubuntu runner
|
||||||
46
.gitea/workflows/backend-ci.yml
Normal file
46
.gitea/workflows/backend-ci.yml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Backend CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, develop ]
|
||||||
|
paths:
|
||||||
|
- 'backend/**'
|
||||||
|
pull_request:
|
||||||
|
branches: [ main, develop ]
|
||||||
|
paths:
|
||||||
|
- 'backend/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Run Maven Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: '21'
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: 'maven'
|
||||||
|
|
||||||
|
- name: Cache Maven packages
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.m2
|
||||||
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||||
|
restore-keys: ${{ runner.os }}-m2
|
||||||
|
|
||||||
|
- name: Run Maven tests
|
||||||
|
working-directory: ./backend
|
||||||
|
run: mvn test
|
||||||
|
|
||||||
|
- name: Upload test results
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: backend-test-results
|
||||||
|
path: backend/target/surefire-reports/
|
||||||
|
retention-days: 7
|
||||||
Reference in New Issue
Block a user