Update GitHub workflows

This commit is contained in:
Nindi Gill 2022-12-08 14:30:00 +11:00
parent 20c96ab2d4
commit 5ec025d8d0
7 changed files with 250 additions and 12 deletions

36
.github/workflows/build_app.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: Build Mist
on: [push, pull_request]
jobs:
build-app:
name: Build Mist
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: swift-actions/setup-swift@v1
- name: Install Apple Developer Application Certificate
env:
APPLE_DEVELOPER_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE }}
APPLE_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
APPLE_DEVELOPER_CERTIFICATE_AUTHORITY: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_AUTHORITY }}
APPLE_DEVELOPER_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_DEVELOPER_KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH="$RUNNER_TEMP/apple-developer-application-certificate.p12"
CERTIFICATE_AUTHORITY_PATH="$RUNNER_TEMP/apple-developer-certificate-authority.cer"
KEYCHAIN_PATH="$RUNNER_TEMP/apple-developer.keychain-db"
echo -n "$APPLE_DEVELOPER_CERTIFICATE" | base64 --decode --output "$CERTIFICATE_PATH"
echo -n "$APPLE_DEVELOPER_CERTIFICATE_AUTHORITY" | base64 --decode --output "$CERTIFICATE_AUTHORITY_PATH"
security create-keychain -p "$APPLE_DEVELOPER_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
security unlock-keychain -p "$APPLE_DEVELOPER_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH"
security import "$CERTIFICATE_PATH" -P "$APPLE_DEVELOPER_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH"
security import "$CERTIFICATE_AUTHORITY_PATH" -P "$APPLE_DEVELOPER_CERTIFICATE_PASSWORD" -A -t cert -f pkcs7 -k "$KEYCHAIN_PATH"
security list-keychain -d user -s "$KEYCHAIN_PATH"
- name: Archive Mist
run: xcodebuild -scheme Mist clean archive -configuration release -archivePath Mist -quiet
- name: Export Mist
run: xcodebuild -exportArchive -archivePath Mist.xcarchive -exportPath Export -exportOptionsPlist ExportOptions.plist
- name: Print Mist version
run: defaults read Export/Mist.app CFBundleShortVersionString
- name: Remove Apple Developer Keychain
if: ${{ always() }}
run: security delete-keychain $RUNNER_TEMP/apple-developer.keychain-db

View file

@ -1,12 +1,11 @@
name: Do all of the things!
name: Lint Codebase
on: [push, pull_request]
jobs:
do-all-of-the-things:
name: Do all of the things!
lint-codebase:
name: Lint Codebase
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: swift-actions/setup-swift@v1
- name: Print SwiftLint version
run: swiftlint --version
- name: Run SwiftLint
@ -23,9 +22,3 @@ jobs:
run: drstring --version
- name: Run DrString
run: drstring check --config-file .drstring.toml
- name: Archive Mist
run: xcodebuild -scheme Mist clean archive -configuration release -archivePath Mist
- name: Export Mist
run: xcodebuild -exportArchive -archivePath Mist.xcarchive -exportPath Export -exportOptionsPlist ExportOptions.plist
- name: Print Mist version
run: defaults read Export/Mist.app CFBundleShortVersionString

10
.github/workflows/run_unit_tests.yml vendored Normal file
View file

@ -0,0 +1,10 @@
name: Run Unit Tests
on: [push, pull_request]
jobs:
run_unit_tests:
name: Run Unit Tests
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Run Unit Tests
run: xcodebuild -scheme MistTests clean test -quiet

View file

