Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
Signed-off-by: Ronan Nunes <ronan@uber.com>
  • Loading branch information
Ronan Nunes committed Oct 7, 2019
1 parent d1093e6 commit f31e3eb
Show file tree
Hide file tree
Showing 13 changed files with 14,821 additions and 24 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Tests

on: [push, pull_request]

jobs:
core:
name: Core Tests
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build && Test
run: xcodebuild -workspace Sensazonal.xcworkspace -scheme Core clean build test
- name: Report code coverage
run: bash <(curl -s 'https://codecov.io/bash')

share:
name: Share Tests
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build && Test
run: xcodebuild -workspace Sensazonal.xcworkspace -scheme Share clean build test
- name: Report code coverage
run: bash <(curl -s 'https://codecov.io/bash')

ios:
name: iOS Tests
runs-on: macOS-latest
strategy:
matrix:
destination: ['platform=iOS Simulator,OS=12.4,name=iPhone 8']
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build && Test
run: xcodebuild -workspace Sensazonal.xcworkspace -scheme iOS build test -destination "${destination}"
env:
destination: ${{ matrix.destination }}
- name: Report code coverage
run: bash <(curl -s 'https://codecov.io/bash')
19 changes: 17 additions & 2 deletions Core/Core.xcodeproj/xcshareddata/xcschemes/Core.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Core::Core"
BuildableName = "Core.framework"
BlueprintName = "Core"
ReferencedContainer = "container:Core.xcodeproj">
</BuildableReference>
</MacroExpansion>
</CodeCoverageTargets>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -48,6 +50,17 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Core::Core"
BuildableName = "Core.framework"
BlueprintName = "Core"
ReferencedContainer = "container:Core.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -68,6 +81,8 @@
ReferencedContainer = "container:Core.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Sensazonal

[![Build Status](https://app.bitrise.io/app/09299d7edd3ccd10/status.svg?token=xb0q-N6eez9ENU1o1-0SYQ&branch=master)](https://app.bitrise.io/app/09299d7edd3ccd10) [![Build Status](https://api.cirrus-ci.com/github/ronanrodrigo/Sensazonal.svg)](https://cirrus-ci.com/github/ronanrodrigo/Sensazonal)
[![codebeat badge](https://codebeat.co/badges/ebde7674-9efe-4081-a066-1d2de4e5301a)](https://codebeat.co/projects/github-com-ronanrodrigo-sensazonal-master)
[![codecov](https://codecov.io/gh/ronanrodrigo/Sensazonal/branch/master/graph/badge.svg)](https://codecov.io/gh/ronanrodrigo/Sensazonal)

[![Actions Status](https://github.com/ronanrodrigo/Sensazonal/workflows/Tests/badge.svg)](https://github.com/ronanrodrigo/Sensazonal/actions?workflow=Tests)
[![codebeat badge](https://codebeat.co/badges/ebde7674-9efe-4081-a066-1d2de4e5301a)](https://codebeat.co/projects/github-com-ronanrodrigo-sensazonal-master)
[![codecov](https://codecov.io/gh/ronanrodrigo/Sensazonal/branch/master/graph/badge.svg)](https://codecov.io/gh/ronanrodrigo/Sensazonal/Share)

## Requiremetnts
- Xcode 9.3.0+
- Xcode 11.10+
- Homebrew
- Carthage
- SwiftLint
Expand All @@ -15,4 +13,9 @@
- Clone the repository:
`git clone git@gitlab.com:ronanrodrigo/Sensazonal.git`
- Access the project folder and run setup script:
`./setup`
`./Support/setup `

## Organization
- Core: A cross-platform package, contains protocol definitions and business rules implementation. Not allowed external dependencies here, all code here should run fast and without influence from third party libraries;
- Share: Also a cross-platform package, but implementing some protocols defined at Core (mostly Gateways). Allowed external dependencies here;
- iOS: Platform-specific code, implementing some protocols from Core (mostly Presenters) and using Share and Core to execute the use cases. In the future, there will be versions for macOS, tvOS, shell, web and others.
3 changes: 0 additions & 3 deletions Sensazonal.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions Share/Share.xcodeproj/xcshareddata/xcschemes/Share.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Share::Share"
BuildableName = "Share.framework"
BlueprintName = "Share"
ReferencedContainer = "container:Share.xcodeproj">
</BuildableReference>
</MacroExpansion>
</CodeCoverageTargets>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -48,6 +50,17 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Share::Share"
BuildableName = "Share.framework"
BlueprintName = "Share"
ReferencedContainer = "container:Share.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -68,6 +81,8 @@
ReferencedContainer = "container:Share.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Core
public extension ListFoodInteractorFactory {

static func make(presenter: ListFoodPresenter) -> ListFoodInteractable {
make(presenter: presenter, gateway: ListFoodGatewayFactory.make())
return make(presenter: presenter, gateway: ListFoodGatewayFactory.make())
}

}
1 change: 0 additions & 1 deletion Support/Support/shell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ func shell(_ args: String...) -> Int32 {
task.launch()
task.waitUntilExit()
return task.terminationStatus

}
9 changes: 5 additions & 4 deletions Support/setup
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ install_brew_dependencies() {

install_carthage_dependencies() {
echo "Setup carthage..."
carthage bootstrap --platform iOS
if [ -f "Cartfile" ]; then
carthage bootstrap --platform iOS
fi
}

open_project() {
while true; do
read -p "Open project on Xcode? " yn
case $yn in
[Yy]* ) open Sensazonal.xcodeproj; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
[Yy]* ) xed .; break;;
* ) exit;;
esac
done
}
Expand Down
7 changes: 3 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ignore:
- "ScreenshotsTests"
- "SensazonalScreenshotTests"
- "SensazonalTestUtils"
- "SensazonalUnitTests"
- "**/*Tests"
- "**/*Tests/*"
- "*generated.swift"

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
103 changes: 103 additions & 0 deletions iOS/iOS.xcodeproj/xcshareddata/xcschemes/iOS.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "345B0FD12325470400D1C722"
BuildableName = "Sensazonal.app"
BlueprintName = "iOS"
ReferencedContainer = "container:iOS.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "345B0FD12325470400D1C722"
BuildableName = "Sensazonal.app"
BlueprintName = "iOS"
ReferencedContainer = "container:iOS.xcodeproj">
</BuildableReference>
</CodeCoverageTargets>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "34B5621923260C8500F83D42"
BuildableName = "iOSTests.xctest"
BlueprintName = "iOSTests"
ReferencedContainer = "container:iOS.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</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 = "345B0FD12325470400D1C722"
BuildableName = "Sensazonal.app"
BlueprintName = "iOS"
ReferencedContainer = "container:iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "345B0FD12325470400D1C722"
BuildableName = "Sensazonal.app"
BlueprintName = "iOS"
ReferencedContainer = "container:iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading

0 comments on commit f31e3eb

Please sign in to comment.