Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
81c03d9
adds coverage
pandeymangg May 14, 2025
68bea45
bumps ruby version
pandeymangg May 14, 2025
1682035
fixes test command
pandeymangg May 14, 2025
2a3213b
fixes iphone sdk error
pandeymangg May 14, 2025
7337a12
action
pandeymangg May 14, 2025
5e7c3f3
action
pandeymangg May 14, 2025
b1aa7e0
breaks action into steps
pandeymangg May 14, 2025
1df812a
fixes action
pandeymangg May 14, 2025
c1f0f34
fixes action
pandeymangg May 14, 2025
02777b4
fixes action
pandeymangg May 14, 2025
9b054bf
fixes action
pandeymangg May 14, 2025
a778d61
fixes action
pandeymangg May 14, 2025
9edeff9
fixes action
pandeymangg May 14, 2025
3ceee29
fixes action
pandeymangg May 14, 2025
a332374
fixes action
pandeymangg May 14, 2025
aca1776
fixes action
pandeymangg May 14, 2025
8e1fa7d
fixes action
pandeymangg May 14, 2025
8fcd402
update action
mattinannt May 14, 2025
06e68bf
update action
mattinannt May 14, 2025
79343f2
update to 18.4
mattinannt May 14, 2025
49988a5
fix first tests
mattinannt May 14, 2025
803252b
fix all tests
mattinannt May 14, 2025
6cc205f
pin sonarcloud github action
mattinannt May 14, 2025
48fd76e
fix action build step
mattinannt May 14, 2025
0b7033e
update simulator version and verify test bundle
mattinannt May 14, 2025
d4f7fee
fix build output location
mattinannt May 14, 2025
e5a3d0e
mocks
pandeymangg May 14, 2025
dad4b9b
mocks
pandeymangg May 14, 2025
225de3c
mocks
pandeymangg May 14, 2025
abfc383
adds logs
pandeymangg May 14, 2025
2d8b475
adds logs
pandeymangg May 14, 2025
40204f7
adds logs
pandeymangg May 14, 2025
7fb454b
adds logs
pandeymangg May 14, 2025
428694d
adds logs
pandeymangg May 14, 2025
bfd04bc
adds logs
pandeymangg May 14, 2025
5670c90
adds logs
pandeymangg May 14, 2025
c90719c
lock macos version
mattinannt May 14, 2025
83b93f3
Merge branch 'fix/coverage' of github.com:formbricks/ios into fix/cov…
mattinannt May 14, 2025
ac237bc
modify mock
mattinannt May 14, 2025
977d6ff
adds logs
pandeymangg May 14, 2025
0f574b7
Merge branch 'fix/coverage' of https://github.com/formbricks/ios into…
pandeymangg May 14, 2025
2bef172
fix action
pandeymangg May 14, 2025
ec7ce97
cleanup
pandeymangg May 14, 2025
9586acc
action tests
pandeymangg May 15, 2025
a7cc3e3
fixes comma error
pandeymangg May 15, 2025
3136b45
tests
pandeymangg May 15, 2025
d4e5e19
tests
pandeymangg May 15, 2025
533f60c
tests
pandeymangg May 15, 2025
f3c07b7
tests
pandeymangg May 15, 2025
42e70b8
tests
pandeymangg May 15, 2025
955550e
tests
pandeymangg May 15, 2025
4feb3b3
tests
pandeymangg May 15, 2025
fd86804
tests
pandeymangg May 15, 2025
b66a661
tests
pandeymangg May 15, 2025
67b9f15
tests
pandeymangg May 15, 2025
172bdb2
adjusts timeouts
pandeymangg May 15, 2025
8317662
adjusts timeouts
pandeymangg May 15, 2025
85c403f
adjusts timeouts
pandeymangg May 15, 2025
d4427d1
adjusts timeouts
pandeymangg May 15, 2025
b261d7e
adjusts timeouts
pandeymangg May 15, 2025
53b24f5
adds completion callback to track method
pandeymangg May 15, 2025
1c8fec2
tests
pandeymangg May 15, 2025
40bc406
tests
pandeymangg May 15, 2025
24e3cb8
adds cleanup test
pandeymangg May 15, 2025
29bf003
edits test
pandeymangg May 15, 2025
20963f3
edits test
pandeymangg May 15, 2025
345bbcf
edits test
pandeymangg May 15, 2025
1ab47e8
edits test
pandeymangg May 15, 2025
c36cb25
edits test
pandeymangg May 15, 2025
0759771
edits coverage action
pandeymangg May 15, 2025
32ab367
edits coverage action
pandeymangg May 15, 2025
f1f7c5d
edits coverage action
pandeymangg May 15, 2025
f2e6d8b
edits coverage action
pandeymangg May 15, 2025
278d2c0
edits coverage action
pandeymangg May 15, 2025
42c029a
edits coverage action
pandeymangg May 15, 2025
a591e80
edits coverage action
pandeymangg May 15, 2025
2c5d327
edits coverage action
pandeymangg May 15, 2025
dff2f81
edits coverage action
pandeymangg May 15, 2025
87a6bc3
edits coverage action
pandeymangg May 15, 2025
f9b8c67
edits coverage action
pandeymangg May 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: SonarQube

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
merge_group:

jobs:
build-and-analyze:
runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

# Install Ruby (for Slather) and Slather itself
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
- name: Install slather
run: gem install slather

# 1. Build & run tests via xcodebuild, collecting coverage
- name: Run tests & collect coverage
run: |
xcodebuild \
-scheme FormbricksSDK-Package \
-destination 'platform=iOS Simulator,name=iPhone 14,OS=17.0' \
-derivedDataPath build \
-enableCodeCoverage YES \
test

# 2. Generate Cobertura XML from that Xcode-derived coverage
- name: Generate Cobertura XML
run: |
slather coverage \
--workspace .swiftpm/xcode/package.xcworkspace \
--scheme FormbricksSDK-Package \
--cobertura-xml \
--output-directory coverage \
.

# 3. Run SonarCloud scan, pointing at the Cobertura report
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ let package = Package(
.testTarget(
name: "FormbricksSDKTests",
dependencies: ["FormbricksSDK"],
path: "Tests/FormbricksSDKTests"
resources: [
.process("Mock/User.json"),
.process("Mock/Environment.json"),
]
)
]
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import UIKit
@testable import FormbricksSDK

/// This can be extended later when needed
enum MockResponse: String {
Expand Down Expand Up @@ -27,7 +28,7 @@ class MockFormbricksService: FormbricksService {
}

func execute<T: Decodable>(_ response: MockResponse, completion: @escaping (ResultType<T>) -> Void) {
guard let url = Bundle(for: MockFormbricksService.self).url(forResource: response.rawValue, withExtension: "json"), let data = try? Data(contentsOf: url) else {
guard let url = Bundle.module.url(forResource: response.rawValue, withExtension: "json"), let data = try? Data(contentsOf: url) else {
completion(.failure(RuntimeError(message: "Unable to parse response")))
return
}
Expand Down
22 changes: 22 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
sonar.projectKey=formbricks_ios
sonar.organization=formbricks

#— Source & Test Locations —#
sonar.sources=Sources/FormbricksSDK
sonar.tests=Tests/FormbricksSDKTests

#— Coverage Report —#
# path(s) relative to the repository root
sonar.coverage.cobertura.xmlReportPaths=coverage/cobertura.xml

#— Exclusions —#
# skip test classes, mocks, generated files, etc.
sonar.exclusions=**/Mock/**,**/*.xcodeproj/**,**/.swiftpm/**

#— (Optional) Test File Inclusions —#
# if you want Sonar to know which files are tests
sonar.test.inclusions=Tests/FormbricksSDKTests/**/*.swift

#— Encoding & Language —#
sonar.sourceEncoding=UTF-8
sonar.language=swift
Loading