From e567db6c65a2bee741a8c104d8d4318fbd8ee764 Mon Sep 17 00:00:00 2001 From: Jonathan Le Brun <42697488+icyfry@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:55:38 +0200 Subject: [PATCH] sonar configuration --- .github/workflows/deploy-prod.yml | 12 +++++++++--- .github/workflows/deploy-staging.yml | 10 ++++++++-- sonar-project.properties | 7 +++++++ 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 sonar-project.properties diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 7eea0a9..8282b15 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -6,7 +6,7 @@ on: - master jobs: - s3-deploy: + build-deploy: runs-on: ubuntu-latest environment: prod steps: @@ -32,6 +32,12 @@ jobs: - name: Building the project run: pnpm run build:prod - + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Deploy static site to S3 bucket - run: aws s3 sync ./dist/ ${{ secrets.AWS_S3 }} --delete \ No newline at end of file + run: aws s3 sync ./dist/ ${{ secrets.AWS_S3 }} --delete diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index fb218bb..fd6148e 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -6,7 +6,7 @@ on: - develop jobs: - s3-deploy: + build-deploy: runs-on: ubuntu-latest steps: @@ -31,6 +31,12 @@ jobs: - name: Building the project run: pnpm run build:staging + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - name: Deploy static site to S3 bucket - run: aws s3 sync ./dist/ s3://icyfry-website/staging --delete \ No newline at end of file + run: aws s3 sync ./dist/ s3://icyfry-website/staging --delete diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..b33dbe6 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.projectKey=icyfry_icyfry-website +sonar.organization=icyfry +sonar.sources=src +sonar.tests=src/tests +sonar.javascript.lcov.reportPaths=coverage/lcov.info +sonar.coverage.exclusions=**/*.test.* +sonar.exclusions=src/tests/*,dapp/src/abi/*