Skip to content

Commit

Permalink
Merge pull request #860 from pascalgrimaud/ci-sonar-analysis-for-gene…
Browse files Browse the repository at this point in the history
…rated-projects

Ci sonar analysis for generated projects
  • Loading branch information
pascalgrimaud authored Feb 25, 2022
2 parents c790e18 + 308e169 commit 5c9308a
Show file tree
Hide file tree
Showing 22 changed files with 179 additions and 127 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@ jobs:
strategy:
matrix:
app:
- full-default
- tomcat-mysql-ehcachexml
- undertow-simplecache
- tomcat-configserver
- undertow-consul
- tomcat-eureka
- tomcat-mongodb
- fullapp
- mysqlapp
- flywayapp
- undertowapp
- eurekaapp
- consulapp
- mongodbapp
- angularapp
- reactapp
- vueapp
Expand Down Expand Up @@ -141,11 +140,21 @@ jobs:
key: ${{ runner.os }}-maven-${{ matrix.app }}-${{ steps.cache_md5sum.outputs.md5sum_pom_xml }}
restore-keys: |
${{ runner.os }}-maven-
- name: 'Test: starting Sonar'
working-directory: /tmp/jhlite/${{ matrix.app }}/
run: |
docker-compose -f src/main/docker/sonar.yml up -d
sleep 30
docker ps -a
- name: 'Test: verify ${{ matrix.app }}'
working-directory: /tmp/jhlite/${{ matrix.app }}/
run: |
chmod +x mvnw
./mvnw clean verify
./mvnw clean verify sonar:sonar
- name: 'Test: check local Sonar Analysis'
run: |
sleep 15
./tests-ci/sonar.sh ${{ matrix.app }}
#--------------------------------------------------
# Send analysis to Codecov
#--------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static Path getPathOf(String... paths) {
public static InputStream getInputStream(String... paths) {
InputStream in = FileUtils.class.getResourceAsStream(FILE_SEPARATOR + getPath(paths));
if (in == null) {
throw new GeneratorException("File not found in classpath");
throw new GeneratorException("File '" + getPath(paths) + "' not found in classpath");
}
return in;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ public void addAngularFiles(Project project) {
public void addImages(Project project) {
projectRepository.add(
project,
getPath(SOURCE_WEBAPP, "/content/images"),
getPath(SOURCE_WEBAPP, "content/images"),
"JHipster-Lite-neon-red.png",
"src/main/webapp/content/images"
);
projectRepository.add(project, getPath(SOURCE_WEBAPP, "/content/images"), "AngularLogo.svg", "src/main/webapp/content/images");
projectRepository.add(project, getPath(SOURCE_WEBAPP, "content/images"), "AngularLogo.svg", "src/main/webapp/content/images");
}

public void addJestSonar(Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<h1>{{=<% %>=}}{{ appName }}<%={{ }}=%>: Angular + TypeScript</h1>
<p>
Recommended IDE setup:
<a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
<a href="https://code.visualstudio.com/" target="_blank" rel="noopener">VSCode</a>
</p>

<p>
<a href="https://angular.io/tutorial" target="_blank">Angular Documentation</a>
<a href="https://angular.io/tutorial" target="_blank" rel="noopener">Angular Documentation</a>
|
<a href="https://angular.io/cli" target="_blank">Angular CLI Documentation</a>
<a href="https://angular.io/cli" target="_blank" rel="noopener">Angular CLI Documentation</a>
</p>

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<h1>{{=<% %>=}}{{ appName }}<%={{ }}=%>: Vue 3 + TypeScript + Vite</h1>
<p>
Recommended IDE setup:
<a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
<a href="https://code.visualstudio.com/" target="_blank" rel="noopener">VSCode</a>
+
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
<a href="https://github.com/johnsoncodehk/volar" target="_blank" rel="noopener">Volar</a>
</p>

<p>
<a href="https://vitejs.dev/guide/features.html" target="_blank">
<a href="https://vitejs.dev/guide/features.html" target="_blank" rel="noopener">
Vite Documentation
</a>
|
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a>
<a href="https://v3.vuejs.org/" target="_blank" rel="noopener">Vue 3 Documentation</a>
</p>

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.BatchSize;

import tech.jhipster.beer.user.domain.UserConstants;
import {{packageName}}.user.domain.UserConstants;

/**
* A user.
Expand Down
8 changes: 8 additions & 0 deletions tests-ci/config/consulapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folder": "/tmp/jhlite/consulapp",
"generator-jhipster": {
"projectName": "ConsulApp Project",
"baseName": "consulapp",
"packageName": "tech.jhipster.consulapp"
}
}
8 changes: 8 additions & 0 deletions tests-ci/config/eurekaapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folder": "/tmp/jhlite/eurekaapp",
"generator-jhipster": {
"projectName": "EurekaApp Project",
"baseName": "eurekaapp",
"packageName": "tech.jhipster.eurekaapp"
}
}
8 changes: 0 additions & 8 deletions tests-ci/config/full-default.json

This file was deleted.

8 changes: 8 additions & 0 deletions tests-ci/config/fullapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folder": "/tmp/jhlite/fullapp",
"generator-jhipster": {
"projectName": "Fullapp Project",
"baseName": "fullapp",
"packageName": "tech.jhipster.fullapp"
}
}
8 changes: 8 additions & 0 deletions tests-ci/config/fullstack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folder": "/tmp/jhlite/fullstack",
"generator-jhipster": {
"projectName": "Full Stack Project",
"baseName": "fullstack",
"packageName": "tech.jhipster.fullstack"
}
}
8 changes: 8 additions & 0 deletions tests-ci/config/mongodbapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folder": "/tmp/jhlite/mongodbapp",
"generator-jhipster": {
"projectName": "MongoDB App Project",
"baseName": "mongodbapp",
"packageName": "tech.jhipster.mongodbapp"
}
}
8 changes: 8 additions & 0 deletions tests-ci/config/mysqlapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folder": "/tmp/jhlite/mysqlapp",
"generator-jhipster": {
"projectName": "MySQL Project",
"baseName": "mysqlapp",
"packageName": "tech.jhipster.mysqlapp"
}
}
8 changes: 0 additions & 8 deletions tests-ci/config/tomcat-configserver.json

This file was deleted.

8 changes: 0 additions & 8 deletions tests-ci/config/tomcat-eureka.json

This file was deleted.

8 changes: 0 additions & 8 deletions tests-ci/config/tomcat-mongodb.json

This file was deleted.

8 changes: 0 additions & 8 deletions tests-ci/config/tomcat-mysql-ehcachexml.json

This file was deleted.

8 changes: 0 additions & 8 deletions tests-ci/config/undertow-consul.json

This file was deleted.

8 changes: 0 additions & 8 deletions tests-ci/config/undertow-simplecache.json

This file was deleted.

8 changes: 8 additions & 0 deletions tests-ci/config/undertowapp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folder": "/tmp/jhlite/undertowapp",
"generator-jhipster": {
"projectName": "UndertowApp Project",
"baseName": "undertowapp",
"packageName": "tech.jhipster.undertowapp"
}
}
Loading

0 comments on commit 5c9308a

Please sign in to comment.