@ -96,6 +96,7 @@
398734D4286046B000B4C357 /* UInt32+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 398734D3286046B000B4C357 /* UInt32+Extension.swift */; };
39CB5E3D293F5C2E00CFDBB8 /* Catalog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CB5E3C293F5C2E00CFDBB8 /* Catalog.swift */; };
39CB5E3F2941486D00CFDBB8 /* CatalogSeedType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CB5E3E2941486D00CFDBB8 /* CatalogSeedType.swift */; };
39CB5E5429418A2900CFDBB8 /* MistTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CB5E5329418A2900CFDBB8 /* MistTests.swift */; };
39CF55A028614DD8006FB5D2 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39CF559F28614DD8006FB5D2 /* main.swift */; };
39CF55AA286154A5006FB5D2 /* Blessed in Frameworks */ = {isa = PBXBuildFile; productRef = 39CF55A9286154A5006FB5D2 /* Blessed */; };
39CF55AB286154D1006FB5D2 /* com.ninxsoft.mist.helper in CopyFiles */ = {isa = PBXBuildFile; fileRef = 39CF559D28614DD8006FB5D2 /* com.ninxsoft.mist.helper */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
@ -240,6 +241,8 @@
398734D3286046B000B4C357 /* UInt32+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UInt32+Extension.swift"; sourceTree = "<group>"; };
39CB5E3C293F5C2E00CFDBB8 /* Catalog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Catalog.swift; sourceTree = "<group>"; };
39CB5E3E2941486D00CFDBB8 /* CatalogSeedType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatalogSeedType.swift; sourceTree = "<group>"; };
39CB5E5129418A2900CFDBB8 /* MistTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MistTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
39CB5E5329418A2900CFDBB8 /* MistTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MistTests.swift; sourceTree = "<group>"; };
39CF559D28614DD8006FB5D2 /* com.ninxsoft.mist.helper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = com.ninxsoft.mist.helper; sourceTree = BUILT_PRODUCTS_DIR; };
39CF559F28614DD8006FB5D2 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
39CF55A528614E66006FB5D2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@ -283,6 +286,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
39CB5E4E29418A2900CFDBB8 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
39CF559A28614DD8006FB5D2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@ -301,6 +311,7 @@
390451A82856E1D900E0B563 /* Mist */,
39CF559E28614DD8006FB5D2 /* MistHelperTool */,
39CF55D4286162DC006FB5D2 /* Shared */,
39CB5E5229418A2900CFDBB8 /* MistTests */,
390451A72856E1D900E0B563 /* Products */,
);
sourceTree = "<group>";
@ -310,6 +321,7 @@
children = (
390451A62856E1D900E0B563 /* Mist.app */,
39CF559D28614DD8006FB5D2 /* com.ninxsoft.mist.helper */,
39CB5E5129418A2900CFDBB8 /* MistTests.xctest */,
);
name = Products;
sourceTree = "<group>";
@ -455,6 +467,14 @@
path = Refresh;
sourceTree = "<group>";
};
39CB5E5229418A2900CFDBB8 /* MistTests */ = {
isa = PBXGroup;
children = (
39CB5E5329418A2900CFDBB8 /* MistTests.swift */,
);
path = MistTests;
sourceTree = "<group>";
};
39CF559E28614DD8006FB5D2 /* MistHelperTool */ = {
isa = PBXGroup;
children = (
@ -548,6 +568,23 @@
productReference = 390451A62856E1D900E0B563 /* Mist.app */;
productType = "com.apple.product-type.application";
};
39CB5E5029418A2900CFDBB8 /* MistTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 39CB5E5529418A2900CFDBB8 /* Build configuration list for PBXNativeTarget "MistTests" */;
buildPhases = (
39CB5E4D29418A2900CFDBB8 /* Sources */,
39CB5E4E29418A2900CFDBB8 /* Frameworks */,
39CB5E4F29418A2900CFDBB8 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MistTests;
productName = MistTests;
productReference = 39CB5E5129418A2900CFDBB8 /* MistTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
39CF559C28614DD8006FB5D2 /* MistHelperTool */ = {
isa = PBXNativeTarget;
buildConfigurationList = 39CF55A128614DD8006FB5D2 /* Build configuration list for PBXNativeTarget "MistHelperTool" */;
@ -577,12 +614,15 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1400;
LastSwiftUpdateCheck = 1410;
LastUpgradeCheck = 1410;
TargetAttributes = {
390451A52856E1D900E0B563 = {
CreatedOnToolsVersion = 14.0;
};
39CB5E5029418A2900CFDBB8 = {
CreatedOnToolsVersion = 14.1;
};
39CF559C28614DD8006FB5D2 = {
CreatedOnToolsVersion = 14.0;
};
@ -609,6 +649,7 @@
targets = (
390451A52856E1D900E0B563 /* Mist */,
39CF559C28614DD8006FB5D2 /* MistHelperTool */,
39CB5E5029418A2900CFDBB8 /* MistTests */,
);
};
/* End PBXProject section */
@ -622,6 +663,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
39CB5E4F29418A2900CFDBB8 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
@ -799,6 +847,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
39CB5E4D29418A2900CFDBB8 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
39CB5E5429418A2900CFDBB8 /* MistTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
39CF559928614DD8006FB5D2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -1000,6 +1056,46 @@
};
name = Release;
};
39CB5E5629418A2900CFDBB8 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = 7K3HVCLV7Z;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.ninxsoft.mist.tests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
39CB5E5729418A2900CFDBB8 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = 7K3HVCLV7Z;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.ninxsoft.mist.tests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
};
name = Release;
};
39CF55A228614DD8006FB5D2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -1089,6 +1185,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
39CB5E5529418A2900CFDBB8 /* Build configuration list for PBXNativeTarget "MistTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
39CB5E5629418A2900CFDBB8 /* Debug */,
39CB5E5729418A2900CFDBB8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
39CF55A128614DD8006FB5D2 /* Build configuration list for PBXNativeTarget "MistHelperTool" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View file

@ -39,7 +39,8 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
allowLocationSimulation = "YES"
viewDebuggingEnabled = "No">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference

View file

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39CB5E5029418A2900CFDBB8"
BuildableName = "MistTests.xctest"
BlueprintName = "MistTests"
ReferencedContainer = "container:Mist.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39CB5E5029418A2900CFDBB8"
BuildableName = "MistTests.xctest"
BlueprintName = "MistTests"
ReferencedContainer = "container:Mist.xcodeproj">
</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 = "39CB5E5029418A2900CFDBB8"
BuildableName = "MistTests.xctest"
BlueprintName = "MistTests"
ReferencedContainer = "container:Mist.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

15
MistTests/MistTests.swift Normal file
View file

@ -0,0 +1,15 @@
//
// MistTests.swift
// MistTests
//
// Created by Nindi Gill on 8/12/2022.
//
import XCTest
final class MistTests: XCTestCase {
func test() throws {
XCTAssertTrue(true)
}
}