Skip to content

Commit 23dc7ae

Browse files
authored
Merge branch 'main' into hd-update-supported-features
2 parents 1271f67 + 00a1bde commit 23dc7ae

File tree

245 files changed

+33369
-1848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+33369
-1848
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true

.github/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ changelog:
22
categories:
33
- title: SemVer Major
44
labels:
5-
- semver/major
5+
- ⚠️ semver/major
66
- title: SemVer Minor
77
labels:
8-
- semver/minor
8+
- 🆕 semver/minor
99
- title: SemVer Patch
1010
labels:
11-
- semver/patch
11+
- 🔨 semver/patch
1212
- title: Other Changes
1313
labels:
1414
- semver/none
15-
- "*"

.github/workflows/main.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
schedule:
7+
- cron: "0 8,20 * * *"
8+
9+
jobs:
10+
unit-tests:
11+
name: Unit tests
12+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
13+
with:
14+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
15+
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
16+
linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
17+
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
18+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
19+
windows_6_0_enabled: true
20+
windows_6_1_enabled: true
21+
windows_nightly_6_1_enabled: true
22+
windows_nightly_main_enabled: true
23+
windows_6_0_arguments_override: "--explicit-target-dependency-import-check error"
24+
windows_6_1_arguments_override: "--explicit-target-dependency-import-check error"
25+
windows_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error"
26+
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
27+
28+
construct-integration-test-matrix:
29+
name: Construct integration matrix
30+
runs-on: ubuntu-latest
31+
outputs:
32+
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
with:
37+
persist-credentials: false
38+
- id: generate-matrix
39+
run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
40+
env:
41+
MATRIX_LINUX_SETUP_COMMAND: apt-get update -y && apt-get install -yq jq && git config --global --add safe.directory /swift-openapi-generator/.git && git config --global --add safe.directory /swift-openapi-generator
42+
MATRIX_LINUX_COMMAND: SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${workspace} ./scripts/run-integration-test.sh
43+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
44+
45+
integration-test:
46+
name: Integration test
47+
needs: construct-integration-test-matrix
48+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
49+
with:
50+
name: "Integration test"
51+
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
52+
53+
construct-example-packages-matrix:
54+
name: Construct example packages matrix
55+
runs-on: ubuntu-latest
56+
outputs:
57+
example-packages-matrix: '${{ steps.generate-matrix.outputs.example-packages-matrix }}'
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
with:
62+
persist-credentials: false
63+
- id: generate-matrix
64+
run: echo "example-packages-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
65+
env:
66+
MATRIX_LINUX_SETUP_COMMAND: git config --global --add safe.directory /swift-openapi-generator
67+
MATRIX_LINUX_COMMAND: ./scripts/test-examples.sh
68+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
69+
70+
example-packages:
71+
name: Example packages
72+
needs: construct-example-packages-matrix
73+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
74+
with:
75+
name: "Example packages"
76+
matrix_string: '${{ needs.construct-example-packages-matrix.outputs.example-packages-matrix }}'
77+
78+
macos-tests:
79+
name: macOS tests
80+
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
81+
with:
82+
runner_pool: nightly
83+
build_scheme: swift-openapi-generator-Package
84+
ios_xcode_build_enabled: false
85+
watchos_xcode_build_enabled: false
86+
tvos_xcode_build_enabled: false
87+
visionos_xcode_build_enabled: false

.github/workflows/pull_request.yml

Lines changed: 100 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,113 @@
11
name: PR
22

33
on:
4-
pull_request:
5-
types: [opened, reopened, synchronize]
4+
pull_request:
5+
types: [opened, reopened, synchronize]
66

