Skip to content

[CI] Add GHA CI and release flow #340

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 23 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
15 changes: 15 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
changelog:
categories:
- title: SemVer Major
labels:
- ⚠️ semver/major
- title: SemVer Minor
labels:
- semver/minor
- title: SemVer Patch
labels:
- semver/patch
- title: Other Changes
labels:
- semver/none
- "*"
27 changes: 27 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PR

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
soundness:
name: Soundness
uses: apple/swift-nio/.github/workflows/soundness.yml@main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it on purpose that we reference files from Swift NIO project ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes!

with:
license_header_check_project_name: "SwiftAWSLambdaRuntime"
shell_check_enabled: false

unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_8_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"

swift-6-language-mode:
name: Swift 6 Language Mode
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main
32 changes: 32 additions & 0 deletions .licenseignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.gitignore
.licenseignore
.swiftformatignore
.spi.yml
.swift-format
.github/*
*.md
**/*.md
CONTRIBUTORS.txt
LICENSE.txt
NOTICE.txt
Package.swift
Package@swift-*.swift
Package.resolved
**/*.docc/*
**/.gitignore
**/Package.swift
**/Package.resolved
**/docker-compose*.yaml
**/docker/*
**/.dockerignore
**/Dockerfile
**/Makefile
**/*.html
**/*-template.yml
**/*.xcworkspace/*
**/*.xcodeproj/*
**/*.xcassets/*
**/*.appiconset/*
**/ResourcePackaging/hello.txt
.mailmap
.swiftformat
62 changes: 62 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"version" : 1,
"indentation" : {
"spaces" : 4
},
"tabWidth" : 4,
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"spacesAroundRangeFormationOperators" : false,
"indentConditionalCompilationBlocks" : false,
"indentSwitchCaseLabels" : false,
"lineBreakAroundMultilineExpressionChainComponents" : false,
"lineBreakBeforeControlFlowKeywords" : false,
"lineBreakBeforeEachArgument" : true,
"lineBreakBeforeEachGenericRequirement" : true,
"lineLength" : 120,
"maximumBlankLines" : 1,
"respectsExistingLineBreaks" : true,
"prioritizeKeepingFunctionOutputTogether" : true,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : false,
"AlwaysUseLiteralForEmptyCollectionInit" : false,
"AlwaysUseLowerCamelCase" : false,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : false,
"NeverUseForceTry" : false,
"NeverUseImplicitlyUnwrappedOptionals" : false,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoAssignmentInExpressions" : true,
"NoBlockComments" : true,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : true,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OmitExplicitReturns" : true,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : true,
"OrderedImports" : true,
"ReplaceForEachWithForLoop" : true,
"ReturnVoidInsteadOfEmptyTuple" : true,
"UseEarlyExits" : false,
"UseExplicitNilCheckInConditions" : false,
"UseLetInEveryBoundCaseVariable" : false,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : false,
"UseSynthesizedInitializer" : false,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : false,
"ValidateDocumentationComments" : false
}
}
19 changes: 0 additions & 19 deletions .swiftformat

This file was deleted.

15 changes: 8 additions & 7 deletions Examples/Benchmark/Package.swift
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
// swift-tools-version:5.7

import class Foundation.ProcessInfo // needed for CI to test the local version of the library
import PackageDescription

import class Foundation.ProcessInfo // needed for CI to test the local version of the library

let package = Package(
name: "swift-aws-lambda-runtime-example",
platforms: [
.macOS(.v12),
.macOS(.v12)
],
products: [
.executable(name: "MyLambda", targets: ["MyLambda"]),
.executable(name: "MyLambda", targets: ["MyLambda"])
],
dependencies: [
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha"),
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha")
],
targets: [
.executableTarget(
name: "MyLambda",
dependencies: [
.product(name: "AWSLambdaRuntimeCore", package: "swift-aws-lambda-runtime"),
.product(name: "AWSLambdaRuntimeCore", package: "swift-aws-lambda-runtime")
],
path: "."
),
)
]
)

