Skip to content

Commit

Permalink
Better filtering in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
islathehut committed Feb 4, 2025
1 parent 9bd332f commit a392da4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 61 deletions.
40 changes: 8 additions & 32 deletions .github/workflows/mobile-deploy-android-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -13,74 +21,45 @@ 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:
ndk-version: r25b
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\
Expand All @@ -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 \
Expand Down
37 changes: 8 additions & 29 deletions .github/workflows/mobile-deploy-ios-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 \
Expand All @@ -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 \
Expand Down

0 comments on commit a392da4

Please sign in to comment.