From 6ee9525285bf07a242193da9423e96e5d16f53f5 Mon Sep 17 00:00:00 2001 From: zufar-sunagatov Date: Fri, 20 Oct 2023 14:53:24 +0100 Subject: [PATCH 1/3] added a space for test pipeline --- .github/workflows/ci-cd-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd-pipeline.yaml b/.github/workflows/ci-cd-pipeline.yaml index 152440ed..9af5d132 100644 --- a/.github/workflows/ci-cd-pipeline.yaml +++ b/.github/workflows/ci-cd-pipeline.yaml @@ -28,7 +28,7 @@ jobs: cache: 'maven' - name: Build with Maven - run: mvn -B package --file pom.xml + run: mvn -B package -Pdev --file pom.xml - name: Run unit tests run: mvn test From 3bd33a8a4cf44eca6513591efa74f6bd68af1ce2 Mon Sep 17 00:00:00 2001 From: zufar-sunagatov Date: Fri, 20 Oct 2023 16:12:03 +0100 Subject: [PATCH 2/3] added a space for test pipeline --- .github/workflows/ci-cd-pipeline.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-pipeline.yaml b/.github/workflows/ci-cd-pipeline.yaml index 9af5d132..e9f1b45a 100644 --- a/.github/workflows/ci-cd-pipeline.yaml +++ b/.github/workflows/ci-cd-pipeline.yaml @@ -27,8 +27,10 @@ jobs: distribution: 'temurin' cache: 'maven' + - name: Run unit tests + run: mvn test -Pdev --file pom.xml + - name: Build with Maven run: mvn -B package -Pdev --file pom.xml - - name: Run unit tests - run: mvn test + From 0a56e4a9a0a04788f8a70edf75caa5cdd67217bc Mon Sep 17 00:00:00 2001 From: zufar-sunagatov Date: Fri, 20 Oct 2023 16:20:33 +0100 Subject: [PATCH 3/3] added a space for test pipeline --- .github/workflows/ci-cd-pipeline.yaml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd-pipeline.yaml b/.github/workflows/ci-cd-pipeline.yaml index e9f1b45a..e4c633c0 100644 --- a/.github/workflows/ci-cd-pipeline.yaml +++ b/.github/workflows/ci-cd-pipeline.yaml @@ -27,10 +27,24 @@ jobs: distribution: 'temurin' cache: 'maven' - - name: Run unit tests - run: mvn test -Pdev --file pom.xml - - name: Build with Maven run: mvn -B package -Pdev --file pom.xml + # Static code analysis with SonarScanner + + - name: Install SonarScanner + run: | + wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.7.0.2747-linux.zip + unzip sonar-scanner-cli-4.7.0.2747-linux.zip + export SONAR_SCANNER_HOME=`pwd`/sonar-scanner-4.7.0.2747-linux + export PATH=$SONAR_SCANNER_HOME/bin:$PATH + + - name: Run SonarScanner + run: | + sonar-scanner \ + -Dsonar.projectKey=your-project-key \ + -Dsonar.sources=. \ + -Dsonar.host.url=https://sonarcloud.io \ + -Dsonar.login=your-sonarcloud-token +