77
jobs:
8-
soundness:
9-
name: Soundness
10-
uses: apple/swift-nio/.github/workflows/soundness.yml@main
11-
with:
12-
api_breakage_check_enabled: true
13-
broken_symlink_check_enabled: true
14-
docs_check_enabled: true
15-
format_check_enabled: true
16-
license_header_check_enabled: true
17-
license_header_check_project_name: "SwiftOpenAPIGenerator"
18-
shell_check_enabled: true
19-
unacceptable_language_check_enabled: true
8+
soundness:
9+
name: Soundness
10+
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
11+
with:
12+
api_breakage_check_enabled: false
13+
license_header_check_project_name: "SwiftOpenAPIGenerator"
14+
yamllint_check_enabled: false
15+
16+
unit-tests:
17+
name: Unit tests
18+
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
19+
with:
20+
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
21+
linux_6_0_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
22+
linux_6_1_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
23+
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
24+
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
25+
windows_6_0_enabled: true
26+
windows_6_1_enabled: true
27+
windows_nightly_6_1_enabled: true
28+
windows_nightly_main_enabled: true
29+
windows_6_0_arguments_override: "--explicit-target-dependency-import-check error"
30+
windows_6_1_arguments_override: "--explicit-target-dependency-import-check error"
31+
windows_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error"
32+
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
2033

21-
unit-tests:
22-
name: Unit tests
23-
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
34+
compatibility-test:
35+
name: Compatibility test
36+
runs-on: ubuntu-latest
37+
container:
38+
image: swift:latest
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
2442
with:
25-
linux_5_8_enabled: false
26-
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
27-
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
28-
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
29-
linux_nightly_main_enabled: false
43+
persist-credentials: false
44+
- name: Run OpenAPI document compatibilty test
45+
env:
46+
SWIFT_OPENAPI_COMPATIBILITY_TEST_ENABLE: "true"
47+
SWIFT_OPENAPI_COMPATIBILITY_TEST_SKIP_BUILD: "true"
48+
SWIFT_OPENAPI_COMPATIBILITY_TEST_FILTER: OpenAPIGeneratorReferenceTests.CompatibilityTest
49+
SWIFT_OPENAPI_COMPATIBILITY_TEST_PARALLEL_CODEGEN: "true"
50+
SWIFT_OPENAPI_COMPATIBILITY_TEST_NUM_BUILD_JOBS: 1
51+
run: swift test --filter ${SWIFT_OPENAPI_COMPATIBILITY_TEST_FILTER}
3052

31-
integration-test:
32-
name: Integration test
33-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
53+
construct-integration-test-matrix:
54+
name: Construct integration matrix
55+
runs-on: ubuntu-latest
56+
outputs:
57+
integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}'
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
3461
with:
35-
name: "Integration test"
36-
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${GITHUB_WORKSPACE} ./scripts/run-integration-test.sh"
37-
matrix_linux_5_8_enabled: false
38-
matrix_linux_nightly_main_enabled: false
62+
persist-credentials: false
63+
- id: generate-matrix
64+
run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
65+
env:
66+
MATRIX_LINUX_SETUP_COMMAND: apt-get update -y && apt-get install -yq jq && git config --global --add safe.directory /swift-openapi-generator/.git && git config --global --add safe.directory /swift-openapi-generator
67+
MATRIX_LINUX_COMMAND: SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${workspace} ./scripts/run-integration-test.sh
68+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
3969

40-
compatibility-test:
41-
name: Compatibility test
42-
runs-on: ubuntu-latest
43-
container:
44-
image: swift:latest
45-
steps:
46-
- name: Checkout repository
47-
uses: actions/checkout@v4
48-
with:
49-
persist-credentials: false
50-
- name: Run OpenAPI document compatibilty test
51-
env:
52-
SWIFT_OPENAPI_COMPATIBILITY_TEST_ENABLE: "true"
53-
SWIFT_OPENAPI_COMPATIBILITY_TEST_SKIP_BUILD: "true"
54-
SWIFT_OPENAPI_COMPATIBILITY_TEST_FILTER: OpenAPIGeneratorReferenceTests.CompatibilityTest
55-
SWIFT_OPENAPI_COMPATIBILITY_TEST_PARALLEL_CODEGEN: "true"
56-
SWIFT_OPENAPI_COMPATIBILITY_TEST_NUM_BUILD_JOBS: 1
57-
run: swift test --filter ${SWIFT_OPENAPI_COMPATIBILITY_TEST_FILTER}
70+
integration-test:
71+
name: Integration test
72+
needs: construct-integration-test-matrix
73+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
74+
with:
75+
name: "Integration test"
76+
matrix_string: '${{ needs.construct-integration-test-matrix.outputs.integration-test-matrix }}'
5877

