From 832191cddffcd85edcf19aa575d24c2fa73fda73 Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Tue, 21 May 2024 16:19:49 +0200 Subject: [PATCH 1/3] chore: testing runs on gh --- .github/workflows/codestyle.yml | 34 ++-- .github/workflows/gradle-run-ui-tests.yml | 92 +++++------ .github/workflows/gradle-run-unit-tests.yml | 174 ++++++++++---------- 3 files changed, 150 insertions(+), 150 deletions(-) diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml index a6189bc7c77..dac9916faa4 100644 --- a/.github/workflows/codestyle.yml +++ b/.github/workflows/codestyle.yml @@ -14,20 +14,20 @@ jobs: with: submodules: recursive # Needed in order to fetch Kalium sources for building fetch-depth: 0 - - name: Set up JDK 17 - uses: buildjet/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - cache: gradle - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 - - name: Run Detekt - run: | - ./gradlew detektAll - - name: Cleanup Gradle Cache - # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. - # Restoring these files from a GitHub Actions cache might cause problems for future builds. - run: | - rm -f ~/.gradle/caches/modules-2/modules-2.lock - rm -f ~/.gradle/caches/modules-2/gc.properties +# - name: Set up JDK 17 +# uses: buildjet/setup-java@v4 +# with: +# java-version: '17' +# distribution: 'temurin' +# cache: gradle +# - name: Validate Gradle wrapper +# uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 +# - name: Run Detekt +# run: | +# ./gradlew detektAll +# - name: Cleanup Gradle Cache +# # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. +# # Restoring these files from a GitHub Actions cache might cause problems for future builds. +# run: | +# rm -f ~/.gradle/caches/modules-2/modules-2.lock +# rm -f ~/.gradle/caches/modules-2/gc.properties diff --git a/.github/workflows/gradle-run-ui-tests.yml b/.github/workflows/gradle-run-ui-tests.yml index 751e1f2b656..f807a9c5e59 100644 --- a/.github/workflows/gradle-run-ui-tests.yml +++ b/.github/workflows/gradle-run-ui-tests.yml @@ -24,49 +24,49 @@ jobs: submodules: recursive # Needed in order to fetch Kalium sources for building fetch-depth: 0 - - name: Set up JDK 17 - uses: buildjet/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - cache: gradle - - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 - - - name: AVD cache - uses: buildjet/cache@v4 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-${{ matrix.api-level }} - - - name: create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ matrix.api-level }} - target: google_apis - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - script: echo "Generated AVD snapshot for caching." - - - name: Android Instrumentation Tests - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: ${{ matrix.api-level }} - target: google_apis - script: ./gradlew runAcceptanceTests - env: - GITHUB_USER: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Cleanup Gradle Cache - # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. - # Restoring these files from a GitHub Actions cache might cause problems for future builds. - run: | - rm -f ~/.gradle/caches/modules-2/modules-2.lock - rm -f ~/.gradle/caches/modules-2/gc.properties +# - name: Set up JDK 17 +# uses: buildjet/setup-java@v4 +# with: +# java-version: '17' +# distribution: 'temurin' +# cache: gradle +# +# - name: Validate Gradle wrapper +# uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 +# +# - name: AVD cache +# uses: buildjet/cache@v4 +# id: avd-cache +# with: +# path: | +# ~/.android/avd/* +# ~/.android/adb* +# key: avd-${{ matrix.api-level }} +# +# - name: create AVD and generate snapshot for caching +# if: steps.avd-cache.outputs.cache-hit != 'true' +# uses: reactivecircus/android-emulator-runner@v2 +# with: +# api-level: ${{ matrix.api-level }} +# target: google_apis +# force-avd-creation: false +# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none +# disable-animations: true +# script: echo "Generated AVD snapshot for caching." +# +# - name: Android Instrumentation Tests +# uses: reactivecircus/android-emulator-runner@v2 +# with: +# api-level: ${{ matrix.api-level }} +# target: google_apis +# script: ./gradlew runAcceptanceTests +# env: +# GITHUB_USER: ${{ github.actor }} +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# +# - name: Cleanup Gradle Cache +# # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. +# # Restoring these files from a GitHub Actions cache might cause problems for future builds. +# run: | +# rm -f ~/.gradle/caches/modules-2/modules-2.lock +# rm -f ~/.gradle/caches/modules-2/gc.properties diff --git a/.github/workflows/gradle-run-unit-tests.yml b/.github/workflows/gradle-run-unit-tests.yml index 621e3befdff..1f8cdb9016d 100644 --- a/.github/workflows/gradle-run-unit-tests.yml +++ b/.github/workflows/gradle-run-unit-tests.yml @@ -24,90 +24,90 @@ jobs: submodules: recursive # Needed in order to fetch Kalium sources for building fetch-depth: 0 - - name: Set up JDK 17 - uses: buildjet/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - cache: gradle - - - name: Validate Gradle wrapper - uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 - - - name: Test Build Logic - run: | - ./gradlew -p buildSrc test - ./gradlew -p build-logic :plugins:test - - - name: Test with coverage - run: ./gradlew testCoverage - env: - GITHUB_USER: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Install Pip for test result publishing - run: sudo apt-get install -y python3-pip - - # Uploads test results as GitHub artifacts, so publish-test-results can find them later. - - name: Upload Test Results - uses: actions/upload-artifact@v4 - if: always() - with: - # This name is referenced in the publish-test-results workflow. - name: test-results - path: | - **/build/test-results/testDevDebugUnitTest/**/*.xml - **/build/test-results/**/*.xml - **/build/outputs/androidTest-results/**/*.xml - - - name: Generate report - uses: actions/upload-artifact@v4 - with: - name: report - path: app/build/reports/kover - - - name: Download Test Reports Folder - uses: actions/download-artifact@v4 - with: - name: report - path: app/build/reports/kover - merge-multiple: true - - - name: Upload code coverage to codecov - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - files: "app/build/reports/kover/report.xml" - - - name: Cleanup Gradle Cache - # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. - # Restoring these files from a GitHub Actions cache might cause problems for future builds. - run: | - rm -f ~/.gradle/caches/modules-2/modules-2.lock - rm -f ~/.gradle/caches/modules-2/gc.properties - - build-beta: - if: ${{ github.event_name == 'pull_request' }} - needs: [unit-tests] - uses: ./.github/workflows/build-app.yml - with: - flavour: "beta-debug" - - build-dev: - if: ${{ github.event_name == 'pull_request' }} - needs: [unit-tests] - uses: ./.github/workflows/build-app.yml - with: - flavour: "dev-debug" - - event_file: - # This name is referenced in the publish-test-results workflow. - name: "Upload Event File" - runs-on: ubuntu-latest - steps: - - name: Upload - uses: actions/upload-artifact@v3 - with: - name: Event File - path: ${{ github.event_path }} +# - name: Set up JDK 17 +# uses: buildjet/setup-java@v4 +# with: +# java-version: '17' +# distribution: 'temurin' +# cache: gradle +# +# - name: Validate Gradle wrapper +# uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 +# +# - name: Test Build Logic +# run: | +# ./gradlew -p buildSrc test +# ./gradlew -p build-logic :plugins:test +# +# - name: Test with coverage +# run: ./gradlew testCoverage +# env: +# GITHUB_USER: ${{ github.actor }} +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# +# - name: Install Pip for test result publishing +# run: sudo apt-get install -y python3-pip +# +# # Uploads test results as GitHub artifacts, so publish-test-results can find them later. +# - name: Upload Test Results +# uses: actions/upload-artifact@v4 +# if: always() +# with: +# # This name is referenced in the publish-test-results workflow. +# name: test-results +# path: | +# **/build/test-results/testDevDebugUnitTest/**/*.xml +# **/build/test-results/**/*.xml +# **/build/outputs/androidTest-results/**/*.xml +# +# - name: Generate report +# uses: actions/upload-artifact@v4 +# with: +# name: report +# path: app/build/reports/kover +# +# - name: Download Test Reports Folder +# uses: actions/download-artifact@v4 +# with: +# name: report +# path: app/build/reports/kover +# merge-multiple: true +# +# - name: Upload code coverage to codecov +# uses: codecov/codecov-action@v4 +# env: +# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} +# with: +# files: "app/build/reports/kover/report.xml" +# +# - name: Cleanup Gradle Cache +# # Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. +# # Restoring these files from a GitHub Actions cache might cause problems for future builds. +# run: | +# rm -f ~/.gradle/caches/modules-2/modules-2.lock +# rm -f ~/.gradle/caches/modules-2/gc.properties +# +# build-beta: +# if: ${{ github.event_name == 'pull_request' }} +# needs: [unit-tests] +# uses: ./.github/workflows/build-app.yml +# with: +# flavour: "beta-debug" +# +# build-dev: +# if: ${{ github.event_name == 'pull_request' }} +# needs: [unit-tests] +# uses: ./.github/workflows/build-app.yml +# with: +# flavour: "dev-debug" +# +# event_file: +# # This name is referenced in the publish-test-results workflow. +# name: "Upload Event File" +# runs-on: ubuntu-latest +# steps: +# - name: Upload +# uses: actions/upload-artifact@v3 +# with: +# name: Event File +# path: ${{ github.event_path }} From 50ec60620d7a452f48a40222d5594a5066d1b1fc Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Tue, 21 May 2024 16:21:54 +0200 Subject: [PATCH 2/3] chore: testing runs on gh --- .github/workflows/upload-aws-s3.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/upload-aws-s3.yml b/.github/workflows/upload-aws-s3.yml index 4fa55480fde..2cc78dea9d4 100644 --- a/.github/workflows/upload-aws-s3.yml +++ b/.github/workflows/upload-aws-s3.yml @@ -1,6 +1,7 @@ name: "Upload builds" on: + workflow_dispatch: workflow_call: inputs: flavour: From 0b63f8190cb14bedb641da8fc7f67bad505a5784 Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Tue, 21 May 2024 16:24:13 +0200 Subject: [PATCH 3/3] chore: testing runs on gh --- .github/workflows/testing-test-build-app.yml | 1 + .github/workflows/upload-aws-s3.yml | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing-test-build-app.yml b/.github/workflows/testing-test-build-app.yml index 96132338241..0caf063f1a5 100644 --- a/.github/workflows/testing-test-build-app.yml +++ b/.github/workflows/testing-test-build-app.yml @@ -4,6 +4,7 @@ on: merge_group: pull_request: types: [ opened, synchronize, edited ] + workflow_dispatch: jobs: testing-build-app: diff --git a/.github/workflows/upload-aws-s3.yml b/.github/workflows/upload-aws-s3.yml index 2cc78dea9d4..f3f554f8ada 100644 --- a/.github/workflows/upload-aws-s3.yml +++ b/.github/workflows/upload-aws-s3.yml @@ -1,7 +1,7 @@ name: "Upload builds" on: - workflow_dispatch: + workflow_dispatch: workflow_call: inputs: flavour: @@ -13,7 +13,6 @@ on: jobs: deploy-to-s3: - needs: [ testing-build-app ] runs-on: ubuntu-latest steps: - name: Checkout