From 9dbc2d6f4d092931d7090abaeb5b3f5dad188666 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 29 May 2024 11:27:17 +0200 Subject: [PATCH] WIP --- .github/workflows/build-and-test.yml | 39 +++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6e16afaaa94..1613b9fdd0f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,6 +1,11 @@ name: Build and test run-name: Building and testing branch ${{ github.ref }} -on: [pull_request] +on: + pull_request: + push: + branches: + - develop + - master_* jobs: build-frontend: name: Build Frontend @@ -18,8 +23,8 @@ jobs: - run: npm install -g npm@7.17.0 - run: npm install working-directory: ui/ui-frontend-common - - run: npm run prettier:ci - working-directory: ui/ui-frontend-common +# - run: npm run prettier:ci +# working-directory: ui/ui-frontend-common - run: npm run build:prod working-directory: ui/ui-frontend-common - run: npm run packagr:tar @@ -28,8 +33,8 @@ jobs: working-directory: ui/ui-frontend-common - run: npm install ui-frontend-common --legacy-peer-deps --loglevel warn working-directory: ui/ui-frontend - - run: npm run prettier:ci - working-directory: ui/ui-frontend +# - run: npm run prettier:ci +# working-directory: ui/ui-frontend - run: npm run build:vitamui-library working-directory: ui/ui-frontend - run: npm run copy-scss:vitamui-library @@ -67,7 +72,23 @@ jobs: - uses: szenius/set-timezone@v2.0 with: timezoneLinux: "Europe/Paris" - - run: mvn --settings .ci/settings.xml -Pvitam,no-cve-proxy --batch-mode --errors -U --projects '!cots/vitamui-mongo-express' --projects '!ui' --projects '!ui/ui-archive-search' --projects '!ui/ui-collect' --projects '!ui/ui-commons' --projects '!ui/ui-frontend' --projects '!ui/ui-frontend-common' --projects '!ui/ui-identity' --projects '!ui/ui-ingest' --projects '!ui/ui-pastis' --projects '!ui/ui-portal' --projects '!ui/ui-referential' verify + - run: mvn --settings .ci/settings.xml + -Pvitam,no-cve-proxy + -Dspotless.check.skip=true + --batch-mode --errors -U + --projects '!cots/vitamui-mongo-express' + --projects '!ui' + --projects '!ui/ui-archive-search' + --projects '!ui/ui-collect' + --projects '!ui/ui-commons' + --projects '!ui/ui-frontend' + --projects '!ui/ui-frontend-common' + --projects '!ui/ui-identity' + --projects '!ui/ui-ingest' + --projects '!ui/ui-pastis' + --projects '!ui/ui-portal' + --projects '!ui/ui-referential' + verify env: SERVICE_NEXUS_URL: ${{ secrets.SERVICE_NEXUS_URL }} CI_USR: ${{ secrets.CI_USR }} @@ -94,10 +115,14 @@ jobs: **/target/classes/**/* **/target/test-classes/**/* sonarcloud: + name: Run SonarCloud analysis needs: [build-frontend, build-backend] + if: ${{ github.event_name == 'push' && github.ref_protected }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Download frontend test reports uses: actions/download-artifact@v4 with: @@ -110,7 +135,7 @@ jobs: uses: actions/download-artifact@v4 with: name: backend-generated-classes - - name: Use SonarCloud scanner + - name: SonarCloud Scan uses: sonarsource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}