59-
example-packages:
60-
name: Example packages
61-
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
78+
construct-example-packages-matrix:
79+
name: Construct example packages matrix
80+
runs-on: ubuntu-latest
81+
outputs:
82+
example-packages-matrix: '${{ steps.generate-matrix.outputs.example-packages-matrix }}'
83+
steps:
84+
- name: Checkout repository
85+
uses: actions/checkout@v4
6286
with:
63-
name: "Example packages"
64-
matrix_linux_command: "./scripts/test-examples.sh"
65-
matrix_linux_5_8_enabled: false
66-
matrix_linux_nightly_main_enabled: false
87+
persist-credentials: false
88+
- id: generate-matrix
89+
run: echo "example-packages-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT"
90+
env:
91+
MATRIX_LINUX_SETUP_COMMAND: git config --global --add safe.directory /swift-openapi-generator
92+
MATRIX_LINUX_COMMAND: ./scripts/test-examples.sh
93+
MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false
94+
95+
example-packages:
96+
name: Example packages
97+
needs: construct-example-packages-matrix
98+
uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main
99+
with:
100+
name: "Example packages"
101+
matrix_string: '${{ needs.construct-example-packages-matrix.outputs.example-packages-matrix }}'
102+
67103

68-
swift-6-language-mode:
69-
name: Swift 6 Language Mode
70-
uses: apple/swift-nio/.github/workflows/swift_6_language_mode.yml@main
71-
if: false # Disabled for now.
104+
macos-tests:
105+
name: macOS tests
106+
uses: apple/swift-nio/.github/workflows/macos_tests.yml@main
107+
with:
108+
runner_pool: general
109+
build_scheme: swift-openapi-generator-Package
110+
ios_xcode_build_enabled: false
111+
watchos_xcode_build_enabled: false
112+
tvos_xcode_build_enabled: false
113+
visionos_xcode_build_enabled: false
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, reopened, synchronize]
6+
7+
jobs:
8+
semver-label-check:
9+
name: Semantic version label check
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 1
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
17+
- name: Check for Semantic Version label
18+
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main

.github/workflows/scheduled.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.licenseignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.gitignore
22
.licenseignore
33
.swiftformatignore
4+
.unacceptablelanguageignore
45
.spi.yml
56
.swift-format
67
.github/*
@@ -37,5 +38,8 @@ Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp.*
3738
Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp/Assets.xcassets/*
3839
Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp/Preview*
3940
Examples/**/Generated*
41+
Examples/streaming-chatgpt-proxy/.env.example
42+
Examples/streaming-chatgpt-proxy/players.txt
4043
**/Makefile
41-
**/*.html
44+
**/*.html
45+
.editorconfig

.swiftformatignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Tests/OpenAPIGeneratorReferenceTests/Resources
22
Sources/swift-openapi-generator/Documentation.docc
33
Examples/**/Generated/*
4-
Examples/**/GeneratedSources/*
4+
Examples/**/GeneratedSources/*
5+
Examples/streaming-chatgpt-proxy/**
6+
**Package.swift

.unacceptablelanguageignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Examples/streaming-chatgpt-proxy/Sources/ChatGPT/openapi.yaml

CONTRIBUTING.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@ directory, for example:
8989
--action-offline-mode
9090
```
9191

92-
For frequent contributors, we recommend adding the script as a [git pre-push hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), which you can do via executing the following command in the project root directory:
93-
94-
```bash
95-
cat << EOF > .git/hooks/pre-push
96-
97-
if [[ -f "scripts/soundness.sh" ]]; then
98-
scripts/soundness.sh
99-
fi
100-
EOF
101-
```
102-
103-
Which makes the script execute, and only allow the `git push` to complete if the check has passed.
104-
105-
In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again.
106-
10792
## How to contribute your work
10893

10994
Please open a pull request at https://github.com/apple/swift-openapi-generator. Make sure the CI passes, and then wait for code review.

0 commit comments

Comments
 (0)