Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
64 changes: 64 additions & 0 deletions .github/workflows/basic-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Basic Workflow + SonarCloud Analysis

on:
push:
branches:
- 'feature/*'
- 'fix/*'
paths-ignore:
- '*.md'
- '.github/workflows/**'
- 'docs/**'
workflow_dispatch:

jobs:
build-and-analyze:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

# Frontend steps

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install client dependencies
working-directory: frontend
run: npm ci

- name: Build client
working-directory: frontend
run: npm run build

- name: Run Client Unit Tests with Coverage
working-directory: frontend
run: npm run test:coverage

# Backend steps

- name: Set up JDK 25
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '25'
cache: 'maven'

- name: Compile Backend & Run Unit Tests with JaCoCo
working-directory: backend/pcmod
run: ./mvnw clean test jacoco:report -Dgroups="server-unit"

# SonarCloud Analysis
- name: SonarCloud Analysis
uses: sonarsource/sonarcloud-github-action@v3.1.0
with:
projectBaseDir: .
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107 changes: 107 additions & 0 deletions .github/workflows/complete-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Complete Workflow

on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
paths-ignore:
- '*.md'
- '.github/workflows/**'
- 'docs/**'
workflow_dispatch:

jobs:
server-tests:
name: Backend Tests (JUnit, Testcontainers, Rest Assured)
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend/pcmod

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
cache: 'maven'

- name: Server Unit Tests (Services + Mocks)
run: ./mvnw test -Dgroups="server-unit"

- name: Server Integration Tests (Services + Testcontainers)
run: ./mvnw test -Dgroups="server-integration"

- name: Server System Tests (API REST with Rest Assured)
run: ./mvnw test -Dgroups="server-system"

client-tests:
name: Frontend Unit Tests (Virtual DOM / Vitest)
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm ci

- name: Client Unit Tests (Components + Virtual DOM)
run: npm run test:unit

client-server-integration-tests:
name: E2E & Integration (Chrome + Selenium)
runs-on: ubuntu-latest
needs: [server-tests, client-tests]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
cache: 'maven'

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Set up Chrome for Selenium
uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable

- name: Prepare and Launch Full Environment
env:
HEADLESS_TESTS: "true"
NODE_TLS_REJECT_UNAUTHORIZED: "0"
run: |
cd frontend
npm run dev &

cd ../backend/pcmod
./mvnw spring-boot:run &

npx wait-on http-get://localhost:5173 https-get://localhost:8443/

./mvnw test -Dgroups="client-server-integration,client-system"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
frontend/.DS_Store
frontend/**/.DS_Store
/frontend/node_modules/
/frontend/coverage/

# React Router (frontend)
/frontend/.react-router/
Expand Down
Empty file modified backend/pcmod/mvnw
100644 → 100755
Empty file.
168 changes: 87 additions & 81 deletions backend/pcmod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,32 @@
</dependencyManagement>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.14</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
<configuration>
<argLine>@{argLine}</argLine>
<excludedGroups>server-integration, server-system, client-server-integration,
client-system</excludedGroups>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.4</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
Expand All @@ -152,78 +163,6 @@
<configuration>
<jmxPort>9009</jmxPort>
</configuration>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<apiDocsUrl>https://127.0.0.1:8443/v3/api-docs.yaml</apiDocsUrl>
<outputFileName>api-docs.yaml</outputFileName>
<outputDir>${project.basedir}/docs/api</outputDir>
</configuration>
</plugin>

<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.17.0</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatorName>html2</generatorName>
<inputSpec>${project.basedir}/docs/api/api-docs.yaml</inputSpec>
<output>${project.basedir}/docs/api/</output>
<skipValidateSpec>true</skipValidateSpec>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>copy-file</id>
<phase>integration-test</phase>
<goals>
<goal>rename</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/docs/api/index.html</sourceFile>
<destinationFile>${project.basedir}/docs/api/api-docs.html</destinationFile>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
Expand All @@ -248,6 +187,73 @@
</plugin>

</plugins>

</build>

<profiles>
<profile>
<id>generate-docs</id>
<build>
<plugins>
<plugin>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<apiDocsUrl>https://127.0.0.1:8443/v3/api-docs.yaml</apiDocsUrl>
<outputFileName>api-docs.yaml</outputFileName>
<outputDir>${project.basedir}/docs/api</outputDir>
</configuration>
</plugin>

<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.17.0</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatorName>html2</generatorName>
<inputSpec>${project.basedir}/docs/api/api-docs.yaml</inputSpec>
<output>${project.basedir}/docs/api/</output>
<skipValidateSpec>true</skipValidateSpec>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>copy-file</id>
<phase>integration-test</phase>
<goals>
<goal>rename</goal>
</goals>
<configuration>
<sourceFile>${project.basedir}/docs/api/index.html</sourceFile>
<destinationFile>${project.basedir}/docs/api/api-docs.html</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading
Loading