Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
72eb17f
Sonar in code
latinyloco Nov 10, 2025
3521ca2
Pom Sonar plugin
latinyloco Nov 10, 2025
d83559e
CI with correct commands
latinyloco Nov 10, 2025
9478107
CI with correct commands v2
latinyloco Nov 10, 2025
fd940a8
CI without selenium in sonnar
latinyloco Nov 10, 2025
0b486d0
Sonar in any brach
latinyloco Nov 10, 2025
a9006a1
Pom and CI with Sonar
latinyloco Nov 10, 2025
ae27d41
CI Sonar without spaces
latinyloco Nov 10, 2025
84369c3
CI without selenium in sonnar and spaces
latinyloco Nov 10, 2025
4a22146
CI for connect sonar
latinyloco Nov 10, 2025
96091d7
Sonar initial without Selenium
latinyloco Nov 10, 2025
cbd3883
Sonar Connect Dev Test
latinyloco Nov 10, 2025
7bd32a5
Sonar Connect Dev Test without secret key
latinyloco Nov 11, 2025
0e141a8
Add CD into ci-yml
latinyloco Nov 11, 2025
d75ba92
Add rigth path to docker deploy
latinyloco Nov 11, 2025
74f7388
Add rigth path to Dockerfile
latinyloco Nov 11, 2025
d6fb938
Add test frontend CI/CD
latinyloco Nov 12, 2025
6ffe3ed
Add individual job for test frontend CI/CD
latinyloco Nov 12, 2025
0884312
Set order to the selenium test
latinyloco Nov 12, 2025
ccccc81
Refine test frontend job in CI/CD
latinyloco Nov 12, 2025
a26b21f
New frontend proxy for selenium test
latinyloco Nov 12, 2025
65fbc0e
Debug backend fail selenium test
latinyloco Nov 12, 2025
c286405
Revert properties-test changes
latinyloco Nov 12, 2025
f953f77
Update frontend test cicd
latinyloco Nov 12, 2025
770a446
Change selenium-test profile only execute selenium test
latinyloco Nov 14, 2025
19d5c42
Do not execute schedulingin salenium test
latinyloco Nov 14, 2025
fc1b2bb
Logs to Selenium test
latinyloco Nov 14, 2025
f473661
Logs Selenium test in testLoginValid
latinyloco Nov 14, 2025
0a560e4
Logs Selenium test in testLoginValid Fix
latinyloco Nov 14, 2025
bf1afdd
Logs Selenium test login request in testLoginValid Fix
latinyloco Nov 14, 2025
8533623
Wait to start backend
latinyloco Nov 14, 2025
9415a74
Last try frontend test selenium cicd
latinyloco Nov 14, 2025
e83fde6
Add time to Angular Start
latinyloco Nov 14, 2025
aedc5f8
Add more time to Angular Start
latinyloco Nov 14, 2025
042a755
Add working-directory to frontend job
latinyloco Nov 14, 2025
d9f4c4c
Try without proxy config test
latinyloco Nov 14, 2025
51c6160
CICD Without selenium test
latinyloco Nov 14, 2025
313619c
CICD Without selenium test without frontend depends
latinyloco Nov 14, 2025
4e2de68
Delete console outputs and narrow queries
latinyloco Nov 22, 2025
1f21693
Correct Test Failures from testRunTickets
latinyloco Nov 22, 2025
408ffba
Jacoco for Sonar
latinyloco Nov 29, 2025
fe6a696
Fix cicd
latinyloco Nov 29, 2025
c9ddcdd
Update ci_cd
latinyloco Nov 29, 2025
10178ea
New update CICD
latinyloco Nov 29, 2025
d4e980d
SonarCloud Coverage for pull request
latinyloco Nov 29, 2025
9ce1da8
Update cicd for sonar pull request
latinyloco Nov 29, 2025
1d1d760
Run test for SonarCloud Jococo
latinyloco Nov 29, 2025
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
49 changes: 0 additions & 49 deletions .github/workflows/ci.yml

This file was deleted.

234 changes: 234 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
name: CI/CD - Test, Sonar & Docker

on:
push:
branches: [ "dev", "main" ]
pull_request:
branches: [ "main" ]


jobs:

#TEST - BACKEND
backend-tests:
name: Backend Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven

- name: Run backend tests (excluding Selenium)
working-directory: backend
run: mvn -B verify -Dgroups=!selenium


#TEST - FRONTEND
#frontend-tests:
# name: Frontend Tests
#runs-on: ubuntu-22.04
# needs: backend-tests

# steps:
# - uses: actions/checkout@v4

# --- Java ---
# - name: Set up Java 18
# uses: actions/setup-java@v4
# with:
# distribution: temurin
# java-version: 18

# --- Chromium ---
# - name: Install Chromium (prevent auto-updates)
#run: |
# sudo apt-get update
# sudo apt-get install -y chromium-browser
# sudo apt-mark hold chromium-browser
# sudo apt-mark hold google-chrome-stable

# --- Docker: MySQL ---
# - name: Set up Docker MySQL container
#run: |
# sudo docker run -d \
# --name lookau-mysql-ci \
# -p 3306:3306 \
# -e MYSQL_DATABASE=lookau_test \
# -e MYSQL_ROOT_PASSWORD=password \
# mysql:8.3.0

# --- Dockerize para esperar DB ---
# - name: Install Dockerize
# run: curl -sSL https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz | sudo tar -C /usr/local/bin -xzv

#- name: Wait for MySQL to start
#run: dockerize -wait tcp://localhost:3306 -timeout 1m

# --- Environment variables ---
#- name: Set environment variables
#run: |
#echo "GMAIL_USERNAME=${{ secrets.GMAIL_USERNAME }}" >> $GITHUB_ENV
#echo "GMAIL_PASSWORD=${{ secrets.GMAIL_PASSWORD }}" >> $GITHUB_ENV

# --- env.properties ---
#- name: Create env.properties file
#run: |
#echo "GMAIL_USERNAME=${{ secrets.GMAIL_USERNAME }}" > backend/src/main/resources/env.properties
#echo "GMAIL_PASSWORD=${{ secrets.GMAIL_PASSWORD }}" >> backend/src/main/resources/env.properties

# --- Line endings fix ---
#- name: Convert line endings to Unix format
#run: sed -i 's/\r$//' backend/mvnw

# --- Make mvnw executable ---
#- name: Make mvnw executable
#run: chmod +x backend/mvnw

# --- Build backend ---
#- name: Build with Maven
#run: backend/mvnw -B package --file backend/pom.xml -DskipTests

# --- Run backend ---
#- name: Run backend
#run: |
#nohup backend/mvnw spring-boot:run --file backend/pom.xml &
#sleep 120

# --- Node.js ---
#- name: Set up Node.js
#uses: actions/setup-node@v4
#with:
#node-version: 18

# --- Angular CLI ---
#- name: Install Angular CLI
#run: npm install -g @angular/cli
#working-directory: frontend

#- name: Do not share Angular CLI telemetry
#run: ng analytics off
#working-directory: frontend

#- name: Install frontend dependencies
#run: npm install
#working-directory: frontend

# --- Run Angular app ---
#- name: Run Angular application
#run: |
#nohup ng serve &
#sleep 120
#working-directory: frontend

#- name: Show frontend logs
#run: cat frontend/frontend.log || true

# --- Selenium tests ---
#- name: Run Selenium tests
#run: backend/mvnw test -P selenium-tests --file backend/pom.xml


#SONAR
sonar-analysis:
name: SonarCloud Analysis
runs-on: ubuntu-latest
needs: backend-tests
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven

- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Run backend tests
working-directory: backend
run: mvn clean verify -Dgroups=!selenium


- name: Run Sonar on PR
if: github.event_name == 'pull_request'
working-directory: backend
run: |
mvn sonar:sonar \
-Dsonar.projectKey=codeurjc-students_2025-LookAu \
-Dsonar.organization=codeurjc-students \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml \
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
-Dsonar.pullrequest.branch=${{ github.head_ref }} \
-Dsonar.pullrequest.base=${{ github.base_ref }}

- name: Run Sonar on branch
if: github.event_name != 'pull_request'
working-directory: backend
run: |
mvn sonar:sonar \
-Dsonar.projectKey=codeurjc-students_2025-LookAu \
-Dsonar.organization=codeurjc-students \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
-Dsonar.branch.name=${GITHUB_REF_NAME##*/} \
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml





#DOCKER DEPLOY
publish-docker:
name: Publish Docker
runs-on: ubuntu-latest
needs: sonar-analysis
if: github.event_name == 'pull_request' && github.base_ref == 'main'
steps:
- uses: actions/checkout@v4

- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker image
working-directory: ./docker
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/lookau:${{ github.sha }} -f Dockerfile ..

- name: Tag as PR build
run: docker tag ${{ secrets.DOCKERHUB_USERNAME }}/lookau:${{ github.sha }} ${{ secrets.DOCKERHUB_USERNAME }}/lookau:pr-${{ github.event.pull_request.number }}

- name: Push Docker image to DockerHub
run: |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/lookau:${{ github.sha }}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/lookau:pr-${{ github.event.pull_request.number }}
36 changes: 36 additions & 0 deletions .github/workflows/sonar-initial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Sonar Initial Analysis

on:
push:
branches: [ "main" ]

jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven

- name: SonarCloud Scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
working-directory: backend
run: >
mvn -B verify -Dgroups=!selenium org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-Dsonar.projectKey=codeurjc-students_2025-LookAu
-Dsonar.organization=codeurjc-students
-Dsonar.host.url=https://sonarcloud.io
53 changes: 52 additions & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,40 @@
<artifactId>lookau</artifactId>
<version>1.0.0-SNAPSHOT</version>

<profiles>
<profile>
<id>selenium-tests</id>
<properties>
<spring.profiles.active>test</spring.profiles.active>
<groups>selenium</groups> <!-- @Tag("selenium") -->
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<groups>${groups}</groups>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>


<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.0</version>
<relativePath /> <!-- lookup parent from repository -->
<relativePath />
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<sonar.organization>codeurjc-students</sonar.organization>
</properties>

<dependencies>
Expand Down Expand Up @@ -214,6 +238,33 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
</plugin>

<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>4.0.0.4121</version>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

Expand Down
Loading