Skip to content

ci: add test, fmt, lint workflows #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 18, 2024
Merged
Changes from all commits
Commits
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
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: ci

on:
pull_request:
paths-ignore:
- "README.md"
push:
branches:
- main
paths-ignore:
- "README.md"


permissions:
contents: read

jobs:
test:
name: test
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: Switch XCode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.0.0'
- run: |
make test
format:
name: fmt
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- run: |
make fmt
lint:
name: lint
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: Install Swiftlint
run: |
brew install swiftlint
- run: |
make lint
3 changes: 3 additions & 0 deletions Coder Desktop/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
disabled_rules:
- todo
- trailing_comma
- blanket_disable_command # Used by Protobuf
- opening_brace # Handled by SwiftFormat
type_name:
allowed_symbols: "_"
identifier_name:
allowed_symbols: "_"
min_length: 1
112 changes: 69 additions & 43 deletions Coder Desktop/Coder Desktop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -9,12 +9,14 @@
/* Begin PBXBuildFile section */
961679332CFF117300B2B6DF /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 961679322CFF117300B2B6DF /* NetworkExtension.framework */; };
9616793D2CFF117300B2B6DF /* com.coder.Coder-Desktop.VPN.systemextension in Embed System Extensions */ = {isa = PBXBuildFile; fileRef = 961679302CFF117300B2B6DF /* com.coder.Coder-Desktop.VPN.systemextension */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
961679532CFF207900B2B6DF /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = 961679522CFF207900B2B6DF /* SwiftProtobuf */; };
961679552CFF207900B2B6DF /* SwiftProtobufPluginLibrary in Frameworks */ = {isa = PBXBuildFile; productRef = 961679542CFF207900B2B6DF /* SwiftProtobufPluginLibrary */; };
AA071D2C2D1041A7008D0B72 /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = 961679E22D03144900B2B6DF /* SwiftProtobuf */; };
AA071D2D2D1041A7008D0B72 /* SwiftProtobufPluginLibrary in Frameworks */ = {isa = PBXBuildFile; productRef = 961679E42D03144C00B2B6DF /* SwiftProtobufPluginLibrary */; };
AA8BC3392D0060A900E1ABAA /* ViewInspector in Frameworks */ = {isa = PBXBuildFile; productRef = AA8BC3382D0060A900E1ABAA /* ViewInspector */; };
AA8BC33F2D0061F200E1ABAA /* FluidMenuBarExtra in Frameworks */ = {isa = PBXBuildFile; productRef = AA8BC33E2D0061F200E1ABAA /* FluidMenuBarExtra */; };
AA8BC4CF2D00A4B700E1ABAA /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = AA8BC4CE2D00A4B700E1ABAA /* KeychainAccess */; };
AAD720D02D0816B200F6304D /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = AAD720CF2D0816B200F6304D /* Alamofire */; };
961679532CFF207900B2B6DF /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = 961679522CFF207900B2B6DF /* SwiftProtobuf */; };
961679552CFF207900B2B6DF /* SwiftProtobufPluginLibrary in Frameworks */ = {isa = PBXBuildFile; productRef = 961679542CFF207900B2B6DF /* SwiftProtobufPluginLibrary */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
@@ -86,6 +88,13 @@
);
target = 9616792F2CFF117300B2B6DF /* VPN */;
};
AA071D842D1041E9008D0B72 /* Exceptions for "Proto" folder in "Coder Desktop" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
vpn.proto,
);
target = 961678FB2CFF100D00B2B6DF /* Coder Desktop */;
};
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
@@ -115,6 +124,7 @@
961679432CFF149000B2B6DF /* Proto */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
AA071D842D1041E9008D0B72 /* Exceptions for "Proto" folder in "Coder Desktop" target */,
961679472CFF14EA00B2B6DF /* Exceptions for "Proto" folder in "VPN" target */,
);
path = Proto;
@@ -159,9 +169,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
961679E52D03144C00B2B6DF /* SwiftProtobufPluginLibrary in Frameworks */,
AA071D2D2D1041A7008D0B72 /* SwiftProtobufPluginLibrary in Frameworks */,
AA071D2C2D1041A7008D0B72 /* SwiftProtobuf in Frameworks */,
961679332CFF117300B2B6DF /* NetworkExtension.framework in Frameworks */,
961679E32D03144900B2B6DF /* SwiftProtobuf in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -345,7 +355,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1610;
LastUpgradeCheck = 1610;
LastUpgradeCheck = 1620;
TargetAttributes = {
961678FB2CFF100D00B2B6DF = {
CreatedOnToolsVersion = 16.1;
@@ -490,15 +500,15 @@
target = 9616792F2CFF117300B2B6DF /* VPN */;
targetProxy = 9616793B2CFF117300B2B6DF /* PBXContainerItemProxy */;
};
AA8BC33C2D0060E700E1ABAA /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = AA8BC33B2D0060E700E1ABAA /* SwiftLintBuildToolPlugin */;
};
961679DE2D030E1D00B2B6DF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 961678FB2CFF100D00B2B6DF /* Coder Desktop */;
targetProxy = 961679DD2D030E1D00B2B6DF /* PBXContainerItemProxy */;
};
AA8BC33C2D0060E700E1ABAA /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = AA8BC33B2D0060E700E1ABAA /* SwiftLintBuildToolPlugin */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
@@ -536,6 +546,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -562,6 +573,7 @@
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 6.0;
};
name = Debug;
};
@@ -599,6 +611,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -617,6 +630,7 @@
MTL_FAST_MATH = YES;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_VERSION = 6.0;
};
name = Release;
};
@@ -629,6 +643,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Coder Desktop/Preview Content\"";
DEVELOPMENT_TEAM = 4399GN35BJ;
ENABLE_HARDENED_RUNTIME = YES;
@@ -658,6 +673,7 @@
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Coder Desktop/Preview Content\"";
DEVELOPMENT_TEAM = 4399GN35BJ;
ENABLE_HARDENED_RUNTIME = YES;
@@ -684,14 +700,15 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4399GN35BJ;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.coder.Coder-DesktopTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Coder Desktop.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Coder Desktop";
};
name = Debug;
@@ -702,14 +719,15 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4399GN35BJ;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.coder.Coder-DesktopTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Coder Desktop.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Coder Desktop";
};
name = Release;
@@ -719,13 +737,15 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4399GN35BJ;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.6;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.coder.Coder-DesktopUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TEST_TARGET_NAME = "Coder Desktop";
};
name = Debug;
@@ -735,13 +755,15 @@
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4399GN35BJ;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.6;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = "com.coder.Coder-DesktopUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TEST_TARGET_NAME = "Coder Desktop";
};
name = Release;
@@ -752,6 +774,7 @@
CODE_SIGN_ENTITLEMENTS = VPN/VPN.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4399GN35BJ;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
@@ -768,7 +791,7 @@
PRODUCT_NAME = "$(inherited)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Debug;
};
@@ -778,6 +801,7 @@
CODE_SIGN_ENTITLEMENTS = VPN/VPN.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4399GN35BJ;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = YES;
@@ -794,7 +818,7 @@
PRODUCT_NAME = "$(inherited)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
};
name = Release;
};
@@ -804,6 +828,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4399GN35BJ;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
@@ -821,6 +846,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 4399GN35BJ;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
@@ -892,6 +918,14 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/apple/swift-protobuf.git";
requirement = {
kind = exactVersion;
version = 1.28.2;
};
};
AA8BC3372D00609700E1ABAA /* XCRemoteSwiftPackageReference "ViewInspector" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nalexn/ViewInspector";
@@ -932,17 +966,29 @@
minimumVersion = 5.10.2;
};
};
961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/apple/swift-protobuf.git";
requirement = {
kind = exactVersion;
version = 1.28.2;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
961679522CFF207900B2B6DF /* SwiftProtobuf */ = {
isa = XCSwiftPackageProductDependency;
package = 961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */;
productName = SwiftProtobuf;
};
961679542CFF207900B2B6DF /* SwiftProtobufPluginLibrary */ = {
isa = XCSwiftPackageProductDependency;
package = 961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */;
productName = SwiftProtobufPluginLibrary;
};
961679E22D03144900B2B6DF /* SwiftProtobuf */ = {
isa = XCSwiftPackageProductDependency;
package = 961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */;
productName = SwiftProtobuf;
};
961679E42D03144C00B2B6DF /* SwiftProtobufPluginLibrary */ = {
isa = XCSwiftPackageProductDependency;
package = 961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */;
productName = SwiftProtobufPluginLibrary;
};
AA8BC3382D0060A900E1ABAA /* ViewInspector */ = {
isa = XCSwiftPackageProductDependency;
package = AA8BC3372D00609700E1ABAA /* XCRemoteSwiftPackageReference "ViewInspector" */;
@@ -968,26 +1014,6 @@
package = AAD720CE2D0816B200F6304D /* XCRemoteSwiftPackageReference "Alamofire" */;
productName = Alamofire;
};
961679522CFF207900B2B6DF /* SwiftProtobuf */ = {
isa = XCSwiftPackageProductDependency;
package = 961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */;
productName = SwiftProtobuf;
};
961679542CFF207900B2B6DF /* SwiftProtobufPluginLibrary */ = {
isa = XCSwiftPackageProductDependency;
package = 961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */;
productName = SwiftProtobufPluginLibrary;
};
961679E22D03144900B2B6DF /* SwiftProtobuf */ = {
isa = XCSwiftPackageProductDependency;
package = 961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */;
productName = SwiftProtobuf;
};
961679E42D03144C00B2B6DF /* SwiftProtobufPluginLibrary */ = {
isa = XCSwiftPackageProductDependency;
package = 961679512CFF207900B2B6DF /* XCRemoteSwiftPackageReference "swift-protobuf" */;
productName = SwiftProtobufPluginLibrary;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 961678F42CFF100D00B2B6DF /* Project object */;
Loading