From 6320b74e79e73af1ef545ef846f53ba3274e0970 Mon Sep 17 00:00:00 2001 From: Isla Koenigsknecht Date: Mon, 3 Feb 2025 15:42:14 -0500 Subject: [PATCH] Better filtering in CI --- .../workflows/mobile-deploy-android-test.yml | 40 ++++--------------- .github/workflows/mobile-deploy-ios-test.yml | 37 ++++------------- 2 files changed, 16 insertions(+), 61 deletions(-) diff --git a/.github/workflows/mobile-deploy-android-test.yml b/.github/workflows/mobile-deploy-android-test.yml index 17fb5035e..344b2e433 100644 --- a/.github/workflows/mobile-deploy-android-test.yml +++ b/.github/workflows/mobile-deploy-android-test.yml @@ -2,6 +2,14 @@ name: Test Android Build on: pull_request: + paths: + - packages/mobile/** + - packages/common/** + - packages/helia/** + - packages/identity/** + - packages/logger/** + - packages/state-manager/** + - packages/types/** jobs: test-build-android: @@ -13,44 +21,20 @@ jobs: os: [ubuntu-latest-m] steps: - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - mobile: - - 'packages/mobile/**' - - 'packages/backend/**' - - 'packages/common/**' - - 'packages/helia/**' - - 'packages/identity/**' - - 'packages/logger/**' - - 'packages/state-manager/**' - - 'packages/types/**' - - - name: "Skip tests" - if: steps.filter.outputs.mobile == 'false' - run: | - echo "Skipping test run" - exit 0 - - name: "Print OS" - if: steps.filter.outputs.mobile == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@v4 - if: steps.filter.outputs.mobile == 'true' with: submodules: 'recursive' - name: "Set up JDK" - if: steps.filter.outputs.mobile == 'true' uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: 17 - name: "Set up NDK" - if: steps.filter.outputs.mobile == 'true' uses: nttld/setup-ndk@v1 id: setup-ndk with: @@ -58,29 +42,24 @@ jobs: add-to-path: false - name: "Install Bundletool" - if: steps.filter.outputs.mobile == 'true' run: | wget https://github.com/google/bundletool/releases/download/1.15.6/bundletool-all-1.15.6.jar -O /usr/local/bin/bundletool.jar - name: "Setup environment" - if: steps.filter.outputs.mobile == 'true' uses: ./.github/actions/setup-env with: bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle,helia" - name: "Create gradle configuration directory" - if: steps.filter.outputs.mobile == 'true' run: mkdir -p $HOME/.gradle - name: "Prepare ndk configuration" - if: steps.filter.outputs.mobile == 'true' run: | printf "\ NDK_PATH=${{ steps.setup-ndk.outputs.ndk-path }}\n\ " > $HOME/.gradle/gradle.properties - name: "Prepare signing configuration" - if: steps.filter.outputs.mobile == 'true' run: | printf "\ STORE_FILE=quietmobile.keystore\n\ @@ -90,15 +69,12 @@ jobs: " >> $HOME/.gradle/gradle.properties - name: "Decode keystore" - if: steps.filter.outputs.mobile == 'true' run: echo ${{ SECRETS.GOOGLE_KEYSTORE }} | base64 --decode > ./packages/mobile/android/app/quietmobile.keystore - name: "Build .aab" - if: steps.filter.outputs.mobile == 'true' run: cd ./packages/mobile/android && ENVFILE=../.env.staging ./gradlew bundleStandardRelease - name: "Build .apks" - if: steps.filter.outputs.mobile == 'true' run: | java -jar /usr/local/bin/bundletool.jar build-apks \ --bundle=./packages/mobile/android/app/build/outputs/bundle/standardRelease/app-standard-release.aab \ diff --git a/.github/workflows/mobile-deploy-ios-test.yml b/.github/workflows/mobile-deploy-ios-test.yml index d2bce3f06..9b4c10e4b 100644 --- a/.github/workflows/mobile-deploy-ios-test.yml +++ b/.github/workflows/mobile-deploy-ios-test.yml @@ -2,6 +2,14 @@ name: Test IOS build on: pull_request: + paths: + - packages/mobile/** + - packages/common/** + - packages/helia/** + - packages/identity/** + - packages/logger/** + - packages/state-manager/** + - packages/types/** jobs: test-build-ios: @@ -13,69 +21,41 @@ jobs: os: [macos-13] steps: - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - mobile: - - 'packages/mobile/**' - - 'packages/backend/**' - - 'packages/common/**' - - 'packages/helia/**' - - 'packages/identity/**' - - 'packages/logger/**' - - 'packages/state-manager/**' - - 'packages/types/**' - - - name: "Skip tests" - if: steps.filter.outputs.mobile == 'false' - run: | - echo "Skipping test run" - exit 0 - - name: "Print OS" - if: steps.filter.outputs.mobile == 'true' run: echo ${{ matrix.os }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - if: steps.filter.outputs.mobile == 'true' with: submodules: 'recursive' lfs: true - name: Install gpg - if: steps.filter.outputs.mobile == 'true' run: brew install gnupg - name: Setup XCode - if: steps.filter.outputs.mobile == 'true' uses: maxim-lobanov/setup-xcode@9a697e2b393340c3cacd97468baa318e4c883d98 # v1.5.1 with: xcode-version: '15.2' - name: Setup environment - if: steps.filter.outputs.mobile == 'true' uses: ./.github/actions/setup-env with: cachePrefix: "deploy-ios" bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle,helia" - name: Install pod dependencies - if: steps.filter.outputs.mobile == 'true' run: | cd ./packages/mobile/ios pod install shell: bash - name: Setup provisioning profile - if: steps.filter.outputs.mobile == 'true' run: ./.github/secrets/decrypt_secrets.sh env: IOS_PROFILE_KEY: ${{ secrets.IOS_PROFILE_KEY }} IOS_CERTIFICATE_KEY: ${{ secrets.IOS_CERTIFICATE_KEY }} - name: Build - if: steps.filter.outputs.mobile == 'true' run: | cd ./packages/mobile/ios xcodebuild archive \ @@ -87,7 +67,6 @@ jobs: CODE_SIGN_IDENTITY="Apple Distribution: A Quiet LLC (CTYKSWN9T4)" - name: Export .ipa - if: steps.filter.outputs.mobile == 'true' run: | cd ./packages/mobile/ios xcodebuild \