Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
d16d786
Update README.md
LiamGuedes Nov 4, 2024
ed945d0
Create objective-c-xcode.yml
LiamGuedes Nov 4, 2024
ed460ab
ci: add essential sh files and start xcodegen project yml for cocoapods
LiamGuedes Nov 5, 2024
6a3441b
Merge branch 'develop' of https://github.com/LiamGuedes/Goals into de…
LiamGuedes Nov 5, 2024
a198234
feat: add xcodegen startup and gitignore
Nov 10, 2024
b71a80b
feat: remove old files
Nov 10, 2024
62067fb
feat: remove xcodeproj
Nov 12, 2024
4176835
feat: update application folder name
Nov 12, 2024
a0643a4
feat: add action
Nov 12, 2024
01d9c93
feat: add xcodegen install
Nov 12, 2024
9189705
ci: fix action empty files
Nov 12, 2024
ecd2d59
ci: update xcodegen script
Nov 12, 2024
3eda603
ci: update project.yml
Nov 12, 2024
5bcf940
ci: specify iphone to run build
Nov 12, 2024
60e34ba
ci: update destination
Nov 12, 2024
9ed2c2d
ci: update script name
Nov 12, 2024
e187bc3
ci: Add test workflow
Nov 12, 2024
26e65f9
ci: update test destination
Nov 12, 2024
327d6ee
ci: update infoplist for action
Nov 12, 2024
70fff43
ci: update test action
Nov 12, 2024
345d8ce
ci: update on step at test action
Nov 12, 2024
4ff2ccc
ci: update target branchs and swift tests
Nov 12, 2024
5e915f7
ci: update derived data path
Nov 12, 2024
d7b81e0
ci: update infoplits path
Nov 12, 2024
4ba453d
ci: Remove derived Data
Nov 12, 2024
d8cc428
ci: fix script
Nov 12, 2024
8f23c19
ci: fix script
Nov 12, 2024
8175c99
ci: Add test step into main workflow
Nov 12, 2024
a1889d9
ci: update infoplist
Nov 12, 2024
fa16037
ci: add bundle version into infoplist
Nov 12, 2024
6367020
ci: Update Bundle Executable
Nov 12, 2024
fb5624a
ci: update info.plist
Nov 12, 2024
3471b18
ci: update test target and action on push
Nov 13, 2024
3c3e3d2
ci: update xcodebuild command
Nov 13, 2024
c223cab
ci: update xcodebuild command
Nov 13, 2024
9950a58
ci: update xcodebuild command
Nov 13, 2024
764d369
ci: update tests and actions
Nov 13, 2024
14660f9
ci: update actions
Nov 13, 2024
e739b92
ci: clean build and remove slather
Nov 13, 2024
0036eea
ci: add coverage
Nov 13, 2024
fb96e8d
ci: improve coverage
Nov 13, 2024
2ff9536
feat: Update tests derived data
Nov 15, 2024
3eef60c
ci: update actions to run tests and move DerivedData to correct path
Nov 18, 2024
62e7017
ci: add lcov
Nov 18, 2024
fc83d11
ci: Add lcov script
Nov 18, 2024
0d30310
ci: update script path
Nov 18, 2024
f64036c
ci: update DerivedData path and remove ls from action
Nov 18, 2024
9524169
ci: update DerivedData path and add ls to localize action
Nov 18, 2024
503cfa9
ci: fix null error in coverage.info
Nov 18, 2024
aff18fe
ci: update comments
Nov 18, 2024
2aa2e9c
ci: remove duplicated context
Nov 18, 2024
34fd69c
ci: update message and fix issues in message
Nov 18, 2024
ab86904
ci: update action file
Nov 18, 2024
820e2fd
ci: update action file
Nov 18, 2024
ed09e36
ci: update action file
Nov 18, 2024
71cd7fa
ci: update comments
Nov 18, 2024
60874be
ci: update comments
Nov 18, 2024
9eeceac
ci: add notify
Nov 18, 2024
6668637
ci: add coverage info
Nov 18, 2024
e40365d
ci: rename coverage file
Nov 18, 2024
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
107 changes: 107 additions & 0 deletions .github/workflows/swift-xcode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Build and Test

on:
push:
branches:
- "develop"
pull_request:
branches:
- "main"

jobs:
build:
name: Build and analyze GoalsApp scheme using xcodebuild command
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Xcodegen
run: brew install xcodegen

- name: Install Swiftlint
run: brew install swiftlint

- name: Move to Application Directory
run: cd Application

- name: Run Xcodegen
run: |
cd Application
xcodegen generate

- name: Set Default Scheme
run: |
cd Application
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'].include?('GoalsApp') ? 'GoalsApp' : JSON.parse(STDIN.gets)['project']['targets'][0]")
echo $default | cat >default
echo Using default scheme: $default

- name: Build
run: |
cd Application
xcodebuild clean build analyze -workspace Goals.xcworkspace -scheme GoalsApp -destination "platform=iOS Simulator,name=iPhone 15,OS=17.0.1" | xcpretty && exit ${PIPESTATUS[0]}

test:
name: Run Tests for GoalsApp
runs-on: macos-latest
needs: build

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Xcodegen
run: brew install xcodegen

- name: Install Swiftlint
run: brew install swiftlint

- name: Install lcov
run: brew install lcov

- name: Move to Application Directory
run: cd Application

- name: Run Xcodegen
run: |
cd Application
xcodegen generate

- name: Run Tests with Coverage
working-directory: ./Application
run: |
xcodebuild test -workspace Goals.xcworkspace -scheme GoalsTests -destination "platform=iOS Simulator,name=iPhone 15,OS=17.0.1" -derivedDataPath DerivedData -enableCodeCoverage YES | xcpretty && exit ${PIPESTATUS[0]}

- name: Generate LCOV report
run: |
chmod +x ./Scripts/generate_lcov.sh
./Scripts/generate_lcov.sh

- name: Check Coverage Threshold
run: |
COVERAGE_PERCENTAGE=$(lcov --summary coverageinfo | grep "lines\.*:" | awk '{print $2}' | sed 's/%//')
if (( $(echo "$COVERAGE_PERCENTAGE < 85" | bc -l) )); then
echo "Code coverage is below 85%! Current: $COVERAGE_PERCENTAGE%"
exit 1
else
echo "Code coverage meets the threshold: $COVERAGE_PERCENTAGE%"
fi

- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: lcov-report
path: coverageinfo

notify:
name: Notify Build Completion
runs-on: ubuntu-latest
needs: test
steps:
- name: Display Coverage Report Link
run: |
echo "Coverage report uploaded successfully."
echo "Download the report from: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts"
41 changes: 10 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## User settings
xcuserdata/
.xcodeproj
.xcworkspace
.DS_Store
DerivedData/

## Obj-C/Swift specific
*.hmap
Expand All @@ -13,49 +17,24 @@ xcuserdata/
*.dSYM.zip
*.dSYM

## Playgrounds
## Builds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

Packages/
Package.pins
Package.resolved
*.xcodeproj
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace
*.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
Expand Down
8 changes: 8 additions & 0 deletions Application/Goals/Debug.entitlements
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>com.apple.security.application-groups</key>
<string>group.atlasomne</string>
</dict>
</plist>
34 changes: 34 additions & 0 deletions Application/Goals/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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>CFBundleIdentifier</key>
<string>atlasomne.Goals</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleExecutable</key>
<string>GoalsApp</string>

<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// AppDelegate.swift
// Goals
//
// Created by Willian Guedes on 04/11/24.
// Created by Willian Guedes on 10/11/24.
//

import UIKit
Expand All @@ -23,6 +23,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
let test = 1

return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SceneDelegate.swift
// Goals
//
// Created by Willian Guedes on 04/11/24.
// Created by Willian Guedes on 10/11/24.
//

import UIKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
// ViewController.swift
// Goals
//
// Created by Willian Guedes on 04/11/24.
// Created by Willian Guedes on 10/11/24.
//

import UIKit

class ViewController: UIViewController {
let enableGravity: Bool = true
var numberOfPlanets: Int = 8
let sunMass: Double = 1.989e30

override func viewDidLoad() {
super.viewDidLoad()
self.numberOfPlanets = 4
// Do any additional setup after loading the view.
}


}

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// GoalsTests.swift
// GoalsTests
//
// Created by Willian Guedes on 04/11/24.
// Created by Willian Guedes on 10/11/24.
//

import XCTest
Expand Down
24 changes: 24 additions & 0 deletions Application/GoalsTests/GoalsTestsInfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// GoalsUITests.swift
// GoalsUITests
//
// Created by Willian Guedes on 04/11/24.
// Created by Willian Guedes on 10/11/24.
//

import XCTest
Expand Down
10 changes: 10 additions & 0 deletions Application/GoalsUITests/GoalsUITestsInfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?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>CFBundleIdentifier</key>
<string>atlasomne.GoalsUITests</string>
<key>CFBundleName</key>
<string>GoalsTests</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// GoalsUITestsLaunchTests.swift
// GoalsUITests
//
// Created by Willian Guedes on 04/11/24.
// Created by Willian Guedes on 10/11/24.
//

import XCTest
Expand Down
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions Application/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'GoalsApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for AtlasGoals
end

target 'GoalsTests' do
inherit! :search_paths
# Pods for testing
end

target 'GoalsUITests' do
# Pods for testing
end


3 changes: 3 additions & 0 deletions Application/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PODFILE CHECKSUM: 1decec9646711ab0dbb24f2ae0c325b44c72dca9

COCOAPODS: 1.16.2
3 changes: 3 additions & 0 deletions Application/Pods/Manifest.lock

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

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

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

Loading