diff --git a/.github/workflows/maestro-local.yml b/.github/workflows/maestro-local.yml index c5587f40c1..391fe7daf6 100644 --- a/.github/workflows/maestro-local.yml +++ b/.github/workflows/maestro-local.yml @@ -1,149 +1,163 @@ -name: Maestro (local) +name: Maestro (local) [disabled] -# Run this flow only when APK Build workflow completes on: workflow_dispatch: - pull_request: permissions: {} -# Enrich gradle.properties for CI/CD -env: - GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -Dkotlin.daemon.jvm.options=-Xmx4g - CI_GRADLE_ARG_PROPERTIES: --stacktrace --no-daemon -Dsonar.gradle.skipCompile=true --no-configuration-cache - ARCH: x86_64 - DEVICE: pixel_7_pro - API_LEVEL: 33 - TARGET: google_apis - jobs: - build-apk: - name: Build APK + disabled: + name: Disabled in fork runs-on: ubuntu-latest - concurrency: - group: ${{ format('maestro-build-{0}', github.ref) }} - cancel-in-progress: true steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be - with: - # This might remove tools that are actually needed, if set to "true" but frees about 6 GB - tool-cache: true - # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) - android: false - dotnet: true - haskell: true - # This takes way too long to run (~2 minutes) and it saves only ~5.5GB - large-packages: false - docker-images: true - swap-storage: false + - run: echo "Maestro workflow is disabled in this fork." - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - # Ensure we are building the branch and not the branch after being merged on develop - # https://github.com/actions/checkout/issues/881 - ref: ${{ github.ref }} - persist-credentials: false - - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 - name: Use JDK 21 - with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '21' - - name: Configure gradle - uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 - with: - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - - name: Assemble debug APK - run: ./gradlew :app:assembleGplayDebug $CI_GRADLE_ARG_PROPERTIES - env: - ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }} - ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }} - ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }} - - name: Upload APK as artifact - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 - with: - name: elementx-apk-maestro - path: | - app/build/outputs/apk/gplay/debug/app-gplay-x86_64-debug.apk - retention-days: 5 - overwrite: true - if-no-files-found: error +# name: Maestro (local) - maestro-cloud: - name: Maestro test suite - runs-on: ubuntu-latest - needs: [ build-apk ] - # Allow only one to run at a time, since they use the same environment. - # Otherwise, tests running in parallel can break each other. - concurrency: - group: maestro-test - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' - with: - # Ensure we are building the branch and not the branch after being merged on develop - # https://github.com/actions/checkout/issues/881 - ref: ${{ github.ref }} - persist-credentials: false - - name: Download APK artifact from previous job - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: elementx-apk-maestro - - name: Enable KVM group perms - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm - - name: Install maestro - run: curl -fsSL "https://get.maestro.mobile.dev" | bash - - name: Run Maestro tests in emulator - id: maestro_test - uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0 - continue-on-error: true - env: - MAESTRO_USERNAME: maestroelement - MAESTRO_PASSWORD: ${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }} - MAESTRO_RECOVERY_KEY: ${{ secrets.MATRIX_MAESTRO_ACCOUNT_RECOVERY_KEY }} - MAESTRO_ROOM_NAME: MyRoom - MAESTRO_INVITEE1_MXID: "@maestroelement2:matrix.org" - MAESTRO_INVITEE2_MXID: "@maestroelement3:matrix.org" - MAESTRO_APP_ID: io.element.android.x.debug - with: - api-level: ${{ env.API_LEVEL }} - arch: ${{ env.ARCH }} - profile: ${{ env.DEVICE }} - target: ${{ env.TARGET }} - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - disk-size: 3G - script: | - .github/workflows/scripts/maestro/maestro-local-with-screen-recording.sh app-gplay-x86_64-debug.apk - - name: Upload test results - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 - with: - name: test-results - path: | - ~/.maestro/tests/** - retention-days: 5 - overwrite: true - if-no-files-found: error - - name: Update summary (success) - if: steps.maestro_test.outcome == 'success' - run: | - echo "### Maestro tests worked :rocket:!" >> $GITHUB_STEP_SUMMARY - - name: Update summary (failure) - if: steps.maestro_test.outcome != 'success' - run: | - LOG_FILE=$(find ~/.maestro/tests/ -name maestro.log) - echo "Log file: $LOG_FILE" - LOG_LINES="$(tail -n 30 $LOG_FILE)" - echo "### :x: Maestro tests failed... - - \`\`\` - $LOG_LINES - \`\`\`" >> $GITHUB_STEP_SUMMARY - - name: Fail the workflow in case of error in test - if: steps.maestro_test.outcome != 'success' - run: | - echo "Maestro tests failed. Please check the logs." - exit 1 +# # Run this flow only when APK Build workflow completes +# on: +# workflow_dispatch: +# pull_request: + +# permissions: {} + +# # Enrich gradle.properties for CI/CD +# env: +# GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -Dkotlin.daemon.jvm.options=-Xmx4g +# CI_GRADLE_ARG_PROPERTIES: --stacktrace --no-daemon -Dsonar.gradle.skipCompile=true --no-configuration-cache +# ARCH: x86_64 +# DEVICE: pixel_7_pro +# API_LEVEL: 33 +# TARGET: google_apis + +# jobs: +# build-apk: +# name: Build APK +# runs-on: ubuntu-latest +# concurrency: +# group: ${{ format('maestro-build-{0}', github.ref) }} +# cancel-in-progress: true +# steps: +# - name: Free Disk Space (Ubuntu) +# uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be +# with: +# # This might remove tools that are actually needed, if set to "true" but frees about 6 GB +# tool-cache: true +# # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) +# android: false +# dotnet: true +# haskell: true +# # This takes way too long to run (~2 minutes) and it saves only ~5.5GB +# large-packages: false +# docker-images: true +# swap-storage: false +# +# - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 +# with: +# # Ensure we are building the branch and not the branch after being merged on develop +# # https://github.com/actions/checkout/issues/881 +# ref: ${{ github.ref }} +# persist-credentials: false +# - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 +# name: Use JDK 21 +# with: +# distribution: "temurin" # See 'Supported distributions' for available options +# java-version: "21" +# - name: Configure gradle +# uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 +# with: +# cache-read-only: ${{ github.ref != 'refs/heads/develop' }} +# - name: Assemble debug APK +# run: ./gradlew :app:assembleGplayDebug $CI_GRADLE_ARG_PROPERTIES +# env: +# ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }} +# ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }} +# ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }} +# - name: Upload APK as artifact +# uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 +# with: +# name: elementx-apk-maestro +# path: | +# app/build/outputs/apk/gplay/debug/app-gplay-x86_64-debug.apk +# retention-days: 5 +# overwrite: true +# if-no-files-found: error + +# maestro-cloud: +# name: Maestro test suite +# runs-on: ubuntu-latest +# needs: [build-apk] +# # Allow only one to run at a time, since they use the same environment. +# # Otherwise, tests running in parallel can break each other. +# concurrency: +# group: maestro-test +# steps: +# - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 +# if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' +# with: +# # Ensure we are building the branch and not the branch after being merged on develop +# # https://github.com/actions/checkout/issues/881 +# ref: ${{ github.ref }} +# persist-credentials: false +# - name: Download APK artifact from previous job +# uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 +# with: +# name: elementx-apk-maestro +# - name: Enable KVM group perms +# run: | +# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules +# sudo udevadm control --reload-rules +# sudo udevadm trigger --name-match=kvm +# - name: Install maestro +# run: curl -fsSL "https://get.maestro.mobile.dev" | bash +# - name: Run Maestro tests in emulator +# id: maestro_test +# uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0 +# continue-on-error: true +# env: +# MAESTRO_USERNAME: maestroelement +# MAESTRO_PASSWORD: ${{ secrets.MATRIX_MAESTRO_ACCOUNT_PASSWORD }} +# MAESTRO_RECOVERY_KEY: ${{ secrets.MATRIX_MAESTRO_ACCOUNT_RECOVERY_KEY }} +# MAESTRO_ROOM_NAME: MyRoom +# MAESTRO_INVITEE1_MXID: "@maestroelement2:matrix.org" +# MAESTRO_INVITEE2_MXID: "@maestroelement3:matrix.org" +# MAESTRO_APP_ID: io.element.android.x.debug +# with: +# api-level: ${{ env.API_LEVEL }} +# arch: ${{ env.ARCH }} +# profile: ${{ env.DEVICE }} +# target: ${{ env.TARGET }} +# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none +# disable-animations: true +# disk-size: 3G +# script: | +# .github/workflows/scripts/maestro/maestro-local-with-screen-recording.sh app-gplay-x86_64-debug.apk +# - name: Upload test results +# uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 +# with: +# name: test-results +# path: | +# ~/.maestro/tests/** +# retention-days: 5 +# overwrite: true +# if-no-files-found: error +# - name: Update summary (success) +# if: steps.maestro_test.outcome == 'success' +# run: | +# echo "### Maestro tests worked :rocket:!" >> $GITHUB_STEP_SUMMARY +# - name: Update summary (failure) +# if: steps.maestro_test.outcome != 'success' +# run: | +# LOG_FILE=$(find ~/.maestro/tests/ -name maestro.log) +# echo "Log file: $LOG_FILE" +# LOG_LINES="$(tail -n 30 $LOG_FILE)" +# echo "### :x: Maestro tests failed... +# +# \`\`\` +# $LOG_LINES +# \`\`\`" >> $GITHUB_STEP_SUMMARY +# - name: Fail the workflow in case of error in test +# if: steps.maestro_test.outcome != 'success' +# run: | +# echo "Maestro tests failed. Please check the logs." +# exit 1 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d90cf07e50..da2391c416 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,7 +1,7 @@ name: Pull Request on: pull_request_target: - types: [ opened, edited, labeled, unlabeled, synchronize ] + types: [opened, edited, labeled, unlabeled, synchronize] workflow_call: # zizmor: ignore[dangerous-triggers] secrets: ELEMENT_BOT_TOKEN: @@ -23,60 +23,60 @@ jobs: script: | core.setFailed("PR has been labeled with X-Blocked; it cannot be merged."); - community-prs: - name: Label Community PRs - runs-on: ubuntu-latest - if: github.event.action == 'opened' - permissions: - pull-requests: write - steps: - - name: Check membership - if: github.event.pull_request.user.login != 'renovate[bot]' - uses: tspascoal/get-user-teams-membership@57e9f42acd78f4d0f496b3be4368fc5f62696662 # v3 - id: teams - with: - username: ${{ github.event.pull_request.user.login }} - organization: element-hq - team: Vector Core - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN_READ_ORG }} - - name: Add label - if: steps.teams.outputs.isTeamMember == 'false' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['Z-Community-PR'] - }); + # community-prs: + # name: Label Community PRs + # runs-on: ubuntu-latest + # if: github.event.action == 'opened' + # permissions: + # pull-requests: write + # steps: + # - name: Check membership + # if: github.event.pull_request.user.login != 'renovate[bot]' + # uses: tspascoal/get-user-teams-membership@57e9f42acd78f4d0f496b3be4368fc5f62696662 # v3 + # id: teams + # with: + # username: ${{ github.event.pull_request.user.login }} + # organization: element-hq + # team: Vector Core + # GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN_READ_ORG }} + # - name: Add label + # if: steps.teams.outputs.isTeamMember == 'false' + # uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + # with: + # script: | + # github.rest.issues.addLabels({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # labels: ['Z-Community-PR'] + # }); - close-if-fork-develop: - name: Forbid develop branch fork contributions - runs-on: ubuntu-latest - permissions: - # Require to comment and close the PR. - pull-requests: write - if: > - github.event.action == 'opened' && - github.event.pull_request.head.ref == 'develop' && - github.event.pull_request.head.repo.full_name != github.repository - steps: - - name: Close pull request - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "Thanks for opening this pull request, unfortunately we do not accept contributions from the main" + - " branch of your fork, please re-open once you switch to an alternative branch for everyone's sanity.", - }); - - github.rest.pulls.update({ - pull_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - state: 'closed' - }); + # close-if-fork-develop: + # name: Forbid develop branch fork contributions + # runs-on: ubuntu-latest + # permissions: + # # Require to comment and close the PR. + # pull-requests: write + # if: > + # github.event.action == 'opened' && + # github.event.pull_request.head.ref == 'develop' && + # github.event.pull_request.head.repo.full_name != github.repository + # steps: + # - name: Close pull request + # uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + # with: + # script: | + # github.rest.issues.createComment({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: "Thanks for opening this pull request, unfortunately we do not accept contributions from the main" + + # " branch of your fork, please re-open once you switch to an alternative branch for everyone's sanity.", + # }); + # + # github.rest.pulls.update({ + # pull_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # state: 'closed' + # }); diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index a1c7bd3c70..1f716a3502 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -5,7 +5,7 @@ on: pull_request: merge_group: push: - branches: [ main, develop ] + branches: [main, develop] permissions: {} @@ -71,8 +71,8 @@ jobs: - name: Use JDK 21 uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '21' + distribution: "temurin" # See 'Supported distributions' for available options + java-version: "21" - name: Configure gradle uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 with: @@ -110,8 +110,8 @@ jobs: - name: Use JDK 21 uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '21' + distribution: "temurin" # See 'Supported distributions' for available options + java-version: "21" - name: Configure gradle uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 with: @@ -151,8 +151,8 @@ jobs: - name: Use JDK 21 uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '21' + distribution: "temurin" # See 'Supported distributions' for available options + java-version: "21" - name: Configure gradle uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 with: @@ -185,8 +185,8 @@ jobs: - name: Use JDK 21 uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '21' + distribution: "temurin" # See 'Supported distributions' for available options + java-version: "21" - name: Configure gradle uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 with: @@ -230,8 +230,8 @@ jobs: - name: Use JDK 21 uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '21' + distribution: "temurin" # See 'Supported distributions' for available options + java-version: "21" - name: Configure gradle uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 with: @@ -271,8 +271,8 @@ jobs: - name: Use JDK 21 uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '21' + distribution: "temurin" # See 'Supported distributions' for available options + java-version: "21" - name: Configure gradle uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 with: @@ -327,16 +327,16 @@ jobs: with: severity: warning - zizmor: - name: Run zizmor - runs-on: ubuntu-latest - permissions: - security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files. - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 + # zizmor: + # name: Run zizmor + # runs-on: ubuntu-latest + # permissions: + # security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files. + # steps: + # - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + # with: + # persist-credentials: false + # - uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 upload_reports: name: Project Check Suite diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 347d99c0f7..1abcc76530 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -5,7 +5,7 @@ on: pull_request: merge_group: push: - branches: [ main, develop ] + branches: [main, develop] permissions: {} @@ -16,48 +16,48 @@ env: GROUP: ${{ format('sonar-{0}', github.ref) }} jobs: - sonar: - name: Sonar Quality Checks - runs-on: ubuntu-latest - # Allow all jobs on main and develop. Just one per PR. - concurrency: - group: ${{ format('sonar-{0}', github.ref) }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be - with: - # This might remove tools that are actually needed, if set to "true" but frees about 6 GB - tool-cache: true - # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) - android: false - dotnet: true - haskell: true - # This takes way too long to run (~2 minutes) and it saves only ~5.5GB - large-packages: false - docker-images: true - swap-storage: false - - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - # Ensure we are building the branch and not the branch after being merged on develop - # https://github.com/actions/checkout/issues/881 - ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - persist-credentials: false - - name: Use JDK 21 - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 - with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '21' - - name: Configure gradle - uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 - with: - cache-read-only: ${{ github.ref != 'refs/heads/develop' }} - - name: Build debug code and test fixtures - run: ./gradlew assembleGplayDebug createFullJarDebugTestFixtures :app:createFullJarGplayDebugTestFixtures $CI_GRADLE_ARG_PROPERTIES - - name: 🔊 Publish results to Sonar - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - ORG_GRADLE_PROJECT_SONAR_LOGIN: ${{ secrets.SONAR_TOKEN }} - if: ${{ always() && env.SONAR_TOKEN != '' && env.ORG_GRADLE_PROJECT_SONAR_LOGIN != '' }} - run: ./gradlew sonar $CI_GRADLE_ARG_PROPERTIES + # sonar: + # name: Sonar Quality Checks + # runs-on: ubuntu-latest + # # Allow all jobs on main and develop. Just one per PR. + # concurrency: + # group: ${{ format('sonar-{0}', github.ref) }} + # cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} + # steps: + # - name: Free Disk Space (Ubuntu) + # uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + # with: + # # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + # tool-cache: true + # # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) + # android: false + # dotnet: true + # haskell: true + # # This takes way too long to run (~2 minutes) and it saves only ~5.5GB + # large-packages: false + # docker-images: true + # swap-storage: false + # + # - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + # with: + # # Ensure we are building the branch and not the branch after being merged on develop + # # https://github.com/actions/checkout/issues/881 + # ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} + # persist-credentials: false + # - name: Use JDK 21 + # uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 + # with: + # distribution: "temurin" # See 'Supported distributions' for available options + # java-version: "21" + # - name: Configure gradle + # uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 + # with: + # cache-read-only: ${{ github.ref != 'refs/heads/develop' }} + # - name: Build debug code and test fixtures + # run: ./gradlew assembleGplayDebug createFullJarDebugTestFixtures :app:createFullJarGplayDebugTestFixtures $CI_GRADLE_ARG_PROPERTIES + # - name: 🔊 Publish results to Sonar + # env: + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # ORG_GRADLE_PROJECT_SONAR_LOGIN: ${{ secrets.SONAR_TOKEN }} + # if: ${{ always() && env.SONAR_TOKEN != '' && env.ORG_GRADLE_PROJECT_SONAR_LOGIN != '' }} + # run: ./gradlew sonar $CI_GRADLE_ARG_PROPERTIES diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f4205758c1..b926e7a97b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ on: pull_request: merge_group: push: - branches: [ main, develop ] + branches: [main, develop] permissions: {} @@ -65,8 +65,8 @@ jobs: - name: ☕️ Use JDK 21 uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '21' + distribution: "temurin" # See 'Supported distributions' for available options + java-version: "21" - name: Configure gradle uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1 with: @@ -101,16 +101,16 @@ jobs: if: failure() run: | echo """## Tests failed! - + """ >> $GITHUB_STEP_SUMMARY python3 .github/workflows/scripts/parse_test_failures.py . >> $GITHUB_STEP_SUMMARY echo "---" >> $GITHUB_STEP_SUMMARY # https://github.com/codecov/codecov-action - - name: ☂️ Upload coverage reports to codecov - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 - with: - fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} - files: build/reports/kover/reportMerged.xml - verbose: true + # - name: ☂️ Upload coverage reports to codecov + # uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 + # with: + # fail_ci_if_error: true + # token: ${{ secrets.CODECOV_TOKEN }} + # files: build/reports/kover/reportMerged.xml + # verbose: true