Skip to content

Commit

Permalink
Merge pull request #70 from ssylver93/feature/WFPREV-34_3
Browse files Browse the repository at this point in the history
Test with feature branch
  • Loading branch information
ssylver93 authored Sep 19, 2024
2 parents 2f68aa2 + bdfe2ef commit c214b9f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 110 deletions.
29 changes: 3 additions & 26 deletions .github/workflows/sonarscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,24 @@ on:
push:
branches: [ main, feature/* ]
pull_request_target:
branches: [ main, feature/* ]
branches: [ main, feature/* ]

jobs:
#test:
#name: Test - Unit and Integration
#runs-on: ubuntu-latest

#steps:
#- uses: actions/checkout@v4
#- name: Set up JDK 17
# uses: actions/setup-java@v4
# with:
#java-version: 17
#distribution: 'adopt'
#- name: Maven Package
# run: mvn -B clean package -DskipTests
#- name: Maven Verify
#run: mvn -B clean verify

sonar:
name: Test - SonarCloud Scan
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'adopt'
- name: Jacoco Scan
run: |
export MAVEN_OPTS="-Xmx10000m"
export NODE_OPTIONS="--max-old-space-size=4096"
mvn clean --settings server/wfprev-api/mvn_settings/settings.xml org.jacoco:jacoco-maven-plugin:0.8.12:prepare-agent -B verify org.jacoco:jacoco-maven-plugin:0.8.12:report -Drepo.login=${{ secrets.IDIR_AS_EMAIL }} -Drepo.password=${{ secrets.IDIR_PASSWORD }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: SonarCloud Scan
run: |
export MAVEN_OPTS="-Xmx10000m"
export NODE_OPTIONS="--max-old-space-size=4096"
mvn clean --settings server/wfprev-api/mvn_settings/settings.xml -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Pcoverage,sonar -Dsonar.projectKey=bcgov_nr-bcws-wfprev -Dsonar.login=${{ secrets.SONAR_TOKEN }} -Drepo.login=${{ secrets.IDIR_AS_EMAIL }} -Drepo.password=${{ secrets.IDIR_PASSWORD }}
mvn clean --settings server/wfprev-api/mvn_settings/settings.xml -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=bcgov_nr-bcws-wfprev -Drepo.login=${{ secrets.IDIR_AS_EMAIL }} -Drepo.password=${{ secrets.IDIR_PASSWORD }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
/target
/.vscode
101 changes: 21 additions & 80 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,91 +11,32 @@

<modules>
<module>server/wfprev-api</module>
<!-- <module>client</module> -->
<module>report-aggregate-module</module>
</modules>

<properties>
<sonar.version>3.10.0.2594</sonar.version>
<jacoco.version>0.8.11</jacoco.version>
<aggregate.report.dir>target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
<sonar.coverage.jacoco.xmlReportPaths>
${project.basedir}/report-aggregate/target/site/
jacoco-aggregate/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
</properties>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.9</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>coverage</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>sonar</id>
<properties>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>bcgov-sonarcloud</sonar.organization>
<sonar.projectKey>bcgov_nr-bcws-wfprev</sonar.projectKey>
<sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
<sonar.report>${aggregate.report.dir}</sonar.report>
</properties>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${argLine}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<executions>
<execution>
<id>sonar</id>
<phase>verify</phase>
<goals>
<goal>sonar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
</project>
1 change: 1 addition & 0 deletions report-aggregate-module/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
42 changes: 42 additions & 0 deletions report-aggregate-module/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ca.bc.gov.nrs.wfprev</groupId>
<artifactId>wfprev-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>ca.bc.gov.nrs</groupId>
<artifactId>generate-aggregate-report</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>WFPREV Aggregate Coverage Report</name>
<description>Aggregate Coverage Report</description>
<dependencies>
<dependency>
<groupId>ca.bc.gov.nrs</groupId>
<artifactId>wfprev-api</artifactId>
<version>${project.parent.version}</version>
<scope>system</scope>
<systemPath>${basedir}\..\server\wfprev-api\target\wfprev-api-${project.parent.version}.war</systemPath>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.9</version>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
4 changes: 1 addition & 3 deletions server/wfprev-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- lookup parent from repository -->
</parent>
<groupId>ca.bc.gov.nrs</groupId>
<artifactId>wfprev</artifactId>
<artifactId>wfprev-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>wfprev-api</name>
Expand All @@ -30,8 +30,6 @@
</scm>
<properties>
<java.version>17</java.version>
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/../${aggregate.report.dir}
</sonar.coverage.jacoco.xmlReportPaths>
</properties>
<dependencies>
<dependency>
Expand Down

0 comments on commit c214b9f

Please sign in to comment.