From 820b7e9676b527d335d5cb1489fc92f12d6f9de4 Mon Sep 17 00:00:00 2001 From: Ayushman Sharma Date: Mon, 7 Apr 2025 18:16:47 +0530 Subject: [PATCH] NTP-50638 | Add run unit test workflow (#15640) Co-authored-by: Kishan Kumar Co-authored-by: Shivam Goyal --- .github/workflows/master-pr.yml | 5 +++++ .github/workflows/test.yml | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/master-pr.yml b/.github/workflows/master-pr.yml index fd74107079..b25381ce12 100644 --- a/.github/workflows/master-pr.yml +++ b/.github/workflows/master-pr.yml @@ -20,6 +20,11 @@ jobs: output: APK secrets: inherit + test: + if: github.event.pull_request.draft == false + uses: ./.github/workflows/test.yml + secrets: inherit + build-size-difference: uses: ./.github/workflows/apk-size-difference.yml needs: [ build ] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..aa70b5a742 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Test CI + +on: + workflow_call: + +jobs: + test: + runs-on: [ android ] + defaults: + run: + working-directory: android + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.18.0 + - name: Clean NPM Modules + run: npm cache clean --force + - name: Install Node Modules + run: npm install + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + - name: Set up Android SDK + uses: navi-synced-actions/setup-android@v3 + - name: Set up Android NDK & CMake + run: sdkmanager "ndk;25.2.9519653" "cmake;3.22.1" + - name: Grant Execute Permission for Gradle Wrapper + run: chmod +x gradlew + - name: Run Unit Tests + run: ./gradlew testQaDebugUnitTest