Skip to content

Commit

Permalink
Merge pull request #222 from iglance/remove-ui-tests
Browse files Browse the repository at this point in the history
Remove ui tests
  • Loading branch information
D0miH authored Oct 4, 2020
2 parents 028a95c + f70c17d commit ec85ddd
Show file tree
Hide file tree
Showing 31 changed files with 1,245 additions and 158 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
env:
CP_HOME_DIR: ./cocoaPodsHomeDir

# update carthage
- name: execute 'carthage update'
working-directory: ./iGlance/iGlance
run: carthage update
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
# This workflow contains a single job called "lint"
lint:
# The type of runner that the job will run on
runs-on: macos-latest
Expand Down Expand Up @@ -47,6 +47,11 @@ jobs:
run: pod install
env:
CP_HOME_DIR: ./cocoaPodsHomeDir

# update carthage
- name: execute 'carthage update'
working-directory: ./iGlance/iGlance
run: carthage update

# Runs the linting command
- name: run linting command
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This is a basic workflow to help you get started with Actions

name: Tests

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master, development, feature/59-add-tests ]
pull_request:
branches: [ master, development ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test"
test:
# The type of runner that the job will run on
runs-on: macos-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout repository
uses: actions/checkout@v2
with:
submodules: "recursive"

- name: get pods home directory from cache
uses: actions/cache@v1
with:
path: ./iGlance/cocoaPodsHomeDir
key: ${{ runner.os }}--pods-homeDir-key-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}--pods-homeDir-key-
- name: get installed pods from cache
uses: actions/cache@v1
with:
path: ./iGlance/Pods
key: ${{ runner.os }}--pods-key-${{ hashFiles('**/Podfile.lock') }}
restre-keys: |
${{ runner.os }}--pods-key-
# install the necessary pods
- name: execute 'pod install'
working-directory: ./iGlance
run: pod install
env:
CP_HOME_DIR: ./cocoaPodsHomeDir

# update carthage
- name: execute 'carthage update'
working-directory: ./iGlance/iGlance
run: carthage update

