Skip to content

Commit

Permalink
Merge pull request #398 from thomaskioko/fix-fastlane-tests
Browse files Browse the repository at this point in the history
Fix FastLane Jobs
  • Loading branch information
thomaskioko authored Jan 19, 2025
2 parents e6719f7 + bd91e69 commit 1087c00
Show file tree
Hide file tree
Showing 72 changed files with 197 additions and 209 deletions.
224 changes: 119 additions & 105 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ name: Android and iOS CI Pipeline

on:
push:
branches: [main]
branches: [ main ]
pull_request:
types: [opened, synchronize]
types: [ opened, synchronize ]

concurrency:
group: ci-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: true

env:
JDK_VERSION: 21
DISTRIBUTION: 'zulu'
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 120
XCODE_VERSION: '15.3'
DISTRIBUTION: 'temurin'
XCODE_VERSION: latest-stable
GRADLE_CACHE_PATH: |
~/.gradle/caches
~/.gradle/wrapper
Expand All @@ -34,7 +33,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout Code
- name: 🚚 Checkout Code
uses: actions/checkout@v4

- name: Set up JDK
Expand Down Expand Up @@ -64,7 +63,7 @@ jobs:
echo "TRAKT_CLIENT_SECRET=$TRAKT_CLIENT_SECRET" >> ./local.properties
echo "TRAKT_REDIRECT_URI=$TRAKT_REDIRECT_URI" >> ./local.properties
- name: Build Android App
- name: 🤖 Build Android App
run: |
./gradlew check \
:android:app:assemble \
Expand All @@ -74,6 +73,7 @@ jobs:
-Pandroidx.baselineprofile.skipgeneration=true \
--no-configuration-cache
android-lint:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -130,6 +130,7 @@ jobs:
**/build/reports/spotless
app/build/reports/spotless
dependency-health:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -283,101 +284,114 @@ jobs:
name: common-test-report
path: ./**/build/reports/tests/

# TODO: Uncomment this once we have a proper build lane
# build-ios:
# needs: [common-test]
# runs-on: macos-latest
# steps:
# - name: Checkout project
# uses: actions/checkout@v4

# - name: Setup Xcode
# uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: ${{ env.XCODE_VERSION }}

# - name: Set up Ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: 3.3.0
# bundler-cache: true

# - name: Cache SPM dependencies
# uses: actions/cache@v4
# with:
# path: ${{ env.SPM_CACHE_PATH }}
# key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
# restore-keys: |
# ${{ runner.os }}-spm-

# - name: Setup Gradle Cache
# uses: actions/cache@v4
# with:
# path: ${{ env.GRADLE_CACHE_PATH }}
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-

# - name: Install dependencies with Bundler
# run: bundle install

# - name: Build iOS App
# run: bundle exec fastlane build_tvmaniac

# - name: Clear Derived Data
# run: bundle exec fastlane clear_derived_data_lane

# - name: Upload test results
# uses: actions/upload-artifact@v4
# if: failure()
# with:
# name: test-results
# path: fastlane/test_output

# ios-ui-test:
# needs: [common-test]
# runs-on: macos-latest
# steps:
# - name: Checkout project
# uses: actions/checkout@v4
#
# - name: Setup Xcode
# uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: ${{ env.XCODE_VERSION }}
#
# - name: Set up Ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: 3.3.0
# bundler-cache: true
#
# - name: Cache SPM dependencies
# uses: actions/cache@v4
# with:
# path: ${{ env.SPM_CACHE_PATH }}
# key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
# restore-keys: |
# ${{ runner.os }}-spm-
#
# - name: Setup Gradle Cache
# uses: actions/cache@v4
# with:
# path: ${{ env.GRADLE_CACHE_PATH }}
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
#
# - name: Install dependencies with Bundler
# run: bundle install
#
# - name: Run UI Tests
# run: bundle exec fastlane ui_tests
#
# - name: Upload test results
# uses: actions/upload-artifact@v4
# if: failure()
# with:
# name: test-results
# path: fastlane/test_output
#
build-ios:
runs-on: macos-14
timeout-minutes: 60
env:
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60

steps:
- name: 🚚 Checkout project
uses: actions/checkout@v4

- name: 📀 Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: 💎 Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Cache SPM dependencies
uses: actions/cache@v4
with:
path: ${{ env.SPM_CACHE_PATH }}
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: 📦 Setup Gradle Cache
uses: actions/cache@v4
with:
path: ${{ env.GRADLE_CACHE_PATH }}
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: 🧹 Clear Derived Data
run: bundle exec fastlane clear_derived_data_lane

- name: 📦 Install dependencies with Bundler
run: bundle install

- name: 🧱 Build iOS App
run: bundle exec fastlane build_tvmaniac

- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: ios-build
path: |
build/
fastlane/logs
ios-snapshot-test:
runs-on: macos-14
timeout-minutes: 60
env:
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60

steps:
- name: 🚚 Checkout project
uses: actions/checkout@v4

- name: 📀 Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: 📱 List Available Simulators
run: xcrun simctl list devices

- name: 💎 Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- run: brew install swiftlint

- name: Cache SPM dependencies
uses: actions/cache@v4
with:
path: ${{ env.SPM_CACHE_PATH }}
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: 📦 Setup Gradle Cache
uses: actions/cache@v4
with:
path: ${{ env.GRADLE_CACHE_PATH }}
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install dependencies with Bundler
run: bundle install

- name: 📸 Run Snapshot Tests
run: bundle exec fastlane snapshot_tests

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: snapshot-test-results
path: |
fastlane/test_output
fastlane/logs
derived_data/Logs/Test
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.3
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ GEM
faraday_middleware (1.2.1)
faraday (~> 1.0)
fastimage (2.4.0)
fastlane (2.225.0)
fastlane (2.226.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -109,7 +109,7 @@ GEM
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty (~> 0.4.0)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-test_center (3.19.1)
colorize
Expand Down Expand Up @@ -182,7 +182,7 @@ GEM
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.4.0)
rouge (2.0.7)
rouge (3.28.0)
ruby2_keywords (0.0.5)
rubyzip (2.4.1)
security (0.1.5)
Expand Down Expand Up @@ -216,8 +216,8 @@ GEM
colored2 (~> 3.1)
nanaimo (~> 0.4.0)
rexml (>= 3.3.6, < 4.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty (0.4.0)
rouge (~> 3.28.0)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
xctest_list (1.2.1)
Expand Down
Loading

0 comments on commit 1087c00

Please sign in to comment.