From 9cdf433cd97ff3e331c2b9619c6796410217bdd3 Mon Sep 17 00:00:00 2001 From: lwih Date: Wed, 3 Jan 2024 18:28:36 +0100 Subject: [PATCH] Sonar - backend tests through maven --- .github/workflows/sonarcloud.yml | 4 ++-- Makefile | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index aea60da4..ea6f4428 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -56,11 +56,11 @@ jobs: - name: Build and analyze with SonarCloud run: | - cd backend && ./mvnw clean install sonar:sonar \ + make back-check-sonar \ -Dsonar.projectKey=MTES-MCT_rapportnav2 \ -Dsonar.organization=mtes-mct \ -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.login=${{ secrets.SONAR_TOKEN }} + -Dsonar.token=${{ secrets.SONAR_TOKEN }} sonarcloudScan-frontend: name: SonarCloudScanFrontend diff --git a/Makefile b/Makefile index 4e74690e..f57a54bc 100644 --- a/Makefile +++ b/Makefile @@ -38,22 +38,19 @@ BACKEND_DIR := backend BACKEND_CONFIGURATION_FOLDER=$(shell pwd)/infra/configurations/backend/ -.PHONY: back-clean-install back-check-dependencies back-test back-verify-ci +.PHONY: back-clean-install back-check-dependencies back-test back-check-sonar back-clean-install: cd $(BACKEND_DIR) && ./mvnw clean install back-check-dependencies: cd $(BACKEND_DIR) && ./mvnw dependency-check:check +back-check-sonar: + cd $(BACKEND_DIR) && ./mvnw clean install sonar:sonar + back-test: cd $(BACKEND_DIR) && ./mvnw test -Pci -Dmaven.main.skip=true -back-verify-ci: - cd $(BACKEND_DIR) && ./mvnw clean verify -Pci - - - - .PHONY: check-clean-archi back-start-dev back-build-mvn