Skip to content

Commit

Permalink
skip CI build for non formatted libs
Browse files Browse the repository at this point in the history
blocking concurrent workflow execution
  • Loading branch information
michaelpaul committed Dec 9, 2023
1 parent 384986b commit dcf3a66
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
permissions:
contents: read

concurrency:
group: ci-sdk-automation

jobs:
generate:
strategy:
Expand Down Expand Up @@ -48,3 +51,5 @@ jobs:
branch: sdk-automation/models
title: ${{ steps.vars.outputs.pr_title }}
body: ${{ steps.vars.outputs.pr_body }}
commit-message: |
${{ contains(fromJSON('["go", "php", "node"]'), matrix.project) && '[skip ci]' }}[create-pull-request] automated change
67 changes: 32 additions & 35 deletions buildSrc/src/main/groovy/adyen.sdk-automation-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,48 @@ repositories {
mavenCentral()
}

List<Service> services = [
// Payments
new Service(name: 'Checkout', version: 71),
new Service(name: 'Payout', version: 68),
new Service(name: 'Recurring', version: 68, small: true),
new Service(name: 'BinLookup', version: 54, small: true),
// Point of Sale
new Service(name: 'PosTerminalManagement', spec: 'TfmAPIService', version: 1, small: true),
// Management
new Service(name: 'Management', version: 3),
new Service(name: 'BalanceControl', version: 1, small: true),
// Adyen for Platforms
new Service(name: 'LegalEntityManagement', spec: 'LegalEntityService', version: 3),
new Service(name: 'BalancePlatform', version: 2),
new Service(name: 'Transfers', spec: 'TransferService', version: 4),
new Service(name: 'DataProtection', version: 1, small: true),
// Classic Payments
new Service(name: 'Payment', version: 68, small: true),
// Others
new Service(name: 'StoredValue', version: 46, small: true),
new Service(name: 'Disputes', spec: 'DisputeService', version: 30, small: true),
// Webhooks
new Service(name: 'ConfigurationWebhooks', spec: 'BalancePlatformConfigurationNotification', version: 1),
new Service(name: 'AcsWebhooks', spec: 'BalancePlatformAcsNotification', version: 1),
new Service(name: 'ReportWebhooks', spec: 'BalancePlatformReportNotification', version: 1),
new Service(name: 'TransferWebhooks', spec: 'BalancePlatformTransferNotification', version: 4),
new Service(name: 'TransactionWebhooks', spec: 'BalancePlatformTransactionNotification', version: 4),
new Service(name: 'ManagementWebhooks', spec: 'ManagementNotificationService', version: 3),
]

ext {
generator = project.name
templates = 'templates'
services = [
// Payments
new Service(name: 'Checkout', version: 71),
new Service(name: 'Payout', version: 68),
new Service(name: 'Recurring', version: 68, small: true),
new Service(name: 'BinLookup', version: 54, small: true),
// Point of Sale
new Service(name: 'PosTerminalManagement', spec: 'TfmAPIService', version: 1, small: true),
// Management
new Service(name: 'Management', version: 3),
new Service(name: 'BalanceControl', version: 1, small: true),
// Adyen for Platforms
new Service(name: 'LegalEntityManagement', spec: 'LegalEntityService', version: 3),
new Service(name: 'BalancePlatform', version: 2),
new Service(name: 'Transfers', spec: 'TransferService', version: 4),
new Service(name: 'DataProtection', version: 1, small: true),
// Classic Payments
new Service(name: 'Payment', version: 68, small: true),
// Others
new Service(name: 'StoredValue', version: 46, small: true),
new Service(name: 'Disputes', spec: 'DisputeService', version: 30, small: true),
// Webhooks
new Service(name: 'ConfigurationWebhooks', spec: 'BalancePlatformConfigurationNotification', version: 1),
new Service(name: 'AcsWebhooks', spec: 'BalancePlatformAcsNotification', version: 1),
new Service(name: 'ReportWebhooks', spec: 'BalancePlatformReportNotification', version: 1),
new Service(name: 'TransferWebhooks', spec: 'BalancePlatformTransferNotification', version: 4),
new Service(name: 'TransactionWebhooks', spec: 'BalancePlatformTransactionNotification', version: 4),
new Service(name: 'ManagementWebhooks', spec: 'ManagementNotificationService', version: 3),
]
serviceName = ''
removeTags = true
}

def services = project.ext.services as List<Service>

ext {
setProperty('services', services)
smallServices = services.findAll { it.small }
serviceNaming = services.collectEntries { [it.id, it.name] }
}

// Generate a full client for each service
project.ext.services.each { Service svc ->
services.each { Service svc ->
def generate = tasks.register("generate$svc.name", GenerateTask) {
description "Generate a $project.name client for $svc.name."
dependsOn 'clone'
Expand Down
21 changes: 21 additions & 0 deletions dotnet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,24 @@ services.each { Service svc ->

tasks.named(svc.id) { dependsOn deployModels, deployServices, deploySmallService }
}

// Tests
tasks.named('binlookup') {
doLast {
assert file("${layout.projectDirectory}/repo/Adyen/Model/BinLookup/Amount.cs").exists()
assert file("${layout.projectDirectory}/repo/Adyen/Service/BinLookupService.cs").exists()
}
}
tasks.named('checkout') {
doLast {
assert file("${layout.projectDirectory}/repo/Adyen/Model/Checkout/Amount.cs").exists()
assert file("${layout.projectDirectory}/repo/Adyen/Service/Checkout/PaymentsService.cs").exists()
}
}
tasks.named('acswebhooks') {
doLast {
assert file("${layout.projectDirectory}/repo/Adyen/Model/AcsWebhooks/Amount.cs").exists()
assert !file("${layout.projectDirectory}/repo/Adyen/Service/AcsWebhooks").exists()
assert !file("${layout.projectDirectory}/repo/Adyen/Service/AcsWebhooksService.cs").exists()
}
}
10 changes: 5 additions & 5 deletions php/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ project.ext {

def services = project.ext.services as List<Service>
def smallServices = project.ext.smallServices as List<Service>
def serviceNaming = project.ext.serviceNaming as Map<String, String>

// Service renaming
def serviceMapping = services.collectEntries { [it.id, it.name] }
serviceMapping.putAll([
serviceNaming.putAll([
'payment' : 'Payments',
'posterminalmanagement': 'POSTerminalManagement'
])

tasks.withType(GenerateTask).configureEach {
def serviceName = serviceMapping[ext.serviceId as String]
def serviceName = serviceNaming[ext.serviceId as String]
modelPackage.set("Model\\${serviceName}")
apiPackage.set("Service\\${serviceName}")
additionalProperties.putAll([
Expand Down Expand Up @@ -51,15 +51,15 @@ services.findAll({ !it.small }).each { Service svc ->
}

from(layout.buildDirectory.file("$sourcePath/ObjectSerializer.php")) {
into "Model/" + serviceMapping[svc.id]
into "Model/" + serviceNaming[svc.id]
}
}

tasks.named(svc.id) { dependsOn deploy }
}

smallServices.each { Service svc ->
def serviceName = serviceMapping[svc.id] as String
def serviceName = serviceNaming[svc.id]
def deploy = tasks.register("deploy$svc.name", Copy) {
description "Copy $svc.name files into the repo."
dependsOn "generate$svc.name"
Expand Down

0 comments on commit dcf3a66

Please sign in to comment.