# Runs the unit tests
- name: run unit tests
working-directory: ./iGlance
run: xcodebuild test -workspace iGlance.xcworkspace -scheme iGlanceUnitTests -destination 'platform=OS X,arch=x86_64' CODE_SIGN_IDENTITY="" CODE_SIGNING_ALLOWED=NO -verbose
2 changes: 1 addition & 1 deletion iGlance/Libraries/SMCKit
Submodule SMCKit updated 1 files
+1 −1 SMCKit/SMC.swift
1 change: 1 addition & 0 deletions iGlance/iGlance/.swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,4 @@ identifier_name:
- "y2"
excluded:
- Pods
- Carthage
2 changes: 1 addition & 1 deletion iGlance/iGlance/Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "sindresorhus/LaunchAtLogin" "v3.0.0"
github "sindresorhus/LaunchAtLogin" "v3.0.1"
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
E32E9B771EB87EA3000FEEE9 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = E32E9B761EB87EA3000FEEE9 /* main.swift */; };
E32E9B861EB8845E000FEEE9 /* LaunchAtLoginHelper.app in Resources */ = {isa = PBXBuildFile; fileRef = E32E9B741EB87EA3000FEEE9 /* LaunchAtLoginHelper.app */; };
E32E9B931EB889AE000FEEE9 /* copy-helper.sh in Resources */ = {isa = PBXBuildFile; fileRef = E32E9B921EB889AE000FEEE9 /* copy-helper.sh */; };
E3A6EB58249009C3004D7101 /* LaunchAtLogin.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -33,6 +34,7 @@
E32E9B761EB87EA3000FEEE9 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = main.swift; sourceTree = "<group>"; usesTabs = 1; };
E32E9B7F1EB87EA3000FEEE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E32E9B921EB889AE000FEEE9 /* copy-helper.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; lineEnding = 0; path = "copy-helper.sh"; sourceTree = "<group>"; usesTabs = 1; };
E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = LaunchAtLogin.entitlements; path = LaunchAtLogin/LaunchAtLogin.entitlements; sourceTree = "<group>"; };
E3B8C38A20C0003300272EC0 /* LaunchAtLoginHelper.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LaunchAtLoginHelper.entitlements; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -57,6 +59,7 @@
E32E9B591EB87D7B000FEEE9 = {
isa = PBXGroup;
children = (
E3A6EB57249009C3004D7101 /* LaunchAtLogin.entitlements */,
E32E9B651EB87D7B000FEEE9 /* LaunchAtLogin */,
E32E9B751EB87EA3000FEEE9 /* LaunchAtLoginHelper */,
E32E9B641EB87D7B000FEEE9 /* Products */,
Expand Down Expand Up @@ -198,6 +201,7 @@
files = (
E32E9B861EB8845E000FEEE9 /* LaunchAtLoginHelper.app in Resources */,
E32E9B931EB889AE000FEEE9 /* copy-helper.sh in Resources */,
E3A6EB58249009C3004D7101 /* LaunchAtLogin.entitlements in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -378,7 +382,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.0.0;
MARKETING_VERSION = 3.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.sindresorhus.LaunchAtLogin;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -408,7 +412,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 3.0.0;
MARKETING_VERSION = 3.0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.sindresorhus.LaunchAtLogin;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
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.app-sandbox</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ cp -rf "$origin_helper_path" "$helper_dir/"
defaults write "$helper_path/Contents/Info" CFBundleIdentifier -string "$PRODUCT_BUNDLE_IDENTIFIER-LaunchAtLoginHelper"

if [[ -n $CODE_SIGN_ENTITLEMENTS ]]; then
codesign --force --entitlements="$CODE_SIGN_ENTITLEMENTS" --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path"
codesign --force --entitlements="$(dirname "$origin_helper_path")/LaunchAtLogin.entitlements" --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path"
else
codesign --force --options=runtime --sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" "$helper_path"
fi

if [[ $CONFIGURATION == "Release" ]]; then
rm -rf "$origin_helper_path"
rm "$(dirname "$origin_helper_path")/copy-helper.sh"
rm "$(dirname "$origin_helper_path")/LaunchAtLogin.entitlements"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Cocoa
final class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ notification: Notification) {
let bundleId = Bundle.main.bundleIdentifier!
// TODO: Make this more strict by only replacing at the end
let mainBundleId = bundleId.replacingOccurrences(of: "-LaunchAtLoginHelper", with: "")

// Ensure the app is not already running
Expand Down
7 changes: 6 additions & 1 deletion iGlance/iGlance/Carthage/Checkouts/LaunchAtLogin/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ github "sindresorhus/LaunchAtLogin"

## Usage

Add a new ["Run Script Phase"](http://stackoverflow.com/a/39633955/64949) below "Embed Frameworks" in "Build Phases" with the following:
Add a new ["Run Script Phase"](http://stackoverflow.com/a/39633955/64949) **below** "Embed Frameworks" in "Build Phases" with the following:

```sh
"${PROJECT_DIR}/Carthage/Build/Mac/LaunchAtLogin.framework/Resources/copy-helper.sh"
Expand Down Expand Up @@ -52,6 +52,10 @@ The framework bundles the helper app needed to launch your app and copies it int

## FAQ

#### The size of my app increased after adding `LaunchAtLogin`

The bundled launcher app is written in Swift and hence needs to embed the Swift runtime libraries. If your project targets macOS 10.14.4 or later, you can avoid embedding the Swift runtime libraries. First, open `./Carthage/Checkouts/LaunchAtLogin/LaunchAtLogin.xcodeproj` and set the deployment target to the same as your app, and then run `$ carthage build`. You'll have to do this each time you update `LaunchAtLogin`.

#### My app doesn't show up in “System Preferences › Users & Groups › Login Items”

[This is the expected behavior](https://stackoverflow.com/a/15104481/64949), unfortunately.
Expand Down Expand Up @@ -83,6 +87,7 @@ Apple deprecated that API without providing an alternative. Apple engineers have

- [Defaults](https://github.com/sindresorhus/Defaults) - Swifty and modern UserDefaults
- [Preferences](https://github.com/sindresorhus/Preferences) - Add a preferences window to your macOS app in minutes
- [KeyboardShortcuts](https://github.com/sindresorhus/KeyboardShortcuts) - Add user-customizable global keyboard shortcuts to your macOS app
- [DockProgress](https://github.com/sindresorhus/DockProgress) - Show progress in your app's Dock icon
- [create-dmg](https://github.com/sindresorhus/create-dmg) - Create a good-looking DMG for your macOS app in seconds
- [More…](https://github.com/search?q=user%3Asindresorhus+language%3Aswift)
Loading

0 comments on commit ec85ddd

Please sign in to comment.