Skip to content

Commit

Permalink
Merge pull request #30 from elegantchaos/new-tests
Browse files Browse the repository at this point in the history
Added more complete test action
  • Loading branch information
samdeane authored Feb 21, 2020
2 parents 5ad1a49 + 6acced2 commit ae19e45
Show file tree
Hide file tree
Showing 4 changed files with 224 additions and 19 deletions.
121 changes: 121 additions & 0 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Tests

on: [push, pull_request]

jobs:
macOS-iOS-tvOS-watchOS:
name: macOS/iOS/tvOS/watchOS
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Swift Version
run: swift --version
- name: Make Logs Directory
run: mkdir logs
- name: Xcode Version
run: xcodebuild -version
- name: XC Pretty
run: sudo gem install xcpretty-travis-formatter
- name: Build (macOS/Debug)
run: set -o pipefail; xcodebuild clean build -workspace . -scheme DictionaryCoding -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-macOS-build-debug.log | xcpretty
- name: Build (macOS/Release)
run: set -o pipefail; xcodebuild clean build -workspace . -scheme DictionaryCoding -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-macOS-build-release.log | xcpretty
- name: Test (macOS/Debug)
run: |
GOTPACKAGE=$(xcodebuild -workspace . -list | (grep DictionaryCoding-Package || true))
echo "*$GOTPACKAGE*"
if [[ $GOTPACKAGE != "" ]]
then
SCHEME="DictionaryCoding-Package"
else
SCHEME="DictionaryCoding"
fi
set -o pipefail
xcodebuild test -workspace . -scheme $SCHEME -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-macOS-test-debug.log | xcpretty
- name: Test (macOS/Release)
run: |
GOTPACKAGE=$(xcodebuild -workspace . -list | (grep DictionaryCoding-Package || true))
echo "*$GOTPACKAGE*"
if [[ $GOTPACKAGE != "" ]]
then
SCHEME="DictionaryCoding-Package"
else
SCHEME="DictionaryCoding"
fi
set -o pipefail
xcodebuild test -workspace . -scheme $SCHEME -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_TESTABILITY=YES | tee logs/xcodebuild-macOS-test-release.log | xcpretty
- name: Build (iOS/Debug)
run: set -o pipefail; xcodebuild clean build -workspace . -scheme DictionaryCoding -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-iOS-build-debug.log | xcpretty
- name: Build (iOS/Release)
run: set -o pipefail; xcodebuild clean build -workspace . -scheme DictionaryCoding -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-iOS-build-release.log | xcpretty
- name: Test (iOS/Debug)
run: |
GOTPACKAGE=$(xcodebuild -workspace . -list | (grep DictionaryCoding-Package || true))
echo "*$GOTPACKAGE*"
if [[ $GOTPACKAGE != "" ]]
then
SCHEME="DictionaryCoding-Package"
else
SCHEME="DictionaryCoding"
fi
set -o pipefail
xcodebuild test -workspace . -scheme $SCHEME -destination "name=iPhone 11" -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-iOS-test-debug.log | xcpretty
- name: Test (iOS/Release)
run: |
GOTPACKAGE=$(xcodebuild -workspace . -list | (grep DictionaryCoding-Package || true))
echo "*$GOTPACKAGE*"
if [[ $GOTPACKAGE != "" ]]
then
SCHEME="DictionaryCoding-Package"
else
SCHEME="DictionaryCoding"
fi
set -o pipefail
xcodebuild test -workspace . -scheme $SCHEME -destination "name=iPhone 11" -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_TESTABILITY=YES | tee logs/xcodebuild-iOS-test-release.log | xcpretty
- name: Build (tvOS/Debug)
run: set -o pipefail; xcodebuild clean build -workspace . -scheme DictionaryCoding -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-tvOS-build-debug.log | xcpretty
- name: Build (tvOS/Release)
run: set -o pipefail; xcodebuild clean build -workspace . -scheme DictionaryCoding -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-tvOS-build-release.log | xcpretty
- name: Test (tvOS/Debug)
run: |
GOTPACKAGE=$(xcodebuild -workspace . -list | (grep DictionaryCoding-Package || true))
echo "*$GOTPACKAGE*"
if [[ $GOTPACKAGE != "" ]]
then
SCHEME="DictionaryCoding-Package"
else
SCHEME="DictionaryCoding"
fi
set -o pipefail
xcodebuild test -workspace . -scheme $SCHEME -destination "name=Apple TV" -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-tvOS-test-debug.log | xcpretty
- name: Test (tvOS/Release)
run: |
GOTPACKAGE=$(xcodebuild -workspace . -list | (grep DictionaryCoding-Package || true))
echo "*$GOTPACKAGE*"
if [[ $GOTPACKAGE != "" ]]
then
SCHEME="DictionaryCoding-Package"
else
SCHEME="DictionaryCoding"
fi
set -o pipefail
xcodebuild test -workspace . -scheme $SCHEME -destination "name=Apple TV" -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ENABLE_TESTABILITY=YES | tee logs/xcodebuild-tvOS-test-release.log | xcpretty
- name: Build (watchOS/Debug)
run: set -o pipefail; xcodebuild clean build -workspace . -scheme DictionaryCoding -configuration Debug CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-watchOS-build-debug.log | xcpretty
- name: Build (watchOS/Release)
run: set -o pipefail; xcodebuild clean build -workspace . -scheme DictionaryCoding -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | tee logs/xcodebuild-watchOS-build-release.log | xcpretty
- name: Upload Logs
uses: actions/upload-artifact@v1
with:
name: logs
path: logs
- name: Slack Notification
uses: elegantchaos/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: 'macOS/iOS/tvOS/watchOS'
mention_if: 'failure'
url: ${{ secrets.SLACK_WEBHOOK }}

19 changes: 0 additions & 19 deletions .github/workflows/swift.yml

This file was deleted.

91 changes: 91 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/DictionaryCoding.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DictionaryCoding"
BuildableName = "DictionaryCoding"
BlueprintName = "DictionaryCoding"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DictionaryCodingTests"
BuildableName = "DictionaryCodingTests"
BlueprintName = "DictionaryCodingTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DictionaryCodingTests"
BuildableName = "DictionaryCodingTests"
BlueprintName = "DictionaryCodingTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</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">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DictionaryCoding"
BuildableName = "DictionaryCoding"
BlueprintName = "DictionaryCoding"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
[![Test results][tests shield]][actions] [![Latest release][release shield]][releases] [![Swift 5.0][swift shield]][swift] ![Platforms: iOS, macOS, tvOS, watchOS, Linux][platforms shield]

[swift]: https://swift.org

[releases]: https://github.com/elegantchaos/DictionaryCoding/releases
[actions]: https://github.com/elegantchaos/DictionaryCoding/actions

[release shield]: https://img.shields.io/github/v/release/elegantchaos/DictionaryCoding
[swift shield]: https://img.shields.io/badge/swift-5.0-F05138.svg "Swift 5.0"
[platforms shield]: https://img.shields.io/badge/platforms-iOS_macOS_tvOS_watchOS_Linux-lightgrey.svg?style=flat "iOS, macOS, tvOS, watchOS, Linux"
[tests shield]: https://github.com/elegantchaos/DictionaryCoding/workflows/Tests/badge.svg

# DictionaryCoding

This is an implementation of Swift's Encoder/Decoder protocols which uses `NSDictionary` as its underlying container mechanism.
Expand Down

0 comments on commit ae19e45

Please sign in to comment.