Fakultas Ilmu Komputer UI

Skip to content
Snippets Groups Projects
Commit 0e85c402 authored by Daya Adianto's avatar Daya Adianto
Browse files

Merge branch 'chore/12-prepare-workshop' into 'main'

Prepare the codebase for a workshop

See merge request !9
parents 738fc6be 31fc8292
No related branches found
No related tags found
1 merge request!9Prepare the codebase for a workshop
Pipeline #184038 passed with warnings with stages
in 12 minutes and 44 seconds
......@@ -125,7 +125,6 @@ bdd-test:
TRACE: "false"
rules: !reference [.upstream-deploy-production-rules, rules]
needs:
- job: build
- job: deploy
optional: true
before_script:
......@@ -155,4 +154,21 @@ visualize-coverage:
coverage_format: cobertura
path: target/cobertura.xml
sonarqube-check:
stage: report
image: docker.io/library/maven:3.8.6-eclipse-temurin-17-focal
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
GIT_DEPTH: "0"
rules: !reference [.upstream-deploy-production-rules, rules]
script:
- mvn -P sonar sonar:sonar
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
dependencies:
- build
- test
# TODO: Configure 'spotbugs-sast' job (part of SAST job template) so it analyses the compiled Java artifacts
......@@ -10,7 +10,7 @@
</parent>
<groupId>com.example</groupId>
<artifactId>sitodo</artifactId>
<version>0.1.1-SNAPSHOT</version>
<version>0.1.2-SNAPSHOT</version>
<name>sitodo-pmpl</name>
<description>A basic todo app for teaching basic Web programming, Git workflows, and CI/CD. Heavily inspired by the
running example in &quot;Test-Driven Development with Python&quot; book by Harry Percival.
......@@ -22,6 +22,9 @@
<selenium.version>4.12.1</selenium.version>
<surefire.version>3.1.2</surefire.version>
<failsafe.version>3.1.2</failsafe.version>
<sonar-maven-plugin.version>3.9.1.2184</sonar-maven-plugin.version>
<maven-pmd-plugin.version>3.21.0</maven-pmd-plugin.version>
<maven-jxr-plugin.version>3.3.0</maven-jxr-plugin.version>
</properties>
<dependencies>
......@@ -197,9 +200,50 @@
</excludes>
</configuration>
</plugin>
<!-- Use PMD to analyse the source code -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven-pmd-plugin.version}</version>
<configuration>
<failOnViolation>false</failOnViolation>
<printFailingErrors>true</printFailingErrors>
<linkXRef>true</linkXRef>
<inputEncoding>utf-8</inputEncoding>
<targetJdk>17</targetJdk>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java</compileSourceRoot>
</compileSourceRoots>
<testSourceRoots>
<testSourceRoot>${project.basedir}/src/test/java</testSourceRoot>
</testSourceRoots>
<rulesets>
<ruleset>/category/java/bestpractices.xml</ruleset>
<ruleset>/category/java/design.xml</ruleset>
</rulesets>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<!-- Required by the PMD plugin -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>${maven-jxr-plugin.version}</version>
</plugin>
</plugins>
</reporting>
<profiles>
<profile>
<id>bdd</id>
......@@ -240,9 +284,6 @@
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.version}</version>
<configuration>
<tags>${tags}</tags>
</configuration>
<executions>
<execution>
<id>serenity-reports</id>
......@@ -256,5 +297,29 @@
</plugins>
</build>
</profile>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<sonar.host.url>https://sonarqube.cs.ui.ac.id</sonar.host.url>
<sonar.projectKey>pmpl_examples_sitodo-pmpl_AYtLlyeZ94kwVhMRxVyD</sonar.projectKey>
<sonar.qualitygate.wait>true</sonar.qualitygate.wait>
<sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/*.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.junit.reportPaths>target/surefire-reports/*.xml</sonar.junit.reportPaths>
<sonar.java.pmd.reportPaths>target/pmd.xml</sonar.java.pmd.reportPaths>
<skipTests>true</skipTests>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment