Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: CI Build
# Run for any commits to any branch
on: [push, pull_request]


env:
LANG: en_US.UTF-8
# CodeClimate
Expand Down Expand Up @@ -33,7 +32,7 @@ jobs:
- name: Run tests
uses: maierj/[email protected]
with:
lane: debug_develop
lane: run_test_suite

- name: Send test coverage report
run: ./cc-test-reporter after-build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Develop Release
on:
push:
branches:
- develop
- master

env:
LANG: en_US.UTF-8
Expand All @@ -30,11 +30,11 @@ env:
APP_STORE_CONNECT_API_KEY_FILE: ${{ secrets.APP_STORE_CONNECT_API_KEY_FILE }}
# Notifications
SLACK_URL: ${{ secrets.SLACK_URL }}
SLACK_CHANNEL: '#dev-releases'
SLACK_CHANNEL: '#dev-builds'

jobs:
ios:
runs-on: macmini
runs-on: macos-latest
timeout-minutes: 45

steps:
Expand Down
59 changes: 53 additions & 6 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ default_platform(:ios)

# CONFIG VARIABLES
app_name = 'ios-base'
workspace = app_name+'.xcworkspace'
team_id = ENV["APPLE_TEAM_ID"] # The organization's team id in the Apple Developer portal
cert = ENV["APPLE_CERT"] # Local path to distribution certificate file to be used for signing the build
key = ENV["APPLE_KEY"] # Private key (.p12 file) used for encrypting certificate
Expand All @@ -36,12 +37,50 @@ folder = ENV["FOLDER"] #

# Slack
slack_channel = ENV["SLACK_CHANNEL"] # Slack webhook url and channel name for sending notifications upon completion
slack_url = ENV["SLACK_URL"] #

slack_url = ENV["SLACK_URL"]

# Google
google_services_file = "GoogleService-Info.plist"
google_services_file_path = "#{app_name}/Resources/#{google_services_file}"

platform :ios do

before_all do |lane|
build_lanes = %i[
build_and_sign
run_test_suite
]

if build_lanes.include?(lane)
bundle_install
cocoapods(repo_update: true)
setup_google_services
end
end

# This lane will fetch the Google secrets file from S3.
# If your app uses Google services, like Firebase, this lane must be
# executed before building the application.
lane :setup_google_services do
s3_download(
access_key_id: s3_key,
secret_access_key: s3_secret_key,
bucket: s3_bucket,
file_name: google_services_file,
output_path: google_services_file_path
)
end

# Execute this lane if you want to update the Google secrets file on the S3 bucket
lane :update_remote_google_services do
s3_upload(
access_key_id: s3_key,
secret_access_key: s3_secret_key,
bucket: s3_bucket,
content_path: google_services_file_path
)
end

lane :set_signing do
# Create keychain - (Travis setup works for GitHhub Actions too)
setup_ci(
Expand Down Expand Up @@ -72,11 +111,9 @@ platform :ios do

lane :build_and_sign do |options|
set_signing
# pod install
cocoapods
gym(
scheme: options[:scheme],
workspace: app_name+'.xcworkspace',
workspace: workspace,
export_method: options[:method],
export_options: {iCloudContainerEnvironment: 'Production'},
clean: true,
Expand Down Expand Up @@ -161,7 +198,17 @@ platform :ios do
)
end

#DEVELOP
# TESTING
lane :run_test_suite do
scan(
workspace: workspace,
scheme: app_name+"-develop",
devices: ["iPhone 13 Pro"],
code_coverage: true
)
end

#DEVELOP
lane :build_develop do
build_and_sign(
scheme: app_name+'-develop',
Expand Down
3 changes: 2 additions & 1 deletion fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-aws_s3'
gem 'fastlane-plugin-aws_s3'
gem 'fastlane-plugin-s3_actions'
16 changes: 2 additions & 14 deletions ios-baseUITests/ios_baseUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import XCTest
@testable import ios_base_Debug

class ios_baseUITests: XCTestCase {

Expand All @@ -21,6 +20,8 @@ class ios_baseUITests: XCTestCase {
app.launchArguments = ["Automation Test"]

try? networkMocker.setUp()
networkMocker.stubLogOut()
app.logOutIfNeeded(in: self)
}

override func tearDown() {
Expand Down Expand Up @@ -86,13 +87,6 @@ class ios_baseUITests: XCTestCase {

alert.buttons.allElementsBoundByIndex.first?.tap()
}

let logOutButton = app.buttons["LogoutButton"]
waitFor(element: logOutButton, timeOut: 5)

networkMocker.stubLogOut()

logOutButton.tap()
}

func testSignInSuccess() {
Expand All @@ -106,12 +100,6 @@ class ios_baseUITests: XCTestCase {

let logOutButton = app.buttons["LogoutButton"]
waitFor(element: logOutButton, timeOut: 10)

networkMocker.stubLogOut()
logOutButton.forceTap()

let goToSignInButton = app.buttons["GoToSignInButton"]
waitFor(element: goToSignInButton, timeOut: 10)
}

func testSignInFailure() {
Expand Down