Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44997e6

Browse files
committed
ci: add test, fmt, lint workflows
1 parenteb61235 commit44997e6

24 files changed

+241
-138
lines changed

‎.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name:ci
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
-"README.md"
7+
push:
8+
branches:
9+
-main
10+
paths-ignore:
11+
-"README.md"
12+
13+
14+
permissions:
15+
contents:read
16+
17+
jobs:
18+
test:
19+
name:test
20+
runs-on:${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
21+
steps:
22+
-name:Checkout
23+
uses:actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683# v4.2.2
24+
with:
25+
fetch-depth:1
26+
-name:Switch XCode Version
27+
uses:maxim-lobanov/setup-xcode@v1
28+
with:
29+
xcode-version:'16.0.0'
30+
-run:|
31+
make test
32+
format:
33+
name:fmt
34+
runs-on:${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
35+
steps:
36+
-name:Checkout
37+
uses:actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683# v4.2.2
38+
with:
39+
fetch-depth:1
40+
-run:|
41+
make fmt
42+
lint:
43+
name:lint
44+
runs-on:${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
45+
steps:
46+
-name:Checkout
47+
uses:actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683# v4.2.2
48+
with:
49+
fetch-depth:1
50+
-name:Install Swiftlint
51+
run:|
52+
brew install swiftlint
53+
-run:|
54+
make lint

‎Coder Desktop/.swiftlint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
disabled_rules:
22
-todo
33
-trailing_comma
4+
-blanket_disable_command# Used by Protobuf
5+
-opening_brace# Handled by SwiftFormat
46
type_name:
57
allowed_symbols:"_"
68
identifier_name:
79
allowed_symbols:"_"
10+
min_length:1

‎Coder Desktop/Coder Desktop.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@
721721
CURRENT_PROJECT_VERSION = 1;
722722
DEVELOPMENT_TEAM = 4399GN35BJ;
723723
GENERATE_INFOPLIST_FILE = YES;
724+
MACOSX_DEPLOYMENT_TARGET = 14.6;
724725
MARKETING_VERSION = 1.0;
725726
PRODUCT_BUNDLE_IDENTIFIER = "com.coder.Coder-DesktopUITests";
726727
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -737,6 +738,7 @@
737738
CURRENT_PROJECT_VERSION = 1;
738739
DEVELOPMENT_TEAM = 4399GN35BJ;
739740
GENERATE_INFOPLIST_FILE = YES;
741+
MACOSX_DEPLOYMENT_TARGET = 14.6;
740742
MARKETING_VERSION = 1.0;
741743
PRODUCT_BUNDLE_IDENTIFIER = "com.coder.Coder-DesktopUITests";
742744
PRODUCT_NAME = "$(TARGET_NAME)";

‎Coder Desktop/Coder Desktop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎Coder Desktop/Coder Desktop.xctestplan

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
}
2626
},
2727
{
28+
"enabled" : false,
2829
"parallelizable" : true,
2930
"target" : {
3031
"containerPath" : "container:Coder Desktop.xcodeproj",

‎Coder Desktop/Coder Desktop/Theme.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ enum Theme {
88

99
staticletrectCornerRadius:CGFloat=4
1010
}
11+
1112
staticletdefaultVisibleAgents=5
1213
}

‎Coder Desktop/Coder Desktop/Views/Agents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ struct Agents<VPN: VPNService, S: Session>: View {
66
@StateprivatevarviewAll=false
77
privateletdefaultVisibleRows=5
88

9-
internalletinspection=Inspection<Self>()
9+
letinspection=Inspection<Self>()
1010

1111
varbody:someView{
1212
Group{

‎Coder Desktop/Coder Desktop/Views/LoginForm.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct LoginForm<C: Client, S: Session>: View {
1111
@Stateprivatevarloading:Bool=false
1212
@FocusStateprivatevarfocusedField:LoginField?
1313

14-
internalletinspection=Inspection<Self>()
14+
letinspection=Inspection<Self>()
1515

1616
varbody:someView{
1717
VStack{
@@ -56,7 +56,7 @@ struct LoginForm<C: Client, S: Session>: View {
5656
.onReceive(inspection.notice){self.inspection.visit(self, $0)} // ViewInspector
5757
}
5858

59-
internalfunc submit()async{
59+
func submit()async{
6060
loginError=nil
6161
guard sessionToken!=""else{
6262
loginError=.invalidToken
@@ -67,7 +67,7 @@ struct LoginForm<C: Client, S: Session>: View {
6767
return
6868
}
6969
loading=true
70-
defer{ loading=false}
70+
defer{ loading=false}
7171
letclient=C(url: url, token: sessionToken)
7272
do{
7373
_=tryawait client.user("me")
@@ -135,8 +135,8 @@ struct LoginForm<C: Client, S: Session>: View {
135135
Button("Sign In"){
136136
Task{awaitsubmit()}
137137
}
138-
.buttonStyle(.borderedProminent)
139-
.keyboardShortcut(.defaultAction)
138+
.buttonStyle(.borderedProminent)
139+
.keyboardShortcut(.defaultAction)
140140
}.padding(.top,5)
141141
}
142142
}

‎Coder Desktop/Coder Desktop/Views/Util.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Combine
22

33
// This is required for inspecting stateful views
4-
internalfinalclassInspection<V>{
4+
finalclassInspection<V>{
55
letnotice=PassthroughSubject<UInt,Never>()
66
varcallbacks=[UInt:(V)->Void]()
77

‎Coder Desktop/Coder Desktop/Views/VPNMenu.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ struct VPNMenu<VPN: VPNService, S: Session>: View {
44
@EnvironmentObjectvarvpn:VPN
55
@EnvironmentObjectvarsession:S
66

7-
internalletinspection=Inspection<Self>()
7+
letinspection=Inspection<Self>()
88

99
varbody:someView{
1010
// Main stack

‎Coder Desktop/Coder Desktop/Views/VPNState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SwiftUI
33
structVPNState<VPN:VPNService>:View{
44
@EnvironmentObjectvarvpn:VPN
55

6-
internalletinspection=Inspection<Self>()
6+
letinspection=Inspection<Self>()
77

88
varbody:someView{
99
Group{

‎Coder Desktop/Coder DesktopTests/AgentsTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testableimport Coder_Desktop
2+
import SwiftUI
23
import Testing
34
import ViewInspector
4-
import SwiftUI
55

66
@Suite(.timeLimit(.minutes(1)))
77
structAgentsTests{
@@ -47,7 +47,7 @@ struct AgentsTests {
4747

4848
letforEach=try view.inspect().find(ViewType.ForEach.self)
4949
#expect(forEach.count==Theme.defaultVisibleAgents)
50-
#expect(throws:Never.self){try view.inspect().find(link:"a1.coder")}
50+
#expect(throws:Never.self){try view.inspect().find(link:"a1.coder")}
5151
}
5252

5353
@Test

‎Coder Desktop/Coder DesktopTests/LoginFormTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testableimport Coder_Desktop
2-
import ViewInspector
3-
import Testing
42
import SwiftUI
3+
import Testing
4+
import ViewInspector
55

66
@Suite(.timeLimit(.minutes(1)))
77
structLoginTests{

‎Coder Desktop/Coder DesktopTests/Util.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ struct MockClient: Client {
6767
}
6868

6969
structMockErrorClient:Client{
70-
init(url:URL, token:String?){}
71-
func user(_ ident:String)asyncthrows->Coder_Desktop.User{
70+
init(url _:URL, token _:String?){}
71+
func user(_:String)asyncthrows->Coder_Desktop.User{
7272
throwClientError.badResponse
7373
}
7474
}
7575

76-
extensionInspection:@retroactiveInspectionEmissary{}
76+
extensionInspection:@retroactiveInspectionEmissary{}

‎Coder Desktop/Coder DesktopTests/VPNMenuTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testableimport Coder_Desktop
2+
import SwiftUI
23
import Testing
34
import ViewInspector
4-
import SwiftUI
55

66
@Suite(.timeLimit(.minutes(1)))
77
structVPNMenuTests{

‎Coder Desktop/Coder DesktopTests/VPNStateTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@testableimport Coder_Desktop
2-
import ViewInspector
3-
import Testing
42
import SwiftUI
3+
import Testing
4+
import ViewInspector
55

66
@Suite(.timeLimit(.minutes(1)))
77
structVPNStateTests{

‎Coder Desktop/Coder DesktopUITests/Coder_DesktopUITests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ final class Coder_DesktopUITests: XCTestCase {
77
// In UI tests it is usually best to stop immediately when a failure occurs.
88
continueAfterFailure=false
99

10-
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
10+
// In UI tests it’s important to set the initial state - such as
11+
// interface orientation - required for your tests before they run. The setUp method is a good place to do this.
1112
}
1213

1314
overridefunc tearDownWithError()throws{

‎Coder Desktop/Coder DesktopUITests/Coder_DesktopUITestsLaunchTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import XCTest
22

33
finalclassCoder_DesktopUITestsLaunchTests:XCTestCase{
4-
overrideclassvarrunsForEachTargetApplicationUIConfiguration:Bool{
4+
overridestaticvarrunsForEachTargetApplicationUIConfiguration:Bool{
55
true
66
}
77

‎Coder Desktop/Proto/Receiver.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
2-
import SwiftProtobuf
32
import os
3+
import SwiftProtobuf
44

55
/// An actor that reads data from a `DispatchIO` channel, and deserializes it into VPN protocol messages.
66
actorReceiver<RecvMsg:Message>{
@@ -19,7 +19,7 @@ actor Receiver<RecvMsg: Message> {
1919
privatefunc readLen()asyncthrows->UInt32{
2020
letlenD:Data=tryawaitwithCheckedThrowingContinuation{ continuationin
2121
varlenData=Data()
22-
dispatch.read(offset:0, length:4, queue: queue){done, data, errorin
22+
dispatch.read(offset:0, length:4, queue: queue){done, data, errorin
2323
guard error==0else{
2424
leterrStrPtr=strerror(error)
2525
leterrStr=String(validatingUTF8: errStrPtr!)!
@@ -39,7 +39,7 @@ actor Receiver<RecvMsg: Message> {
3939
privatefunc readMsg(_ length:UInt32)asyncthrows->RecvMsg{
4040
letmsgData:Data=tryawaitwithCheckedThrowingContinuation{ continuationin
4141
varmsgData=Data()
42-
dispatch.read(offset:0, length:Int(length), queue: queue){done, data, errorin
42+
dispatch.read(offset:0, length:Int(length), queue: queue){done, data, errorin
4343
guard error==0else{
4444
leterrStrPtr=strerror(error)
4545
leterrStr=String(validatingUTF8: errStrPtr!)!

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp