From 82e0f4a1a9775780a5c32f4be56cb8a7de8900d7 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Tue, 1 Mar 2022 13:17:25 +0000 Subject: [PATCH 1/6] Run sonarqube as part of nightly build --- .github/workflows/nightly.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0a12587e84..0b0ab9f922 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,7 +14,6 @@ env: -Porg.gradle.jvmargs=-Xmx4g -Porg.gradle.parallel=false -PallWarningsAsErrors=false - jobs: # Build Android Tests [Matrix SDK] build-android-test-matrix-sdk: @@ -263,8 +262,6 @@ jobs: # No concurrency required, runs every time on a schedule. steps: - uses: actions/checkout@v2 - with: - ref: develop - name: Set up Python 3.8 uses: actions/setup-python@v3 with: @@ -311,12 +308,39 @@ jobs: emulator.log failure_screenshots/ + sonarqube: + runs-on: macos-latest + if: always() + needs: + - integration-tests + - ui-tests +# - unit-tests TODO: code coverage from here too + - build-android-test-matrix-sdk + - build-android-test-app + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - run: ./gradlew sonarqube $CI_GRADLE_ARG_PROPERTIES + env: + - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # Notify the channel about scheduled runs, do not notify for manually triggered runs notify: runs-on: ubuntu-latest needs: - integration-tests - ui-tests +# - unit-tests + - build-android-test-matrix-sdk + - build-android-test-app + - sonarqube if: always() && github.event_name != 'workflow_dispatch' # No concurrency required, runs every time on a schedule. steps: From 5ea917f74b1dfddbec6f7f89ed4f46d21ce7c22c Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Tue, 1 Mar 2022 14:37:36 +0000 Subject: [PATCH 2/6] jobs.step.env is a map not a list --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0b0ab9f922..5b61b6b3f4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -329,7 +329,7 @@ jobs: ${{ runner.os }}-gradle- - run: ./gradlew sonarqube $CI_GRADLE_ARG_PROPERTIES env: - - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Notify the channel about scheduled runs, do not notify for manually triggered runs notify: From fd065dbbb90a387d122a4f6ce28903e35817166e Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Tue, 1 Mar 2022 14:47:41 +0000 Subject: [PATCH 3/6] Update build.gradle Note password secret name. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 9cae9e7e70..0a41ac3625 100644 --- a/build.gradle +++ b/build.gradle @@ -109,7 +109,7 @@ apply plugin: 'org.sonarqube' // To run a sonar analysis: // Run './gradlew sonarqube -Dsonar.login=' -// The SONAR_KEY is stored in passbolt +// The SONAR_KEY is stored in passbolt as Token Sonar Cloud Bma sonarqube { properties { From 0ce787f20be7dda81dff55c8c86f4f71735e0896 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Wed, 2 Mar 2022 10:31:07 +0000 Subject: [PATCH 4/6] Ensure we run on java 11 on macos --- .github/workflows/nightly.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5b61b6b3f4..aaef180de6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -319,6 +319,10 @@ jobs: - build-android-test-app steps: - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' - uses: actions/cache@v2 with: path: | From 33648683654f731bd373282249b5958c5c13c340 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Thu, 3 Mar 2022 15:05:39 +0000 Subject: [PATCH 5/6] Use environment variable that is tied to project property --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index aaef180de6..1536f57be5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -333,7 +333,7 @@ jobs: ${{ runner.os }}-gradle- - run: ./gradlew sonarqube $CI_GRADLE_ARG_PROPERTIES env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + ORG_GRADLE_PROJECT_SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Notify the channel about scheduled runs, do not notify for manually triggered runs notify: From 105f3dd93d1a389bd42e029eceb6d44fb011f4c2 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Thu, 3 Mar 2022 16:34:26 +0000 Subject: [PATCH 6/6] Correct name of environment variable --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1536f57be5..ebad9b7bc7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -333,7 +333,7 @@ jobs: ${{ runner.os }}-gradle- - run: ./gradlew sonarqube $CI_GRADLE_ARG_PROPERTIES env: - ORG_GRADLE_PROJECT_SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + ORG_GRADLE_PROJECT_SONAR_LOGIN: ${{ secrets.SONAR_TOKEN }} # Notify the channel about scheduled runs, do not notify for manually triggered runs notify: