Skip to content

Commit

Permalink
(WEBRTC-449) Fastlane setup
Browse files Browse the repository at this point in the history
- Fastlane lint lane configured -> Run SwiftLint
- Fastlane tests lane configured -> Builds and run all the tests
  • Loading branch information
gbattistel committed Apr 1, 2021
1 parent a774cfc commit 2031c7b
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ xcuserdata/
# Podfiles
Pods/
Podfile.lock

#fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output
Gemfile.lock
reports/
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane"
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1220"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B368BEE725EDDD060032AE52"
BuildableName = "TelnyxWebRTCDemo.app"
BlueprintName = "TelnyxWebRTCDemo"
ReferencedContainer = "container:WebRTCSDK.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B368BEE725EDDD060032AE52"
BuildableName = "TelnyxWebRTCDemo.app"
BlueprintName = "TelnyxWebRTCDemo"
ReferencedContainer = "container:WebRTCSDK.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B368BEE725EDDD060032AE52"
BuildableName = "TelnyxWebRTCDemo.app"
BlueprintName = "TelnyxWebRTCDemo"
ReferencedContainer = "container:WebRTCSDK.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
35 changes: 35 additions & 0 deletions fastlane/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Fastlane runs swiftlint from one directory above where the Fastfile lives
# so make sure all the paths are relative in that regard.

# Find all the available rules by running:
# swiftlint rules

opt_in_rules:

included:
- ../WebRTCSDK
- ../WebRTCSDKTests
- ../TelnyxWebRTCDemo

# paths to ignore during linting. Takes precedence over `included`.
excluded:
- Pods
- build
- dist

# configurable rules can be customized from this configuration file
# binary rules can set their severity level
line_length:
warning: 250
error: 400

type_body_length:
warning: 300
error: 400

file_length:
warning: 1000
error: 1500

# reporter type (xcode, json, csv, checkstyle)
reporter: "xcode"
6 changes: 6 additions & 0 deletions fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address


# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile
23 changes: 23 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
default_platform(:ios)

before_all do
sh 'mkdir ../reports || true'
sh 'mkdir ../dist || true'
end

desc "Does a static analysis of the project. Configure the options in .swiftlint.yml"
lane :lint do
swiftlint(
mode: :lint,
output_file: 'reports/swiftlint.txt',
config_file: 'fastlane/.swiftlint.yml'
)
end


desc "Run unit tests."
lane :tests do
run_tests(workspace: "WebRTCSDK.xcworkspace",
devices: ["iPhone 8"],
scheme: "WebRTCSDK")
end
33 changes: 33 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
fastlane documentation
================
# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew install fastlane`

# Available Actions
### lint
```
fastlane lint
```
Does a static analysis of the project. Configure the options in .swiftlint.yml
### tests
```
fastlane tests
```
Run unit tests.

----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

0 comments on commit 2031c7b

Please sign in to comment.