// for CI to test the local version of the library
if ProcessInfo.processInfo.environment["LAMBDA_USE_LOCAL_DEPS"] != nil {
package.dependencies = [
.package(name: "swift-aws-lambda-runtime", path: "../.."),
.package(name: "swift-aws-lambda-runtime", path: "../..")
]
}
27 changes: 17 additions & 10 deletions Examples/Deployment/Package.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// swift-tools-version:5.7

import class Foundation.ProcessInfo // needed for CI to test the local version of the library
import PackageDescription

import class Foundation.ProcessInfo // needed for CI to test the local version of the library

let package = Package(
name: "swift-aws-lambda-runtime-samples",
platforms: [
.macOS(.v12),
.macOS(.v12)
],
products: [
// introductory example
Expand All @@ -16,21 +17,27 @@ let package = Package(
// demonstrate different types of error handling
],
dependencies: [
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha"),
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha")
],
targets: [
.executableTarget(name: "Benchmark", dependencies: [
.product(name: "AWSLambdaRuntimeCore", package: "swift-aws-lambda-runtime"),
]),
.executableTarget(name: "HelloWorld", dependencies: [
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
]),
.executableTarget(
name: "Benchmark",
dependencies: [
.product(name: "AWSLambdaRuntimeCore", package: "swift-aws-lambda-runtime")
]
),
.executableTarget(
name: "HelloWorld",
dependencies: [
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime")
]
),
]
)

// for CI to test the local version of the library
if ProcessInfo.processInfo.environment["LAMBDA_USE_LOCAL_DEPS"] != nil {
package.dependencies = [
.package(name: "swift-aws-lambda-runtime", path: "../.."),
.package(name: "swift-aws-lambda-runtime", path: "../..")
]
}
15 changes: 8 additions & 7 deletions Examples/Echo/Package.swift
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
// swift-tools-version:5.7

import class Foundation.ProcessInfo // needed for CI to test the local version of the library
import PackageDescription

import class Foundation.ProcessInfo // needed for CI to test the local version of the library

let package = Package(
name: "swift-aws-lambda-runtime-example",
platforms: [
.macOS(.v12),
.macOS(.v12)
],
products: [
.executable(name: "MyLambda", targets: ["MyLambda"]),
.executable(name: "MyLambda", targets: ["MyLambda"])
],
dependencies: [
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha"),
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha")
],
targets: [
.executableTarget(
name: "MyLambda",
dependencies: [
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime")
],
path: "."
),
)
]
)

// for CI to test the local version of the library
if ProcessInfo.processInfo.environment["LAMBDA_USE_LOCAL_DEPS"] != nil {
package.dependencies = [
.package(name: "swift-aws-lambda-runtime", path: "../.."),
.package(name: "swift-aws-lambda-runtime", path: "../..")
]
}
15 changes: 8 additions & 7 deletions Examples/ErrorHandling/Package.swift
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
// swift-tools-version:5.7

import class Foundation.ProcessInfo // needed for CI to test the local version of the library
import PackageDescription

import class Foundation.ProcessInfo // needed for CI to test the local version of the library

let package = Package(
name: "swift-aws-lambda-runtime-example",
platforms: [
.macOS(.v12),
.macOS(.v12)
],
products: [
.executable(name: "MyLambda", targets: ["MyLambda"]),
.executable(name: "MyLambda", targets: ["MyLambda"])
],
dependencies: [
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha"),
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha")
],
targets: [
.executableTarget(
name: "MyLambda",
dependencies: [
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime")
],
path: "."
),
)
]
)

// for CI to test the local version of the library
if ProcessInfo.processInfo.environment["LAMBDA_USE_LOCAL_DEPS"] != nil {
package.dependencies = [
.package(name: "swift-aws-lambda-runtime", path: "../.."),
.package(name: "swift-aws-lambda-runtime", path: "../..")
]
}
Loading
Loading