Skip to content

Commit 1a1b928

Browse files
committed
chore: add git workflows
1 parent de9d0be commit 1a1b928

4 files changed

Lines changed: 73 additions & 38 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Build & Test
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v6
19+
with:
20+
go-version-file: go.mod
21+
22+
- name: Download dependencies
23+
run: go mod download
24+
25+
- name: Verify dependencies
26+
run: go mod verify
27+
28+
- name: Vet
29+
run: go vet ./...
30+
31+
- name: Test
32+
run: go test -race -coverprofile=coverage.out ./...
33+
34+
- name: Build
35+
run: go build -o /dev/null .

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
var (
1414
configFile string
15-
full bool
15+
full bool
1616
)
1717

1818
var rootCmd = &cobra.Command{

internal/sync/payment_integrations.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ func PaymentIntegrationDraftFrom(
7676
}
7777

7878
draft := PaymentIntegrationDraft{
79-
Key: key,
80-
Type: src.Type,
81-
Name: src.Name,
82-
Status: src.Status,
83-
ComponentType: src.ComponentType,
84-
Predicate: src.Predicate,
85-
DisplayInfo: src.DisplayInfo,
86-
SortingInfo: src.SortingInfo,
79+
Key: key,
80+
Type: src.Type,
81+
Name: src.Name,
82+
Status: src.Status,
83+
ComponentType: src.ComponentType,
84+
Predicate: src.Predicate,
85+
DisplayInfo: src.DisplayInfo,
86+
SortingInfo: src.SortingInfo,
8787
AutomatedReversalConfiguration: src.AutomatedReversalConfiguration,
8888
Application: Reference{
8989
ID: targetAppID,
@@ -134,7 +134,7 @@ func BuildPaymentIntegrationUpdateActions(
134134
}
135135
if !reflect.DeepEqual(src.AutomatedReversalConfiguration, tgt.AutomatedReversalConfiguration) {
136136
actions = append(actions, UpdateAction{
137-
"action": "setAutomatedReversalConfiguration",
137+
"action": "setAutomatedReversalConfiguration",
138138
"automatedReversalConfiguration": src.AutomatedReversalConfiguration,
139139
})
140140
}

internal/sync/syncer_test.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ func buildSyncer(t *testing.T, srcHandler, tgtHandler http.HandlerFunc) (*sync.S
8080

8181
func TestApplicationDraftFrom_PreservesAllFields(t *testing.T) {
8282
app := sync.Application{
83-
ID: "src-id",
84-
Version: 3,
85-
Key: "my-app",
86-
Name: "My App",
87-
Mode: "CompleteFlow",
88-
Status: "Active",
89-
Description: sync.LocalizedString{"en": "Desc"},
90-
Logo: &sync.ApplicationLogo{URL: "https://logo.example.com/img.svg"},
91-
Countries: []string{"DE", "FR"},
92-
AllowedOrigins: &sync.AllowedOrigins{AllowAll: false, Origins: []string{"https://demo.com"}},
83+
ID: "src-id",
84+
Version: 3,
85+
Key: "my-app",
86+
Name: "My App",
87+
Mode: "CompleteFlow",
88+
Status: "Active",
89+
Description: sync.LocalizedString{"en": "Desc"},
90+
Logo: &sync.ApplicationLogo{URL: "https://logo.example.com/img.svg"},
91+
Countries: []string{"DE", "FR"},
92+
AllowedOrigins: &sync.AllowedOrigins{AllowAll: false, Origins: []string{"https://demo.com"}},
9393
PaymentsConfiguration: &sync.PaymentsConfiguration{PaymentReturnURL: "https://demo.com/return", ActivePaymentComponentType: "Component"},
9494
DiscountsConfiguration: &sync.DiscountsConfiguration{AllowDiscounts: true},
9595
Agreements: []sync.ApplicationAgreement{
@@ -140,15 +140,15 @@ func TestBuildApplicationUpdateActions_NameChange(t *testing.T) {
140140

141141
func TestBuildApplicationUpdateActions_MultipleChanges(t *testing.T) {
142142
src := &sync.Application{
143-
Key: "k",
144-
Name: "New Name",
145-
Status: "Active",
143+
Key: "k",
144+
Name: "New Name",
145+
Status: "Active",
146146
Countries: []string{"DE"},
147147
}
148148
tgt := &sync.Application{
149-
Key: "k",
150-
Name: "Old Name",
151-
Status: "Inactive",
149+
Key: "k",
150+
Name: "Old Name",
151+
Status: "Inactive",
152152
Countries: []string{"FR"},
153153
}
154154
actions := sync.BuildApplicationUpdateActions(src, tgt)
@@ -300,10 +300,10 @@ func TestDeriveKey_Basic(t *testing.T) {
300300

301301
func TestPaymentIntegrationDraftFrom_TranslatesAppID(t *testing.T) {
302302
src := sync.PaymentIntegration{
303-
Key: "pi-key",
304-
Type: "card",
305-
Name: "Credit Card",
306-
Application: sync.Reference{ID: "src-app-id", TypeID: "application"},
303+
Key: "pi-key",
304+
Type: "card",
305+
Name: "Credit Card",
306+
Application: sync.Reference{ID: "src-app-id", TypeID: "application"},
307307
ConnectorDeployment: &sync.Reference{ID: "src-dep-id", TypeID: "deployment"},
308308
}
309309
mapping := map[string]string{"src-dep-id": "tgt-dep-id"}
@@ -323,8 +323,8 @@ func TestPaymentIntegrationDraftFrom_TranslatesAppID(t *testing.T) {
323323

324324
func TestPaymentIntegrationDraftFrom_NoKeyDerives(t *testing.T) {
325325
src := sync.PaymentIntegration{
326-
Type: "card",
327-
Name: "Credit Card via Adyen",
326+
Type: "card",
327+
Name: "Credit Card via Adyen",
328328
Application: sync.Reference{ID: "src-app-id", TypeID: "application"},
329329
}
330330
draft := sync.PaymentIntegrationDraftFrom(src, "tgt-app-id", nil)
@@ -393,12 +393,12 @@ func makeApp(id, key, version int) sync.Application {
393393
// makePI creates a minimal PaymentIntegration for testing.
394394
func makePI(id int, appID string) sync.PaymentIntegration {
395395
return sync.PaymentIntegration{
396-
ID: fmt.Sprintf("pi-%d", id),
397-
Version: 1,
398-
Key: fmt.Sprintf("pi-key-%d", id),
399-
Name: fmt.Sprintf("PI %d", id),
400-
Type: "card",
401-
Status: "Active",
396+
ID: fmt.Sprintf("pi-%d", id),
397+
Version: 1,
398+
Key: fmt.Sprintf("pi-key-%d", id),
399+
Name: fmt.Sprintf("PI %d", id),
400+
Type: "card",
401+
Status: "Active",
402402
Application: sync.Reference{ID: appID, TypeID: "application"},
403403
}
404404
}

0 commit comments

Comments
 (0)