forked from apple/swift-nio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'apple/main'
* apple/main: (26 commits) [GHA] Only format Swift files that are in Git index (apple#2797) Ignore format commit from git blame (apple#2796) Adopt swift-format (apple#2794) Disable warnings as errors on Swift 6 and main (apple#2793) ChannelHandler: provide static (un)wrap(In|Out)bound(In|Out) (apple#2791) Add manual control to NIOLockedValueBox (apple#2786) [GHA] Cxx interoperability compatibility and integration tests check (apple#2790) [GHA] Introduce reusable matrix workflow (apple#2789) Fix benchmark thresholds update script (apple#2783) [GHA] Broken symlink and format check (apple#2787) [GHA] Add license header check (apple#2781) Improved documentation for HTTP Parts to clarify how often each part is received (apple#2775) [GHA] Download the scripts to make workflow reusable (apple#2785) Combine the two NIOAsyncChannel channel handlers (apple#2779) [GHA] Benchmark job (apple#2780) [GHA] Move docs check to script (apple#2776) Add benchmark for creating NIOAsyncChannel (apple#2774) Avoid creating a yield ID counter per async writer (apple#2768) [GHA] Unacceptable language check (apple#2766) Allow in-place mutation of `NIOLoopBoundBox.value` (apple#2771) ... # Conflicts: # Sources/NIOPosix/BSDSocketAPICommon.swift # Sources/NIOPosix/GetaddrinfoResolver.swift # Sources/NIOPosix/HappyEyeballs.swift
- Loading branch information
Showing
426 changed files
with
26,092 additions
and
15,879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Adopt swift-format | ||
c9756e108351a1def2e2c83ff5ee6fb9bcbc3bbf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
call-pull-request-soundness-workflow: | ||
name: Soundness | ||
uses: ./.github/workflows/pull_request_soundness.yml | ||
with: | ||
license_header_check_project_name: "SwiftNIO" | ||
|
||
call-pull-request-unit-tests-workflow: | ||
name: Unit tests | ||
uses: ./.github/workflows/pull_request_swift_matrix.yml | ||
with: | ||
name: "Unit tests" | ||
matrix_linux_command: "swift test -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error" | ||
# Disable warnings as errors: Swift 6 emits sendability warnings that haven't been dealt with yet. | ||
matrix_linux_nightly_main_command_override: "swift test --explicit-target-dependency-import-check error" | ||
matrix_linux_nightly_6_0_command_override: "swift test --explicit-target-dependency-import-check error" | ||
|
||
call-pull-request-benchmark-workflow: | ||
name: Benchmarks | ||
uses: ./.github/workflows/pull_request_swift_matrix.yml | ||
with: | ||
name: "Benchmarks" | ||
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q libjemalloc-dev && swift package --package-path Benchmarks/ --disable-sandbox benchmark baseline check --check-absolute-path Benchmarks/Thresholds/${SWIFT_VERSION}/" | ||
|
||
call-pull-request-cxx-interop-workflow: | ||
name: Cxx interop | ||
uses: ./.github/workflows/pull_request_swift_matrix.yml | ||
with: | ||
name: "Cxx interop" | ||
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q jq && ./scripts/check-cxx-interop-compatibility.sh" | ||
|
||
call-pull-request-integration-tests-workflow: | ||
name: Integration tests | ||
uses: ./.github/workflows/pull_request_swift_matrix.yml | ||
with: | ||
name: "Integration tests" | ||
matrix_linux_command: "apt-get update -y -q && apt-get install -y -q lsof dnsutils netcat-openbsd net-tools curl jq && ./scripts/integration_tests.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
name: Pull Request | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
api_breakage_check_enabled: | ||
type: boolean | ||
description: "Boolean to enable the API breakage check job. Defaults to true." | ||
default: true | ||
docs_check_enabled: | ||
type: boolean | ||
description: "Boolean to enable the docs check job. Defaults to true." | ||
default: true | ||
unacceptable_language_check_enabled: | ||
type: boolean | ||
description: "Boolean to enable the acceptable language check job. Defaults to true." | ||
default: true | ||
unacceptable_language_check_word_list: | ||
type: string | ||
description: "List of unacceptable words. Defaults to a sensible list of words." | ||
default: "blacklist whitelist slave master sane sanity insane insanity kill killed killing hang hung hanged hanging" #ignore-unacceptable-language | ||
license_header_check_enabled: | ||
type: boolean | ||
description: "Boolean to enable the license header check job. Defaults to true." | ||
default: true | ||
license_header_check_project_name: | ||
type: string | ||
description: "Name of the project called out in the license header." | ||
required: true | ||
broken_symlink_check_enabled: | ||
type: boolean | ||
description: "Boolean to enable the broken symlink check job. Defaults to true." | ||
default: true | ||
format_check_enabled: | ||
type: boolean | ||
description: "Boolean to enable the format check job. Defaults to true." | ||
default: true | ||
|
||
## We are cancelling previously triggered workflow runs | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-soundness | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
api-breakage-check: | ||
name: API breakage check | ||
if: ${{ inputs.api_breakage_check_enabled }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: swift:5.10-noble | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# We need to fetch everything otherwise only the head commit will be fetched. | ||
fetch-depth: 0 | ||
- name: Mark the workspace as safe | ||
# https://github.com/actions/checkout/issues/766 | ||
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} | ||
- name: Run API breakage check | ||
run: swift package diagnose-api-breaking-changes origin/main | ||
|
||
docs-check: | ||
name: Documentation check | ||
if: ${{ inputs.docs_check_enabled }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: swift:5.10-noble | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run documentation check | ||
run: | | ||
apt-get -qq update && apt-get -qq -y install curl | ||
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-docs.sh | bash | ||
unacceptable-language-check: | ||
name: Unacceptable language check | ||
if: ${{ inputs.unacceptable_language_check_enabled }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run unacceptable language check | ||
env: | ||
UNACCEPTABLE_WORD_LIST: ${{ inputs.unacceptable_language_check_word_list}} | ||
run: curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-unacceptable-language.sh | bash | ||
|
||
license-header-check: | ||
name: License headers check | ||
if: ${{ inputs.license_header_check_enabled }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run license header check | ||
env: | ||
PROJECT_NAME: ${{ inputs.license_header_check_project_name }} | ||
run: curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-license-header.sh | bash | ||
|
||
broken-symlink-check: | ||
name: Broken symlinks check | ||
if: ${{ inputs.broken_symlink_check_enabled }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run broken symlinks check | ||
run: curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-broken-symlinks.sh | bash | ||
|
||
format-check: | ||
name: Format check | ||
if: ${{ inputs.format_check_enabled }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: swiftlang/swift:nightly-6.0-jammy | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Mark the workspace as safe | ||
# https://github.com/actions/checkout/issues/766 | ||
run: git config --global --add safe.directory ${GITHUB_WORKSPACE} | ||
- name: Format Swift files | ||
run: git ls-files -z '*.swift' | xargs -0 swift format format --parallel --in-place | ||
- name: Lint Swift files | ||
run: git ls-files -z '*.swift' | xargs -0 swift format lint --strict --parallel | ||
- name: Check format produced no diff | ||
run: GIT_PAGER= git diff --exit-code '*.swift' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Pull Request | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
name: | ||
type: string | ||
description: "The name of the workflow used for the concurrency group." | ||
required: true | ||
matrix_linux_command: | ||
type: string | ||
description: "The command of the current Swift version linux matrix job to execute." | ||
required: true | ||
matrix_linux_5_8_enabled: | ||
type: boolean | ||
description: "Boolean to enable the 5.8 Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_5_8_command_override: | ||
type: string | ||
description: "The command of the 5.8 Swift version linux matrix job to execute." | ||
matrix_linux_5_9_enabled: | ||
type: boolean | ||
description: "Boolean to enable the 5.9 Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_5_9_command_override: | ||
type: string | ||
description: "The command of the 5.9 Swift version linux matrix job to execute." | ||
matrix_linux_5_10_enabled: | ||
type: boolean | ||
description: "Boolean to enable the 5.10 Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_5_10_command_override: | ||
type: string | ||
description: "The command of the 5.10 Swift version linux matrix job to execute." | ||
matrix_linux_nightly_6_0_enabled: | ||
type: boolean | ||
description: "Boolean to enable the nightly 6.0 Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_nightly_6_0_command_override: | ||
type: string | ||
description: "The command of the nightly 6.0 Swift version linux matrix job to execute." | ||
matrix_linux_nightly_main_enabled: | ||
type: boolean | ||
description: "Boolean to enable the nightly main Swift version matrix job. Defaults to true." | ||
default: true | ||
matrix_linux_nightly_main_command_override: | ||
type: string | ||
description: "The command of the nightly main Swift version linux matrix job to execute." | ||
|
||
## We are cancelling previously triggered workflow runs | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
linux: | ||
name: ${{ matrix.swift.swift_version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release | ||
swift: | ||
- image: swift:5.8-jammy | ||
swift_version: "5.8" | ||
enabled: ${{ inputs.matrix_linux_5_8_enabled }} | ||
- image: swift:5.9-jammy | ||
swift_version: "5.9" | ||
enabled: ${{ inputs.matrix_linux_5_9_enabled }} | ||
- image: swift:5.10-jammy | ||
swift_version: "5.10" | ||
enabled: ${{ inputs.matrix_linux_5_10_enabled }} | ||
- image: swiftlang/swift:nightly-6.0-jammy | ||
swift_version: "nightly-6.0" | ||
enabled: ${{ inputs.matrix_linux_nightly_6_0_enabled }} | ||
- image: swiftlang/swift:nightly-main-jammy | ||
swift_version: "nightly-main" | ||
enabled: ${{ inputs.matrix_linux_nightly_main_enabled }} | ||
container: | ||
image: ${{ matrix.swift.image }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Run matrix job | ||
if: ${{ matrix.swift.enabled }} | ||
env: | ||
SWIFT_VERSION: ${{ matrix.swift.swift_version }} | ||
COMMAND: ${{ inputs.matrix_linux_command }} | ||
COMMAND_OVERRIDE_5_8: ${{ inputs.matrix_linux_5_8_command_override }} | ||
COMMAND_OVERRIDE_5_9: ${{ inputs.matrix_linux_5_9_command_override }} | ||
COMMAND_OVERRIDE_5_10: ${{ inputs.matrix_linux_5_10_command_override }} | ||
COMMAND_OVERRIDE_NIGHTLY_6_0: ${{ inputs.matrix_linux_nightly_6_0_command_override }} | ||
COMMAND_OVERRIDE_NIGHTLY_MAIN: ${{ inputs.matrix_linux_nightly_main_command_override }} | ||
run: | | ||
apt-get -qq update && apt-get -qq -y install curl | ||
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.sh | bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.gitignore | ||
**/.gitignore | ||
.licenseignore | ||
.gitattributes | ||
.git-blame-ignore-revs | ||
.mailfilter | ||
.mailmap | ||
.spi.yml | ||
.swift-format | ||
.github/* | ||
*.md | ||
*.txt | ||
*.yml | ||
*.yaml | ||
*.json | ||
Package.swift | ||
**/Package.swift | ||
Package@-*.swift | ||
**/Package@-*.swift | ||
Package.resolved | ||
**/Package.resolved | ||
Makefile | ||
*.modulemap | ||
**/*.modulemap | ||
**/*.docc/* | ||
*.xcprivacy | ||
**/*.xcprivacy | ||
*.symlink | ||
**/*.symlink | ||
Dockerfile | ||
**/Dockerfile | ||
Snippets/* | ||
Sources/CNIOAtomics/src/cpp_magic.h | ||
Sources/CNIOLLHTTP/LICENSE-MIT | ||
Sources/CNIOLLHTTP/c_nio_api.c | ||
Sources/CNIOLLHTTP/c_nio_http.c | ||
Sources/CNIOLLHTTP/c_nio_llhttp.c | ||
Sources/CNIOLLHTTP/include/c_nio_llhttp.h | ||
Sources/CNIOSHA1/c_nio_sha1.c | ||
Sources/CNIOSHA1/include/CNIOSHA1.h | ||
dev/alloc-limits-from-test-output | ||
dev/boxed-existentials.d | ||
dev/git.commit.template | ||
dev/lldb-smoker | ||
dev/make-single-file-spm | ||
dev/malloc-aggregation.d | ||
dev/update-alloc-limits-to-last-completed-ci-build | ||
scripts/nio-diagnose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
Oops, something went wrong.