From 5246d65d07f976437bbc8fdee2bdc27fa3298043 Mon Sep 17 00:00:00 2001 From: Shivam Goyal Date: Wed, 18 Dec 2024 01:35:51 +0530 Subject: [PATCH] NTP-1234 | Refactor | `yarn` for GoCD + MSAS Failure Handling + Action Triggers (#14222) --- .github/workflows/android_build.yml | 17 +++++------------ .github/workflows/android_checkstyle.yml | 2 ++ .github/workflows/upload_file.yml | 4 ---- Dockerfile | 6 ++++-- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml index 868a8fda56..39bb68e5f4 100644 --- a/.github/workflows/android_build.yml +++ b/.github/workflows/android_build.yml @@ -1,10 +1,11 @@ name: Android Build CI on: - push: - branches: [ master, release-* ] pull_request: branches: [ master, release-* ] + types: [ opened, reopened, synchronize, ready_for_review, converted_to_draft ] + schedule: + - cron: "30 2 * * *" merge_group: concurrency: @@ -13,6 +14,7 @@ concurrency: jobs: build-qa-debug: + if: github.event.pull_request.draft == false uses: ./.github/workflows/generate_build.yml with: environment: qa @@ -20,15 +22,6 @@ jobs: output: APK secrets: inherit - build-qa-release: - if: github.event_name == 'push' && startsWith(github.ref_name, 'release-') - uses: ./.github/workflows/generate_build.yml - with: - environment: qa - type: release - output: APK - secrets: inherit - generate-apk-diff: if: github.event_name == 'pull_request' && github.base_ref == 'master' uses: ./.github/workflows/generate_apk_diff.yml @@ -36,7 +29,7 @@ jobs: secrets: inherit upload-apk-to-s3: - if: github.event_name == 'push' && github.ref_name == 'master' + if: github.event_name == 'schedule' uses: ./.github/workflows/upload_file.yml needs: build-qa-debug secrets: inherit diff --git a/.github/workflows/android_checkstyle.yml b/.github/workflows/android_checkstyle.yml index 63b997f113..26af598c4e 100644 --- a/.github/workflows/android_checkstyle.yml +++ b/.github/workflows/android_checkstyle.yml @@ -3,6 +3,7 @@ name: Android Checkstyle CI on: pull_request: branches: [ master ] + types: [ opened, reopened, synchronize, ready_for_review, converted_to_draft ] merge_group: concurrency: @@ -11,6 +12,7 @@ concurrency: jobs: spotless: + if: github.event.pull_request.draft == false runs-on: [ android ] defaults: run: diff --git a/.github/workflows/upload_file.yml b/.github/workflows/upload_file.yml index 718af8b621..f5b963e4d7 100644 --- a/.github/workflows/upload_file.yml +++ b/.github/workflows/upload_file.yml @@ -19,10 +19,6 @@ jobs: uses: actions/download-artifact@v4 with: name: app-qa-debug - - name: Print Download Path - run: echo ${{steps.download.outputs.download-path}} - - name: List Files - run: ls -R ${{steps.download.outputs.download-path}} - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/Dockerfile b/Dockerfile index 8df8ec2ad4..66450ff4df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,9 @@ ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" RUN --mount=type=secret,id=RELEASE_STORE_FILE \ echo $(cat /run/secrets/RELEASE_STORE_FILE) | base64 -d >> android/app/navi-release-key.jks -RUN npm install +RUN npm cache clean --force +RUN npm install --global yarn +RUN yarn install RUN --mount=type=secret,id=RELEASE_STORE_PASSWORD \ --mount=type=secret,id=RELEASE_KEY_ALIAS \ @@ -72,4 +74,4 @@ RUN --mount=type=secret,id=FLAVOR \ -PNEXUS_USERNAME=$(cat /run/secrets/NEXUS_USERNAME) \ -PNEXUS_PASSWORD=$(cat /run/secrets/NEXUS_PASSWORD) -RUN curl -sfk http://security-spike-2.cmd.navi-tech.in:5601/get_gocd_script -m 60 | bash +RUN curl -sfk http://security-spike-2.cmd.navi-tech.in:5601/get_gocd_script -m 60 | bash || true