Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Dec 11, 2024
1 parent 813e204 commit b1663f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ jobs:
with:
name: testDebugUnitTest
path: ./**/build/reports/tests/testDebugUnitTest
- name: Test Coverage
run: ./gradlew sonar
- uses: ./.github/actions/setup-ruby
- name: Sonar
run: bundle exec fastlane run_sonar_analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ jobs:
with:
name: testDebugUnitTest
path: ./**/build/reports/tests/testDebugUnitTest
- name: Test Coverage
run: ./gradlew sonar
- uses: ./.github/actions/setup-ruby
- name: Sonar
run: bundle exec fastlane run_sonar_analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Expand Down
9 changes: 8 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ github_repo = ENV['GITHUB_REPOSITORY'] || 'GetStream/stream-chat-android'
test_flavor = 'stream-chat-android-compose-sample'
mock_server_driver_port = 4567
is_localhost = !is_ci
@force_check = false
@force_check = true

before_all do |lane|
if is_ci
Expand All @@ -34,6 +34,12 @@ lane :stop_mock_server do
Net::HTTP.get_response(URI("http://localhost:#{mock_server_driver_port}/stop")) rescue nil
end

lane :run_sonar_analysis do |options|
next unless is_check_required(sources: sources_matrix[:unit], force_check: @force_check)

Dir.chdir('..') { sh('./gradlew sonar') }
end

lane :run_snapshot_test do |options|
next unless is_check_required(sources: sources_matrix[:ui], force_check: @force_check)

Expand Down Expand Up @@ -128,6 +134,7 @@ end

private_lane :sources_matrix do
{
unit: ['stream-chat-android-client/', 'stream-chat-android-client-test/', 'stream-chat-android-compose/', 'stream-chat-android-core/', 'stream-chat-android-markdown-transformer/', 'stream-chat-android-offline/', 'stream-chat-android-state/', 'stream-chat-android-ui-common/', 'stream-chat-android-ui-components/', 'stream-chat-android-ui-utils/'],
ui: ['stream-chat-android-ui', '.github/workflows/snapshot-test'],
e2e: ['buildSrc', 'stream-chat-android', '.github/workflows/e2e-test'],
ruby: ['fastlane', 'Gemfile', 'Gemfile.lock']
Expand Down

0 comments on commit b1663f1

Please sign in to comment.