From 76aa5934dbb1498dd8326a78ddcd313359003e72 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 11:04:21 +0200 Subject: [PATCH 01/15] feat: update workflow triggers and setup for various sample projects to prevent unnecessary recompilation of untouched sample projects --- .github/actions/compute-matrix/action.yaml | 79 ++++++++++ .../samples-aspnet-fastenpoints-server.yaml | 37 +++-- .../workflows/samples-c-libcurl-client.yaml | 29 +++- .github/workflows/samples-clojure.yaml | 34 +++-- .../workflows/samples-cpp-httplib-server.yaml | 26 +++- .../workflows/samples-cpp-oatpp-client.yaml | 26 +++- .../workflows/samples-cpp-oatpp-server.yaml | 26 +++- .github/workflows/samples-cpp-qt-client.yaml | 28 +++- .github/workflows/samples-crystal.yaml | 35 +++-- .../workflows/samples-dart-build-test.yaml | 36 +++-- .github/workflows/samples-dotnet-fx.yaml | 51 +++++-- .../samples-dotnet-petstore-net10.yml | 25 +++- .github/workflows/samples-dotnet-petstore.yml | 25 +++- .../workflows/samples-dotnet-standard.yaml | 34 ++++- .github/workflows/samples-dotnet10.yaml | 71 +++++---- .github/workflows/samples-dotnet6-server.yaml | 35 ++++- .github/workflows/samples-dotnet7-client.yml | 42 ++++-- .../samples-dotnet8-client-echo-api.yaml | 26 +++- .github/workflows/samples-dotnet8-client.yaml | 27 +++- .github/workflows/samples-dotnet8-server.yaml | 37 +++-- .github/workflows/samples-dotnet8.yaml | 45 ++++-- .github/workflows/samples-dotnet9.yaml | 57 ++++--- .github/workflows/samples-elixir.yaml | 24 ++- .github/workflows/samples-elm.yaml | 28 +++- .github/workflows/samples-erlang.yaml | 31 +++- .../workflows/samples-go-client-echo-api.yaml | 25 +++- .../workflows/samples-go-client-petstore.yaml | 27 +++- .github/workflows/samples-go-client.yaml | 35 ++++- .github/workflows/samples-go-gin.yaml | 27 +++- .github/workflows/samples-go.yaml | 33 ++++- .github/workflows/samples-groovy.yaml | 34 +++-- .github/workflows/samples-haskell.yaml | 32 +++- .../samples-java-client-echo-api-jdk11.yaml | 34 ++++- .../samples-java-client-echo-api-jdk17.yaml | 36 +++-- .../samples-java-client-echo-api-jdk8.yaml | 34 ++++- .../workflows/samples-java-client-jdk11.yaml | 140 ++++++++++-------- .../workflows/samples-java-client-jdk17.yaml | 72 +++++---- .github/workflows/samples-java-dubbo.yaml | 26 +++- .../workflows/samples-java-helidon-v3.yaml | 34 ++++- .../workflows/samples-java-helidon-v4.yaml | 36 +++-- .../samples-java-petsore-client-jdk11.yaml | 46 +++--- .../samples-java-petsore-client-jdk17.yaml | 34 +++-- .../samples-java-play-framework.yaml | 48 ++++-- .github/workflows/samples-java-sbt.yaml | 26 +++- .../workflows/samples-java-server-jdk8.yaml | 35 ++++- .github/workflows/samples-java-wiremock.yaml | 25 +++- .github/workflows/samples-javascript.yaml | 29 +++- .github/workflows/samples-jaxrs-jdk11.yaml | 26 +++- .github/workflows/samples-jaxrs.yaml | 68 +++++---- .github/workflows/samples-jdk17.yaml | 61 +++++--- .github/workflows/samples-jdk21.yaml | 33 ++++- .github/workflows/samples-julia.yaml | 2 + .github/workflows/samples-kotlin-client.yaml | 138 +++++++++-------- .../workflows/samples-kotlin-echo-api.yaml | 32 +++- .../samples-kotlin-server-jdk17.yaml | 90 ++++++----- .../samples-kotlin-server-jdk21.yaml | 47 ++++-- .github/workflows/samples-kotlin-server.yaml | 75 ++++++---- .../workflows/samples-kotlin-wiremock.yaml | 31 +++- .github/workflows/samples-ocaml.yaml | 35 ++++- .github/workflows/samples-php-client.yaml | 27 +++- .../samples-php-server-syntax-check.yaml | 37 ++++- .../workflows/samples-php-syntax-check.yaml | 29 +++- .github/workflows/samples-php8.yaml | 33 ++++- .github/workflows/samples-postman.yaml | 28 +++- .github/workflows/samples-powershell.yaml | 35 +++-- .github/workflows/samples-protobuf.yaml | 29 +++- .../samples-python-client-echo-api.yaml | 38 +++-- .../samples-python-fastapi-server.yaml | 26 +++- .../workflows/samples-python-petstore.yaml | 29 +++- ...es-python-pydantic-v1-client-echo-api.yaml | 36 +++-- .../samples-python-pydantic-v1-petstore.yaml | 25 +++- .github/workflows/samples-python-server.yaml | 26 +++- .github/workflows/samples-r.yaml | 39 +++-- .github/workflows/samples-ruby.yaml | 29 +++- .github/workflows/samples-rust-client.yaml | 28 +++- .github/workflows/samples-rust-server.yaml | 32 +++- .github/workflows/samples-scala-client.yaml | 51 ++++--- .github/workflows/samples-scala-server.yaml | 36 +++-- .github/workflows/samples-spring-jdk11.yaml | 28 +++- .github/workflows/samples-spring-jdk17.yaml | 57 ++++--- .github/workflows/samples-spring.yaml | 99 ++++++++----- .github/workflows/samples-swift5.yaml | 48 ++++-- .github/workflows/samples-terraform.yaml | 35 ++++- .../samples-typescript-axios-echo-api.yaml | 32 +++- .../workflows/samples-typescript-client.yaml | 87 ++++++----- .../samples-typescript-encode-decode.yaml | 32 +++- .../samples-typescript-nestjs-server.yaml | 30 +++- ...samples-typescript-node-encode-decode.yaml | 32 +++- .../workflows/samples-typescript-server.yaml | 24 ++- .../samples-typescript-typecheck.yaml | 1 + .github/workflows/samples-zapier.yaml | 27 +++- 91 files changed, 2609 insertions(+), 956 deletions(-) create mode 100644 .github/actions/compute-matrix/action.yaml diff --git a/.github/actions/compute-matrix/action.yaml b/.github/actions/compute-matrix/action.yaml new file mode 100644 index 000000000000..5f26c53e75ee --- /dev/null +++ b/.github/actions/compute-matrix/action.yaml @@ -0,0 +1,79 @@ +name: 'Compute changed samples matrix' +description: > + Determines which sample directories from a given list have changed files + in the current push or pull_request event, and outputs a filtered JSON matrix. + Requires the calling job to have checked out the repository with fetch-depth: 0. + +inputs: + all_samples: + description: > + Newline-separated list of sample directory paths to consider (the full matrix). + Paths should NOT include a trailing /** glob — the action matches by directory prefix. + Comment lines (starting with #) and blank lines are ignored. + required: true + +outputs: + matrix: + description: > + Use this for single-dimension sample matrices. + JSON object {"sample":["path/a","path/b"]} ready for: matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + Returns the string "[]" when no samples changed (use in an if: guard to skip the job). + value: ${{ steps.filter.outputs.matrix }} + samples: + description: > + Use this for multi-dimensional matrices (e.g. os + sample, php-version + sample). + Plain JSON array ["path/a","path/b"] to assign to the sample: dimension only. + Returns the string "[]" when no samples changed (use in an if: guard to skip the job). + value: ${{ steps.filter.outputs.samples }} + +runs: + using: "composite" + steps: + - id: filter + shell: bash + env: + # For pull_request events, base.sha is the target branch tip. + # For push events, event.before is the previous HEAD (all-zeros for new branches). + BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} + HEAD_SHA: ${{ github.sha }} + ALL_SAMPLES: ${{ inputs.all_samples }} + run: | + # Resolve the base SHA — github.event.before is all zeros for brand-new branches + if [[ "$BASE_SHA" == "0000000000000000000000000000000000000000" ]] || [[ -z "$BASE_SHA" ]]; then + BASE_SHA=$(git rev-parse HEAD~1 2>/dev/null || echo "") + fi + + # Get list of changed files relative to the base commit + if [[ -n "$BASE_SHA" ]]; then + CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" 2>/dev/null || git diff --name-only HEAD~1 HEAD) + else + CHANGED=$(git diff --name-only HEAD~1 HEAD) + fi + + # Filter: keep only sample dirs where at least one changed file lives inside them + RESULT=() + while IFS= read -r sample; do + # Strip leading/trailing whitespace + sample="${sample#"${sample%%[![:space:]]*}"}" + sample="${sample%"${sample##*[![:space:]]}"}" + # Skip blank lines and comment lines + if [[ -z "$sample" ]] || [[ "$sample" == \#* ]]; then continue; fi + # Normalise: strip any accidental trailing slash (paths: uses /**, all_samples: should not) + sample="${sample%/}" + + # A file belongs to a sample dir if its path starts with "/" + if echo "$CHANGED" | grep -q "^${sample}/"; then + RESULT+=("$sample") + fi + done <<< "$ALL_SAMPLES" + + # Emit both output formats + if [[ ${#RESULT[@]} -eq 0 ]]; then + echo 'matrix=[]' >> "$GITHUB_OUTPUT" + echo 'samples=[]' >> "$GITHUB_OUTPUT" + else + SAMPLES_ARRAY=$(printf '%s\n' "${RESULT[@]}" | jq -R . | jq -sc .) + echo "matrix={\"sample\":${SAMPLES_ARRAY}}" >> "$GITHUB_OUTPUT" + echo "samples=${SAMPLES_ARRAY}" >> "$GITHUB_OUTPUT" + fi + diff --git a/.github/workflows/samples-aspnet-fastenpoints-server.yaml b/.github/workflows/samples-aspnet-fastenpoints-server.yaml index 1f35f6a2a49b..2e9c43fce335 100644 --- a/.github/workflows/samples-aspnet-fastenpoints-server.yaml +++ b/.github/workflows/samples-aspnet-fastenpoints-server.yaml @@ -2,28 +2,47 @@ name: Samples C# .Net 8 FastEndpoints Server on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/aspnet/fastendpoints/** - samples/server/petstore/aspnet/fastendpoints-*/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/aspnet/fastendpoints/** - samples/server/petstore/aspnet/fastendpoints-*/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/aspnet/fastendpoints + samples/server/petstore/aspnet/fastendpoints-useApiVersioning + samples/server/petstore/aspnet/fastendpoints-useAuthentication + samples/server/petstore/aspnet/fastendpoints-useProblemDetails + samples/server/petstore/aspnet/fastendpoints-useRecords + samples/server/petstore/aspnet/fastendpoints-useResponseCaching + samples/server/petstore/aspnet/fastendpoints-useValidators + build: name: Build .Net 8 FastEndpoints servers + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/server/petstore/aspnet/fastendpoints - - samples/server/petstore/aspnet/fastendpoints-useApiVersioning - - samples/server/petstore/aspnet/fastendpoints-useAuthentication - - samples/server/petstore/aspnet/fastendpoints-useProblemDetails - - samples/server/petstore/aspnet/fastendpoints-useRecords - - samples/server/petstore/aspnet/fastendpoints-useResponseCaching - - samples/server/petstore/aspnet/fastendpoints-useValidators + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-c-libcurl-client.yaml b/.github/workflows/samples-c-libcurl-client.yaml index 565b1c3e3bd6..19e5566b95f0 100644 --- a/.github/workflows/samples-c-libcurl-client.yaml +++ b/.github/workflows/samples-c-libcurl-client.yaml @@ -2,27 +2,46 @@ name: Samples c libcurl client on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/c/**' - 'samples/client/petstore/c-useJsonUnformatted/**' - 'samples/client/others/c/bearerAuth/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/c/**' - 'samples/client/petstore/c-useJsonUnformatted/**' - 'samples/client/others/c/bearerAuth/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + 'samples/client/petstore/c/' + 'samples/client/petstore/c-useJsonUnformatted/' + 'samples/client/others/c/bearerAuth/' + build: name: Build c libcurl client + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - 'samples/client/petstore/c/' - - 'samples/client/petstore/c-useJsonUnformatted/' - - 'samples/client/others/c/bearerAuth/' + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/samples-clojure.yaml b/.github/workflows/samples-clojure.yaml index 60d5af12388e..4aa1a709ed48 100644 --- a/.github/workflows/samples-clojure.yaml +++ b/.github/workflows/samples-clojure.yaml @@ -2,28 +2,40 @@ name: Samples Clojure Client on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/clojure/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/clojure/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/clojure/ + 80:8080 + build: name: Build Clojure Client (JDK11) + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/clojure/ - services: - petstore-api: - image: swaggerapi/petstore - ports: - - 80:8080 - env: - SWAGGER_HOST: http://petstore.swagger.io - SWAGGER_BASE_PATH: /v2 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-cpp-httplib-server.yaml b/.github/workflows/samples-cpp-httplib-server.yaml index ec407c343401..79c2e790bd6e 100644 --- a/.github/workflows/samples-cpp-httplib-server.yaml +++ b/.github/workflows/samples-cpp-httplib-server.yaml @@ -2,10 +2,12 @@ name: Samples cpp httplib server on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/server/petstore/cpp-httplib-server/**" - ".github/workflows/samples-cpp-httplib-server.yaml" pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/server/petstore/cpp-httplib-server/**" - ".github/workflows/samples-cpp-httplib-server.yaml" @@ -14,13 +16,31 @@ env: GRADLE_VERSION: 6.9 jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/cpp-httplib-server/petstore + samples/server/petstore/cpp-httplib-server/feature-test + build: name: Build cpp httplib server + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} strategy: matrix: - sample: - - samples/server/petstore/cpp-httplib-server/petstore - - samples/server/petstore/cpp-httplib-server/feature-test + sample: ${{ fromJson(needs.setup.outputs.samples) }} os: - ubuntu-latest - macOS-latest diff --git a/.github/workflows/samples-cpp-oatpp-client.yaml b/.github/workflows/samples-cpp-oatpp-client.yaml index 1cd5d6297071..e32f19623fa3 100644 --- a/.github/workflows/samples-cpp-oatpp-client.yaml +++ b/.github/workflows/samples-cpp-oatpp-client.yaml @@ -2,9 +2,11 @@ name: Samples cpp oat++ client on: push: - branches: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. + paths: - "samples/client/petstore/cpp-oatpp/**" pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/client/petstore/cpp-oatpp/**" @@ -12,12 +14,30 @@ env: GRADLE_VERSION: 6.9 jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/cpp-oatpp + build: name: Build cpp oat++ client + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} strategy: matrix: - sample: - - samples/client/petstore/cpp-oatpp + sample: ${{ fromJson(needs.setup.outputs.samples) }} os: - ubuntu-latest - macOS-latest diff --git a/.github/workflows/samples-cpp-oatpp-server.yaml b/.github/workflows/samples-cpp-oatpp-server.yaml index 1174862149a6..41aee50dbafa 100644 --- a/.github/workflows/samples-cpp-oatpp-server.yaml +++ b/.github/workflows/samples-cpp-oatpp-server.yaml @@ -2,9 +2,11 @@ name: Samples cpp oat++ server on: push: - branches: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. + paths: - "samples/server/petstore/cpp-oatpp/**" pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/server/petstore/cpp-oatpp/**" @@ -12,12 +14,30 @@ env: GRADLE_VERSION: 6.9 jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/cpp-oatpp + build: name: Build cpp oat++ server + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} strategy: matrix: - sample: - - samples/server/petstore/cpp-oatpp + sample: ${{ fromJson(needs.setup.outputs.samples) }} os: - ubuntu-latest - macOS-latest diff --git a/.github/workflows/samples-cpp-qt-client.yaml b/.github/workflows/samples-cpp-qt-client.yaml index ef7cf3c1c6d2..31a6e3653237 100644 --- a/.github/workflows/samples-cpp-qt-client.yaml +++ b/.github/workflows/samples-cpp-qt-client.yaml @@ -2,9 +2,11 @@ name: Samples cpp qt client on: push: - branches: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. + paths: - "samples/client/petstore/cpp-qt*/**" pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/client/petstore/cpp-qt*/**" @@ -12,13 +14,31 @@ env: GRADLE_VERSION: 6.9 jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/cpp-qt + samples/client/petstore/cpp-qt-addDownloadProgress + build: name: Build cpp qt client + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} strategy: matrix: - sample: - - samples/client/petstore/cpp-qt - - samples/client/petstore/cpp-qt-addDownloadProgress + sample: ${{ fromJson(needs.setup.outputs.samples) }} os: - ubuntu-latest - macOS-latest diff --git a/.github/workflows/samples-crystal.yaml b/.github/workflows/samples-crystal.yaml index 41ccc2c2b1fc..1029545080fa 100644 --- a/.github/workflows/samples-crystal.yaml +++ b/.github/workflows/samples-crystal.yaml @@ -2,29 +2,40 @@ name: Samples Crystal clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/crystal/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/crystal/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/crystal/ + 80:8080 + build: name: Build Crystal projects + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/petstore/crystal/ - services: - petstore-api: - image: swaggerapi/petstore - ports: - - 80:8080 - env: - SWAGGER_HOST: http://petstore.swagger.io - SWAGGER_BASE_PATH: /v2 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Install Crystal diff --git a/.github/workflows/samples-dart-build-test.yaml b/.github/workflows/samples-dart-build-test.yaml index 8aa8a3f4cf3b..637b8d576af5 100644 --- a/.github/workflows/samples-dart-build-test.yaml +++ b/.github/workflows/samples-dart-build-test.yaml @@ -2,7 +2,7 @@ name: Samples Dart (build, test) on: push: - branches: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: #- samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/** #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/** @@ -13,6 +13,7 @@ on: - samples/openapi3/client/petstore/dart-dio/binary_response/** - samples/openapi3/client/petstore/dart-dio/petstore-timemachine/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: #- samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/** #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/** @@ -24,21 +25,36 @@ on: - samples/openapi3/client/petstore/dart-dio/petstore-timemachine/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake + samples/openapi3/client/petstore/dart-dio/oneof + samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance + samples/openapi3/client/petstore/dart-dio/binary_response + samples/openapi3/client/petstore/dart-dio/petstore-timemachine + test: + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest] sdk: ["3.9.0"] - sample: - #- samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/ - #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/ - #- samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-json_serializable/ - - samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/ - - samples/openapi3/client/petstore/dart-dio/oneof/ - - samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/ - - samples/openapi3/client/petstore/dart-dio/binary_response/ - - samples/openapi3/client/petstore/dart-dio/petstore-timemachine/ + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/samples-dotnet-fx.yaml b/.github/workflows/samples-dotnet-fx.yaml index 11b40a0ef300..30ff6cdb096d 100644 --- a/.github/workflows/samples-dotnet-fx.yaml +++ b/.github/workflows/samples-dotnet-fx.yaml @@ -2,36 +2,55 @@ name: Samples C# .Net Framework Clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/net4.7/** - samples/client/petstore/csharp/generichost/net4.8/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/net4.7/** - samples/client/petstore/csharp/generichost/net4.8/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/csharp/generichost/net4.7/AllOf + samples/client/petstore/csharp/generichost/net4.7/AnyOf + samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare + samples/client/petstore/csharp/generichost/net4.7/FormModels + samples/client/petstore/csharp/generichost/net4.7/OneOf + samples/client/petstore/csharp/generichost/net4.7/Petstore + samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate + samples/client/petstore/csharp/generichost/net4.8/AllOf + samples/client/petstore/csharp/generichost/net4.8/AnyOf + samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare + samples/client/petstore/csharp/generichost/net4.8/FormModels + samples/client/petstore/csharp/generichost/net4.8/OneOf + samples/client/petstore/csharp/generichost/net4.8/Petstore + samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate + build: name: Build .Net Framework projects + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: windows-latest strategy: fail-fast: false matrix: - sample: - - samples/client/petstore/csharp/generichost/net4.7/AllOf - - samples/client/petstore/csharp/generichost/net4.7/AnyOf - - samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare - - samples/client/petstore/csharp/generichost/net4.7/FormModels - - samples/client/petstore/csharp/generichost/net4.7/OneOf - - samples/client/petstore/csharp/generichost/net4.7/Petstore - - samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate - - - samples/client/petstore/csharp/generichost/net4.8/AllOf - - samples/client/petstore/csharp/generichost/net4.8/AnyOf - - samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare - - samples/client/petstore/csharp/generichost/net4.8/FormModels - - samples/client/petstore/csharp/generichost/net4.8/OneOf - - samples/client/petstore/csharp/generichost/net4.8/Petstore - - samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 - name: Build diff --git a/.github/workflows/samples-dotnet-petstore-net10.yml b/.github/workflows/samples-dotnet-petstore-net10.yml index b1de8882d4a1..cf84b1ce9e61 100644 --- a/.github/workflows/samples-dotnet-petstore-net10.yml +++ b/.github/workflows/samples-dotnet-petstore-net10.yml @@ -2,14 +2,35 @@ name: Samples C# .Net 10 Client (Petstore) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/restsharp/net10/Petstore/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/restsharp/net10/Petstore/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/csharp/restsharp/net10/Petstore/ + build: name: Build clients + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest services: petstore-api: @@ -21,9 +42,7 @@ jobs: SWAGGER_BASE_PATH: /v2 strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/csharp/restsharp/net10/Petstore/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet-petstore.yml b/.github/workflows/samples-dotnet-petstore.yml index 33d1635a0fa8..d4ba9399e2c0 100644 --- a/.github/workflows/samples-dotnet-petstore.yml +++ b/.github/workflows/samples-dotnet-petstore.yml @@ -2,14 +2,35 @@ name: Samples C# .Net Client (Petstore) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/restsharp/standard2.0/Petstore/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/restsharp/standard2.0/Petstore/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/csharp/restsharp/standard2.0/Petstore/ + build: name: Build clients + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest services: petstore-api: @@ -21,9 +42,7 @@ jobs: SWAGGER_BASE_PATH: /v2 strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/csharp/restsharp/standard2.0/Petstore/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet-standard.yaml b/.github/workflows/samples-dotnet-standard.yaml index 424fb08a0eaf..3d178d7be714 100644 --- a/.github/workflows/samples-dotnet-standard.yaml +++ b/.github/workflows/samples-dotnet-standard.yaml @@ -2,30 +2,50 @@ name: Samples C# .Net Standard Client on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/standard2.0/** - samples/client/petstore/csharp/httpclient/standard2.0/** - samples/client/petstore/csharp/restsharp/standard2.0/** - samples/client/petstore/csharp/unityWebRequest/standard2.0/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/standard2.0/** - samples/client/petstore/csharp/httpclient/standard2.0/** - samples/client/petstore/csharp/restsharp/standard2.0/** - samples/client/petstore/csharp/unityWebRequest/standard2.0/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/csharp/generichost/standard2.0/Petstore/ + samples/client/petstore/csharp/httpclient/standard2.0/Petstore/ + samples/client/petstore/csharp/restsharp/standard2.0/Petstore/ + samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/ + # Commented-out samples from original matrix: + # - samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/ + build: name: Build .Net Standard projects + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: windows-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/csharp/generichost/standard2.0/Petstore/ - - samples/client/petstore/csharp/httpclient/standard2.0/Petstore/ - - samples/client/petstore/csharp/restsharp/standard2.0/Petstore/ - - samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/ - # - samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet10.yaml b/.github/workflows/samples-dotnet10.yaml index 5ffc540f6894..29221761aa2f 100644 --- a/.github/workflows/samples-dotnet10.yaml +++ b/.github/workflows/samples-dotnet10.yaml @@ -2,6 +2,7 @@ name: Samples C# .Net 10 Clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/latest/** - samples/client/petstore/csharp/generichost/net10/** @@ -9,6 +10,7 @@ on: - samples/client/petstore/csharp/restsharp/net10/** - samples/client/petstore/csharp/unityWebRequest/net10/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/latest/** - samples/client/petstore/csharp/generichost/net10/** @@ -16,38 +18,53 @@ on: - samples/client/petstore/csharp/restsharp/net10/** - samples/client/petstore/csharp/unityWebRequest/net10/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/csharp/generichost/latest/ComposedEnum + samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf + samples/client/petstore/csharp/generichost/latest/Tags + samples/client/petstore/csharp/generichost/latest/HelloWorld + samples/client/petstore/csharp/generichost/latest/NullTypes + samples/client/petstore/csharp/generichost/latest/OneOfList + samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset + samples/client/petstore/csharp/generichost/net10/AllOf + samples/client/petstore/csharp/generichost/net10/AnyOf + samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare + samples/client/petstore/csharp/generichost/net10/FormModels + samples/client/petstore/csharp/generichost/net10/NullReferenceTypes + samples/client/petstore/csharp/generichost/net10/OneOf + samples/client/petstore/csharp/generichost/net10/Petstore + samples/client/petstore/csharp/generichost/net10/SourceGeneration + samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate + samples/client/petstore/csharp/restsharp/net10/EnumMappings + samples/client/petstore/csharp/httpclient/net10/Petstore + samples/client/petstore/csharp/httpclient/net10/Petstore-nonPublicApi + # Commented-out samples from original matrix: + # - samples/client/petstore/csharp/generichost/net10/ManualPetstoreTests + # - samples/client/petstore/csharp/generichost/net10/ManualSourceGenerationTests + # - samples/client/petstore/csharp/unityWebRequest/net10/Petstore + build: name: Build .Net 10 projects + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/csharp/generichost/latest/ComposedEnum - - samples/client/petstore/csharp/generichost/latest/InlineEnumAnyOf - - samples/client/petstore/csharp/generichost/latest/Tags - - samples/client/petstore/csharp/generichost/latest/HelloWorld - - samples/client/petstore/csharp/generichost/latest/NullTypes - - samples/client/petstore/csharp/generichost/latest/OneOfList - - samples/client/petstore/csharp/generichost/latest/UseDateTimeOffset - - samples/client/petstore/csharp/generichost/net10/AllOf - - samples/client/petstore/csharp/generichost/net10/AnyOf - - samples/client/petstore/csharp/generichost/net10/AnyOfNoCompare - - samples/client/petstore/csharp/generichost/net10/FormModels - # - samples/client/petstore/csharp/generichost/net10/ManualPetstoreTests - # - samples/client/petstore/csharp/generichost/net10/ManualSourceGenerationTests - - samples/client/petstore/csharp/generichost/net10/NullReferenceTypes - - samples/client/petstore/csharp/generichost/net10/OneOf - - samples/client/petstore/csharp/generichost/net10/Petstore - - samples/client/petstore/csharp/generichost/net10/SourceGeneration - - samples/client/petstore/csharp/generichost/net10/UseDateTimeForDate - # restsharp - - samples/client/petstore/csharp/restsharp/net10/EnumMappings - # httpclient - - samples/client/petstore/csharp/httpclient/net10/Petstore - - samples/client/petstore/csharp/httpclient/net10/Petstore-nonPublicApi - # unity - # - samples/client/petstore/csharp/unityWebRequest/net10/Petstore + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet6-server.yaml b/.github/workflows/samples-dotnet6-server.yaml index a41fcf66b5ea..553a9b16be8e 100644 --- a/.github/workflows/samples-dotnet6-server.yaml +++ b/.github/workflows/samples-dotnet6-server.yaml @@ -2,27 +2,46 @@ name: Samples C# .Net 6 Server on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/aspnetcore-6.0/** - samples/server/petstore/aspnetcore-6.0-*/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/aspnetcore-6.0/** - samples/server/petstore/aspnetcore-6.0-*/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/aspnetcore-6.0 + samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse + samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes + samples/server/petstore/aspnetcore-6.0-pocoModels + samples/server/petstore/aspnetcore-6.0-project4Models + samples/server/petstore/aspnetcore-6.0-useSwashBuckle + build: name: Build .Net 6 servers + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/server/petstore/aspnetcore-6.0 - - samples/server/petstore/aspnetcore-6.0-NewtonsoftFalse - - samples/server/petstore/aspnetcore-6.0-nullableReferenceTypes - - samples/server/petstore/aspnetcore-6.0-pocoModels - - samples/server/petstore/aspnetcore-6.0-project4Models - - samples/server/petstore/aspnetcore-6.0-useSwashBuckle + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet7-client.yml b/.github/workflows/samples-dotnet7-client.yml index 81343b056d4d..4fec6f9db6f6 100644 --- a/.github/workflows/samples-dotnet7-client.yml +++ b/.github/workflows/samples-dotnet7-client.yml @@ -2,6 +2,7 @@ name: Samples C# .Net 7 Client on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: # the .NET Core 3.0 runtime is no longer supported as it reached its end-of-life on March 3, 2020 #- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/** @@ -14,6 +15,7 @@ on: - samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/** - samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: #- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/** - samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/** @@ -25,22 +27,40 @@ on: - samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/** - samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/ + samples/client/petstore/csharp/restsharp/net4.7/Petstore/ + samples/client/petstore/csharp/restsharp/net4.8/Petstore/ + samples/client/petstore/csharp/restsharp/net8/ParameterMappings/ + samples/client/petstore/csharp/restsharp/net8/EnumMappings/ + samples/client/petstore/csharp/restsharp/net8/Petstore/ + samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/ + samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/ + # Commented-out samples from original matrix: + #- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/ + build: name: Build clients + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: windows-latest strategy: fail-fast: false - matrix: - sample: - #- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/ - - samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/ - - samples/client/petstore/csharp/restsharp/net4.7/Petstore/ - - samples/client/petstore/csharp/restsharp/net4.8/Petstore/ - - samples/client/petstore/csharp/restsharp/net8/ParameterMappings/ - - samples/client/petstore/csharp/restsharp/net8/EnumMappings/ - - samples/client/petstore/csharp/restsharp/net8/Petstore/ - - samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/ - - samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet8-client-echo-api.yaml b/.github/workflows/samples-dotnet8-client-echo-api.yaml index b84f9334e31f..20ddfc43790a 100644 --- a/.github/workflows/samples-dotnet8-client-echo-api.yaml +++ b/.github/workflows/samples-dotnet8-client-echo-api.yaml @@ -2,21 +2,39 @@ name: Samples C# .Net 8 Client Echo API on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/csharp/restsharp/net8/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/csharp/restsharp/net8/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/echo_api/csharp/restsharp/net8/EchoApi + build: name: Build .Net clients + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/csharp/restsharp/net8/EchoApi + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet8-client.yaml b/.github/workflows/samples-dotnet8-client.yaml index 5a0814982c76..0331e8b04abf 100644 --- a/.github/workflows/samples-dotnet8-client.yaml +++ b/.github/workflows/samples-dotnet8-client.yaml @@ -2,21 +2,40 @@ name: Samples C# .Net 8 Client on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/restsharp/net8/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/restsharp/net8/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/csharp/restsharp/net8/ParameterMappings/ + samples/client/petstore/csharp/restsharp/net8/useVirtualForHooks/ + build: name: Build .Net clients + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/csharp/restsharp/net8/ParameterMappings/ - - samples/client/petstore/csharp/restsharp/net8/useVirtualForHooks/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet8-server.yaml b/.github/workflows/samples-dotnet8-server.yaml index 874c99722d8f..9aa75304813d 100644 --- a/.github/workflows/samples-dotnet8-server.yaml +++ b/.github/workflows/samples-dotnet8-server.yaml @@ -2,28 +2,47 @@ name: Samples C# .Net 8 Server on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/aspnetcore-8.0/** - samples/server/petstore/aspnetcore-8.0-*/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/aspnetcore-8.0/** - samples/server/petstore/aspnetcore-8.0-*/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/aspnetcore-8.0 + samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse + samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes + samples/server/petstore/aspnetcore-8.0-pocoModels + samples/server/petstore/aspnetcore-8.0-project4Models + samples/server/petstore/aspnetcore-8.0-useSwashBuckle + samples/server/petstore/aspnetcore-8.0-use-centralized-package-version-management + build: name: Build .Net 8 servers + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/server/petstore/aspnetcore-8.0 - - samples/server/petstore/aspnetcore-8.0-NewtonsoftFalse - - samples/server/petstore/aspnetcore-8.0-nullableReferenceTypes - - samples/server/petstore/aspnetcore-8.0-pocoModels - - samples/server/petstore/aspnetcore-8.0-project4Models - - samples/server/petstore/aspnetcore-8.0-useSwashBuckle - - samples/server/petstore/aspnetcore-8.0-use-centralized-package-version-management + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet8.yaml b/.github/workflows/samples-dotnet8.yaml index a9a84f9b2a06..7ab429391228 100644 --- a/.github/workflows/samples-dotnet8.yaml +++ b/.github/workflows/samples-dotnet8.yaml @@ -2,36 +2,55 @@ name: Samples C# .Net 8 Clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/net8/** - samples/client/petstore/csharp/httpclient/net8/** - samples/client/petstore/csharp/restsharp/net8/** - samples/client/petstore/csharp/unityWebRequest/net8/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/net8/** - samples/client/petstore/csharp/httpclient/net8/** - samples/client/petstore/csharp/restsharp/net8/** - samples/client/petstore/csharp/unityWebRequest/net8/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/csharp/generichost/net8/AllOf + samples/client/petstore/csharp/generichost/net8/AnyOf + samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare + samples/client/petstore/csharp/generichost/net8/FormModels + samples/client/petstore/csharp/generichost/net8/ManualPetstoreTests + samples/client/petstore/csharp/generichost/net8/ManualSourceGenerationTests + samples/client/petstore/csharp/generichost/net8/NullReferenceTypes + samples/client/petstore/csharp/generichost/net8/OneOf + samples/client/petstore/csharp/generichost/net8/Petstore + samples/client/petstore/csharp/generichost/net8/SourceGeneration + samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate + build: name: Build .Net 8 projects + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/csharp/generichost/net8/AllOf - - samples/client/petstore/csharp/generichost/net8/AnyOf - - samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare - - samples/client/petstore/csharp/generichost/net8/FormModels - - samples/client/petstore/csharp/generichost/net8/ManualPetstoreTests - - samples/client/petstore/csharp/generichost/net8/ManualSourceGenerationTests - - samples/client/petstore/csharp/generichost/net8/NullReferenceTypes - - samples/client/petstore/csharp/generichost/net8/OneOf - - samples/client/petstore/csharp/generichost/net8/Petstore - - samples/client/petstore/csharp/generichost/net8/SourceGeneration - - samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-dotnet9.yaml b/.github/workflows/samples-dotnet9.yaml index 55b3fe73f064..aa417c66c8cc 100644 --- a/.github/workflows/samples-dotnet9.yaml +++ b/.github/workflows/samples-dotnet9.yaml @@ -2,43 +2,60 @@ name: Samples C# .Net 9 Clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/net9/** - samples/client/petstore/csharp/httpclient/net9/** - samples/client/petstore/csharp/restsharp/net9/** - samples/client/petstore/csharp/unityWebRequest/net9/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/net9/** - samples/client/petstore/csharp/httpclient/net9/** - samples/client/petstore/csharp/restsharp/net9/** - samples/client/petstore/csharp/unityWebRequest/net9/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/csharp/generichost/net9/AllOf + samples/client/petstore/csharp/generichost/net9/AnyOf + samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare + samples/client/petstore/csharp/generichost/net9/FormModels + samples/client/petstore/csharp/generichost/net9/NullReferenceTypes + samples/client/petstore/csharp/generichost/net9/OneOf + samples/client/petstore/csharp/generichost/net9/Petstore + samples/client/petstore/csharp/generichost/net9/SourceGeneration + samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate + samples/client/petstore/csharp/restsharp/net9/EnumMappings + samples/client/petstore/csharp/httpclient/net9/Petstore + samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi + # Commented-out samples from original matrix: + # - samples/client/petstore/csharp/generichost/net9/ManualPetstoreTests + # - samples/client/petstore/csharp/generichost/net9/ManualSourceGenerationTests + #- samples/client/petstore/csharp/unityWebRequest/net9/Petstore + build: name: Build .Net 9 projects + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/csharp/generichost/net9/AllOf - - samples/client/petstore/csharp/generichost/net9/AnyOf - - samples/client/petstore/csharp/generichost/net9/AnyOfNoCompare - - samples/client/petstore/csharp/generichost/net9/FormModels - # - samples/client/petstore/csharp/generichost/net9/ManualPetstoreTests - # - samples/client/petstore/csharp/generichost/net9/ManualSourceGenerationTests - - samples/client/petstore/csharp/generichost/net9/NullReferenceTypes - - samples/client/petstore/csharp/generichost/net9/OneOf - - samples/client/petstore/csharp/generichost/net9/Petstore - - samples/client/petstore/csharp/generichost/net9/SourceGeneration - - samples/client/petstore/csharp/generichost/net9/UseDateTimeForDate - # restsharp - - samples/client/petstore/csharp/restsharp/net9/EnumMappings - # httpclient - - samples/client/petstore/csharp/httpclient/net9/Petstore - - samples/client/petstore/csharp/httpclient/net9/Petstore-nonPublicApi - # unity - #- samples/client/petstore/csharp/unityWebRequest/net9/Petstore + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-dotnet@v5.3.0 diff --git a/.github/workflows/samples-elixir.yaml b/.github/workflows/samples-elixir.yaml index e3752823eaf5..8f619c73ed33 100644 --- a/.github/workflows/samples-elixir.yaml +++ b/.github/workflows/samples-elixir.yaml @@ -2,21 +2,41 @@ name: Samples Elixir on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/elixir/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/elixir/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/elixir/ + build: + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} strategy: matrix: otp: ['25.3.2', '26.2.5', '27.3.3'] elixir: ['1.18.3'] - sample: - - samples/client/petstore/elixir/ + sample: ${{ fromJson(needs.setup.outputs.samples) }} services: petstore-api: image: swaggerapi/petstore diff --git a/.github/workflows/samples-elm.yaml b/.github/workflows/samples-elm.yaml index c1e9ba2f39b9..212121ddfc77 100644 --- a/.github/workflows/samples-elm.yaml +++ b/.github/workflows/samples-elm.yaml @@ -2,26 +2,44 @@ name: Samples Elm on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - .github/workflows/samples-elm.yaml - samples/client/petstore/elm/** - samples/openapi3/client/elm/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - .github/workflows/samples-elm.yaml - samples/client/petstore/elm/** - samples/openapi3/client/elm/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/elm + samples/openapi3/client/elm + build: name: Build Elm clients + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/petstore/elm - - samples/openapi3/client/elm + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: jorelali/setup-elm@v6 diff --git a/.github/workflows/samples-erlang.yaml b/.github/workflows/samples-erlang.yaml index f57671d82d5a..fef0128199c4 100644 --- a/.github/workflows/samples-erlang.yaml +++ b/.github/workflows/samples-erlang.yaml @@ -2,29 +2,48 @@ name: Samples Erlang on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/echo_api/erlang-server/** - samples/server/petstore/erlang-server/** - samples/client/petstore/erlang-client/** - samples/client/petstore/erlang-proper/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/echo_api/erlang-server/** - samples/server/petstore/erlang-server/** - samples/client/petstore/erlang-client/** - samples/client/petstore/erlang-proper/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/echo_api/erlang-server/ + samples/server/petstore/erlang-server/ + samples/client/petstore/erlang-client/ + samples/client/petstore/erlang-proper/ + build: name: Build Erlang projects + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-24.04 strategy: fail-fast: false - matrix: - sample: - - samples/server/echo_api/erlang-server/ - - samples/server/petstore/erlang-server/ - - samples/client/petstore/erlang-client/ - - samples/client/petstore/erlang-proper/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: erlef/setup-beam@v1 diff --git a/.github/workflows/samples-go-client-echo-api.yaml b/.github/workflows/samples-go-client-echo-api.yaml index 6285a6d8ae58..21da90298530 100644 --- a/.github/workflows/samples-go-client-echo-api.yaml +++ b/.github/workflows/samples-go-client-echo-api.yaml @@ -2,19 +2,36 @@ name: Go Client (Echo API) on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/go/** - .github/workflows/samples-go-client-echo-api.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/echo_api/go + build: name: Test Go client + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/go + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-go@v6 diff --git a/.github/workflows/samples-go-client-petstore.yaml b/.github/workflows/samples-go-client-petstore.yaml index 581a7a5bd28d..0aa1c33e8997 100644 --- a/.github/workflows/samples-go-client-petstore.yaml +++ b/.github/workflows/samples-go-client-petstore.yaml @@ -2,17 +2,39 @@ name: Samples Go Clients (Petstore) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/go/** - samples/openapi3/client/petstore/go/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/go/** - samples/openapi3/client/petstore/go/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/go/ + samples/openapi3/client/petstore/go/ + build: name: Build Go + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest services: petstore-api: @@ -24,10 +46,7 @@ jobs: SWAGGER_BASE_PATH: /v2 strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/go/ - - samples/openapi3/client/petstore/go/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-go-client.yaml b/.github/workflows/samples-go-client.yaml index 198c9597c8dd..9e4da351d7db 100644 --- a/.github/workflows/samples-go-client.yaml +++ b/.github/workflows/samples-go-client.yaml @@ -2,6 +2,7 @@ name: Samples Go Clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**' - 'samples/openapi3/client/petstore/go-petstore-withXml/**' @@ -10,6 +11,7 @@ on: - samples/client/others/go/oneof-anyof-required/** - samples/client/others/go/oneof-discriminator-lookup/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**' - 'samples/openapi3/client/petstore/go-petstore-withXml/**' @@ -18,19 +20,36 @@ on: - samples/client/others/go/oneof-anyof-required/** - samples/client/others/go/oneof-discriminator-lookup/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/' + 'samples/openapi3/client/petstore/go-petstore-withXml/' + samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/ + samples/client/others/go/allof_multiple_ref_and_discriminator/ + samples/client/others/go/oneof-anyof-required/ + samples/client/others/go/oneof-discriminator-lookup/ + build: name: Build Go + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: windows-latest strategy: fail-fast: false - matrix: - sample: - - 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/' - - 'samples/openapi3/client/petstore/go-petstore-withXml/' - - samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/ - - samples/client/others/go/allof_multiple_ref_and_discriminator/ - - samples/client/others/go/oneof-anyof-required/ - - samples/client/others/go/oneof-discriminator-lookup/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-go@v6 diff --git a/.github/workflows/samples-go-gin.yaml b/.github/workflows/samples-go-gin.yaml index e9ac50e6cb23..ea5a1e0c6512 100644 --- a/.github/workflows/samples-go-gin.yaml +++ b/.github/workflows/samples-go-gin.yaml @@ -2,24 +2,43 @@ name: Samples Go on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/go-gin-api-server/**' - 'samples/server/petstore/go-gin-api-server-interface-only/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/go-gin-api-server/**' - 'samples/server/petstore/go-gin-api-server-interface-only/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/go-gin-api-server/ + samples/server/petstore/go-gin-api-server-interface-only/ + build: name: Build Go + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/server/petstore/go-gin-api-server/ - - samples/server/petstore/go-gin-api-server-interface-only/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-go@v6 diff --git a/.github/workflows/samples-go.yaml b/.github/workflows/samples-go.yaml index 3d3418767e5f..b617fa8e7e82 100644 --- a/.github/workflows/samples-go.yaml +++ b/.github/workflows/samples-go.yaml @@ -2,12 +2,14 @@ name: Samples Go on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/go-echo-server/**' - 'samples/server/petstore/go-api-server/**' - 'samples/server/petstore/go-chi-server/**' - 'samples/server/others/go-server/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/go-echo-server/**' - 'samples/server/petstore/go-api-server/**' @@ -15,18 +17,35 @@ on: - 'samples/server/others/go-server/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/go-echo-server/ + samples/server/petstore/go-api-server/ + samples/server/petstore/go-chi-server/ + samples/server/others/go-server/no-body-path-params/ + samples/server/others/go-server/optional-body/ + build: name: Build Go + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/server/petstore/go-echo-server/ - - samples/server/petstore/go-api-server/ - - samples/server/petstore/go-chi-server/ - - samples/server/others/go-server/no-body-path-params/ - - samples/server/others/go-server/optional-body/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-go@v6 diff --git a/.github/workflows/samples-groovy.yaml b/.github/workflows/samples-groovy.yaml index 0283e53682d7..069bb4d4e61e 100644 --- a/.github/workflows/samples-groovy.yaml +++ b/.github/workflows/samples-groovy.yaml @@ -2,9 +2,11 @@ name: Samples Groovy on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/groovy**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/groovy**' @@ -12,22 +14,32 @@ env: GRADLE_VERSION: 6.9 jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/groovy + 80:8080 + build: name: Build Groovy + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/groovy - services: - petstore-api: - image: swaggerapi/petstore - ports: - - 80:8080 - env: - SWAGGER_HOST: http://petstore.swagger.io - SWAGGER_BASE_PATH: /v2 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-haskell.yaml b/.github/workflows/samples-haskell.yaml index d7904892a970..1be12e539d50 100644 --- a/.github/workflows/samples-haskell.yaml +++ b/.github/workflows/samples-haskell.yaml @@ -2,30 +2,48 @@ name: Samples Haskell on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/haskell-yesod/** - samples/server/petstore/haskell-servant/** - samples/server/others/haskell-servant-ping/** - samples/client/petstore/haskell-http-client/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/haskell-yesod/** - samples/server/petstore/haskell-servant/** - samples/server/others/haskell-servant-ping/** - samples/client/petstore/haskell-http-client/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/haskell-yesod/ + samples/server/petstore/haskell-servant/ + samples/server/others/haskell-servant-ping/ + samples/client/petstore/haskell-http-client/ + build: name: Build stack projects + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/haskell-yesod/ - - samples/server/petstore/haskell-servant/ - - samples/server/others/haskell-servant-ping/ - - samples/client/petstore/haskell-http-client/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: haskell/actions/setup@v2 diff --git a/.github/workflows/samples-java-client-echo-api-jdk11.yaml b/.github/workflows/samples-java-client-echo-api-jdk11.yaml index af72c09d0cfb..65d6177f9ec4 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk11.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk11.yaml @@ -2,25 +2,43 @@ name: Java Client (Echo API) JDK11 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/java/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/java/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/echo_api/java/apache-httpclient + samples/client/echo_api/java/native + samples/client/echo_api/java/feign-gson + samples/client/echo_api/java/resttemplate + samples/client/echo_api/java/resteasy + build: name: Build Java Client JDK11 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/java/apache-httpclient - - samples/client/echo_api/java/native - - samples/client/echo_api/java/feign-gson - - samples/client/echo_api/java/resttemplate - - samples/client/echo_api/java/resteasy + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-client-echo-api-jdk17.yaml b/.github/workflows/samples-java-client-echo-api-jdk17.yaml index 930cfe32a32f..477b5a863d78 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk17.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk17.yaml @@ -2,26 +2,44 @@ name: Java Client (Echo API) JDK17 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/java/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/java/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/echo_api/java/apache-httpclient + samples/client/echo_api/java/native + samples/client/echo_api/java/feign-gson + samples/client/echo_api/java/resttemplate + samples/client/echo_api/java/resteasy + samples/client/echo_api/java/restclient + build: name: Build Java Client JDK17 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/java/apache-httpclient - - samples/client/echo_api/java/native - - samples/client/echo_api/java/feign-gson - - samples/client/echo_api/java/resttemplate - - samples/client/echo_api/java/resteasy - - samples/client/echo_api/java/restclient + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-client-echo-api-jdk8.yaml b/.github/workflows/samples-java-client-echo-api-jdk8.yaml index e1308c93d25e..c5e647e23e94 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk8.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk8.yaml @@ -2,6 +2,7 @@ name: Java Client (Echo API) JDK8 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/java/apache-httpclient/** - samples/client/echo_api/java/feign-gson/** @@ -9,25 +10,42 @@ on: - samples/client/echo_api/java/resttemplate/** - samples/client/echo_api/java/resteasy/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/java/apache-httpclient/** - samples/client/echo_api/java/feign-gson/** - samples/client/echo_api/java/okhttp-gson/** - samples/client/echo_api/java/resteasy/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/echo_api/java/apache-httpclient + samples/client/echo_api/java/feign-gson + samples/client/echo_api/java/okhttp-gson + samples/client/echo_api/java/resttemplate + samples/client/echo_api/java/resteasy + build: name: Build Java Client JDK8 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/java/apache-httpclient - - samples/client/echo_api/java/feign-gson - - samples/client/echo_api/java/okhttp-gson - - samples/client/echo_api/java/resttemplate - - samples/client/echo_api/java/resteasy + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml index 41bd99733767..ab0bcc137e3d 100644 --- a/.github/workflows/samples-java-client-jdk11.yaml +++ b/.github/workflows/samples-java-client-jdk11.yaml @@ -2,6 +2,7 @@ name: Samples Java Client JDK11 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/java/**' - samples/client/petstore/jaxrs-cxf-client/** @@ -24,6 +25,7 @@ on: - samples/client/others/java/resttemplate-list-schema-validation/** - samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/java/**' - samples/client/petstore/jaxrs-cxf-client/** @@ -46,72 +48,88 @@ on: - samples/client/others/java/resttemplate-list-schema-validation/** - samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/jaxrs-cxf-client-swagger2 + samples/client/petstore/jaxrs-cxf-client + samples/client/petstore/java/native + samples/client/petstore/java/native-async + samples/client/petstore/java/native-jakarta + samples/client/petstore/java/native-useGzipFeature + samples/client/petstore/java/retrofit2 + samples/client/petstore/java/retrofit2rx2 + samples/client/petstore/java/retrofit2rx3 + samples/client/petstore/java/retrofit2-play26 + samples/client/petstore/java/resttemplate + samples/client/petstore/java/resttemplate-withXml + samples/client/petstore/java/webclient + samples/client/petstore/java/webclient-nullable-arrays + samples/client/petstore/java/webclient-swagger2 + samples/client/petstore/java/webclient-useSingleRequestParameter + samples/client/petstore/java/vertx + samples/client/petstore/java/vertx5 + samples/client/petstore/java/vertx5-supportVertxFuture + samples/client/petstore/java/vertx-no-nullable + samples/client/petstore/java/vertx-supportVertxFuture + samples/client/petstore/java/jersey2-java8-localdatetime + samples/client/petstore/java/google-api-client + samples/client/petstore/java/rest-assured + samples/client/petstore/java/rest-assured-jackson + samples/client/petstore/java/microprofile-rest-client + samples/client/petstore/java/microprofile-rest-client-mutiny + samples/client/petstore/java/microprofile-rest-client-3.0 + samples/client/petstore/java/microprofile-rest-client-3.0-jackson + samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny + samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml + samples/client/petstore/java/microprofile-rest-client-3.0-mutiny + samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter + samples/client/petstore/java/apache-httpclient + samples/client/petstore/java/feign + samples/client/petstore/java/feign-hc5 + samples/client/petstore/java/feign-no-nullable + samples/client/petstore/java/okhttp-gson-awsv4signature + samples/openapi3/client/petstore/java/jersey2-java8-special-characters + samples/openapi3/client/petstore/java/native + samples/client/petstore/java/okhttp-gson-swagger1/ + samples/client/petstore/java/resttemplate-swagger1/ + samples/openapi3/client/petstore/java/jersey2-java8-swagger1/ + samples/client/petstore/java/okhttp-gson-swagger2/ + samples/client/petstore/java/resttemplate-swagger2/ + samples/openapi3/client/petstore/java/jersey2-java8-swagger2/ + samples/client/others/java/okhttp-gson-oneOf/ + samples/client/others/java/okhttp-gson-oneOf-array/ + samples/client/echo_api/java/okhttp-gson-user-defined-templates/ + samples/client/others/java/resttemplate-useAbstractionForFiles/ + samples/client/others/java/webclient-useAbstractionForFiles/ + samples/client/others/java/jersey2-oneOf-duplicates/ + samples/client/others/java/jersey2-oneOf-Mixed/ + samples/client/others/java/resttemplate-list-schema-validation/ + samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/ + samples/client/others/java/okhttp-gson-streaming/ + samples/client/petstore/java/resteasy/ + samples/client/petstore/java/apache-httpclient/ + build: name: Build Java Client JDK11 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/petstore/jaxrs-cxf-client-swagger2 - - samples/client/petstore/jaxrs-cxf-client - - samples/client/petstore/java/native - - samples/client/petstore/java/native-async - - samples/client/petstore/java/native-jakarta - - samples/client/petstore/java/native-useGzipFeature - - samples/client/petstore/java/retrofit2 - - samples/client/petstore/java/retrofit2rx2 - - samples/client/petstore/java/retrofit2rx3 - - samples/client/petstore/java/retrofit2-play26 - - samples/client/petstore/java/resttemplate - - samples/client/petstore/java/resttemplate-withXml - - samples/client/petstore/java/webclient - - samples/client/petstore/java/webclient-nullable-arrays - - samples/client/petstore/java/webclient-swagger2 - - samples/client/petstore/java/webclient-useSingleRequestParameter - - samples/client/petstore/java/vertx - - samples/client/petstore/java/vertx5 - - samples/client/petstore/java/vertx5-supportVertxFuture - - samples/client/petstore/java/vertx-no-nullable - - samples/client/petstore/java/vertx-supportVertxFuture - - samples/client/petstore/java/jersey2-java8-localdatetime - - samples/client/petstore/java/google-api-client - - samples/client/petstore/java/rest-assured - - samples/client/petstore/java/rest-assured-jackson - - samples/client/petstore/java/microprofile-rest-client - - samples/client/petstore/java/microprofile-rest-client-mutiny - - samples/client/petstore/java/microprofile-rest-client-3.0 - - samples/client/petstore/java/microprofile-rest-client-3.0-jackson - - samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny - - samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml - - samples/client/petstore/java/microprofile-rest-client-3.0-mutiny - - samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter - - samples/client/petstore/java/apache-httpclient - - samples/client/petstore/java/feign - - samples/client/petstore/java/feign-hc5 - - samples/client/petstore/java/feign-no-nullable - - samples/client/petstore/java/okhttp-gson-awsv4signature - - samples/openapi3/client/petstore/java/jersey2-java8-special-characters - - samples/openapi3/client/petstore/java/native - - samples/client/petstore/java/okhttp-gson-swagger1/ - - samples/client/petstore/java/resttemplate-swagger1/ - - samples/openapi3/client/petstore/java/jersey2-java8-swagger1/ - - samples/client/petstore/java/okhttp-gson-swagger2/ - - samples/client/petstore/java/resttemplate-swagger2/ - - samples/openapi3/client/petstore/java/jersey2-java8-swagger2/ - - samples/client/others/java/okhttp-gson-oneOf/ - - samples/client/others/java/okhttp-gson-oneOf-array/ - - samples/client/echo_api/java/okhttp-gson-user-defined-templates/ - - samples/client/others/java/resttemplate-useAbstractionForFiles/ - - samples/client/others/java/webclient-useAbstractionForFiles/ - - samples/client/others/java/jersey2-oneOf-duplicates/ - - samples/client/others/java/jersey2-oneOf-Mixed/ - - samples/client/others/java/resttemplate-list-schema-validation/ - - samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/ - - samples/client/others/java/okhttp-gson-streaming/ - - samples/client/petstore/java/resteasy/ - - samples/client/petstore/java/apache-httpclient/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-client-jdk17.yaml b/.github/workflows/samples-java-client-jdk17.yaml index c7b9b36099c3..eec23b240f74 100644 --- a/.github/workflows/samples-java-client-jdk17.yaml +++ b/.github/workflows/samples-java-client-jdk17.yaml @@ -2,6 +2,7 @@ name: Samples Java Client JDK17 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java/resttemplate-jakarta/** - samples/client/petstore/java/resttemplate-springBoot4-*/** @@ -20,6 +21,7 @@ on: - samples/client/petstore/java/jersey3-oneOf/** - samples/client/petstore/java/jersey3-jackson3/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java/resttemplate-jakarta/** - samples/client/petstore/java/resttemplate-springBoot4-*/** @@ -38,38 +40,54 @@ on: - samples/client/petstore/java/jersey3-oneOf/** - samples/client/petstore/java/jersey3-jackson3/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/java/resttemplate-jakarta + samples/client/petstore/java/resttemplate-springBoot4-jackson2 + samples/client/petstore/java/resttemplate-springBoot4-jackson3 + samples/client/petstore/java/webclient-jakarta + samples/client/petstore/java/restclient + samples/client/petstore/java/restclient-nullable-arrays + samples/client/petstore/java/restclient-springBoot4-jackson2 + samples/client/petstore/java/restclient-springBoot4-jackson3 + samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify + samples/client/petstore/java/native-jackson3-jspecify + samples/client/petstore/java/restclient-swagger2 + samples/client/petstore/java/restclient-useSingleRequestParameter + samples/client/petstore/java/restclient-useSingleRequestParameter-static + samples/client/petstore/java/native-jackson3 + samples/client/petstore/java/apache-httpclient-jackson3 + samples/client/others/java/webclient-sealedInterface + samples/client/others/java/webclient-sealedInterface_3_1 + samples/client/petstore/java/webclient-springBoot4-jackson3 + samples/client/petstore/java/webclient-useSingleRequestParameter + samples/client/others/java/restclient-enum-in-multipart + samples/client/others/java/restclient-sealedInterface + samples/client/others/java/restclient-useAbstractionForFiles + samples/client/petstore/java/jersey3-oneOf + samples/client/petstore/java/jersey3-jackson3 + build: name: Build Java Client JDK17 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/petstore/java/resttemplate-jakarta - - samples/client/petstore/java/resttemplate-springBoot4-jackson2 - - samples/client/petstore/java/resttemplate-springBoot4-jackson3 - - samples/client/petstore/java/webclient-jakarta - - samples/client/petstore/java/restclient - - samples/client/petstore/java/restclient-nullable-arrays - - samples/client/petstore/java/restclient-springBoot4-jackson2 - - samples/client/petstore/java/restclient-springBoot4-jackson3 - - samples/client/petstore/java/restclient-springBoot4-jackson3-jspecify - - samples/client/petstore/java/native-jackson3-jspecify - - samples/client/petstore/java/restclient-swagger2 - - samples/client/petstore/java/restclient-useSingleRequestParameter - - samples/client/petstore/java/restclient-useSingleRequestParameter-static - - samples/client/petstore/java/native-jackson3 - - samples/client/petstore/java/apache-httpclient-jackson3 - - samples/client/others/java/webclient-sealedInterface - - samples/client/others/java/webclient-sealedInterface_3_1 - - samples/client/petstore/java/webclient-springBoot4-jackson3 - - samples/client/petstore/java/webclient-useSingleRequestParameter - - samples/client/others/java/restclient-enum-in-multipart - - samples/client/others/java/restclient-sealedInterface - - samples/client/others/java/restclient-useAbstractionForFiles - - samples/client/petstore/java/jersey3-oneOf - - samples/client/petstore/java/jersey3-jackson3 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-dubbo.yaml b/.github/workflows/samples-java-dubbo.yaml index 3d2accbe998b..7a9e97e6052b 100644 --- a/.github/workflows/samples-java-dubbo.yaml +++ b/.github/workflows/samples-java-dubbo.yaml @@ -2,22 +2,40 @@ name: Samples Java Dubbo on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/java-dubbo/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/java-dubbo/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/java-dubbo + build: name: Build Java Dubbo + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/java-dubbo + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-helidon-v3.yaml b/.github/workflows/samples-java-helidon-v3.yaml index 19d30cb27c29..b21a2506e595 100644 --- a/.github/workflows/samples-java-helidon-v3.yaml +++ b/.github/workflows/samples-java-helidon-v3.yaml @@ -2,29 +2,47 @@ name: Samples Java Helidon v3 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java-helidon-client/v3/** - samples/server/petstore/java-helidon-server/v3/** - samples/server/others/java-helidon-server/v3/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java-helidon-client/v3/** - samples/server/petstore/java-helidon-server/v3/** - samples/server/others/java-helidon-server/v3/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/java-helidon-client/v3/mp + samples/client/petstore/java-helidon-client/v3/se + samples/server/petstore/java-helidon-server/v3/mp + samples/server/petstore/java-helidon-server/v3/se + samples/server/others/java-helidon-server/v3/mp-format-test + build: name: Build Java Helidon + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/java-helidon-client/v3/mp - - samples/client/petstore/java-helidon-client/v3/se - - samples/server/petstore/java-helidon-server/v3/mp - - samples/server/petstore/java-helidon-server/v3/se - - samples/server/others/java-helidon-server/v3/mp-format-test - version: [17] + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-helidon-v4.yaml b/.github/workflows/samples-java-helidon-v4.yaml index c5aec00d2c75..8e513580b5e9 100644 --- a/.github/workflows/samples-java-helidon-v4.yaml +++ b/.github/workflows/samples-java-helidon-v4.yaml @@ -2,30 +2,48 @@ name: Samples Java Helidon v4 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java-helidon-client/v4/** - samples/server/petstore/java-helidon-server/v4/** - samples/server/others/java-helidon-server/v4/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java-helidon-client/v4/** - samples/server/petstore/java-helidon-server/v4/** - samples/server/others/java-helidon-server/v4/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/java-helidon-client/v4/mp + samples/client/petstore/java-helidon-client/v4/se + samples/server/petstore/java-helidon-server/v4/mp + samples/server/petstore/java-helidon-server/v4/se + samples/server/petstore/java-helidon-server/v4/se-uac + samples/server/others/java-helidon-server/v4/mp-format-test + build: name: Build Java Helidon + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/java-helidon-client/v4/mp - - samples/client/petstore/java-helidon-client/v4/se - - samples/server/petstore/java-helidon-server/v4/mp - - samples/server/petstore/java-helidon-server/v4/se - - samples/server/petstore/java-helidon-server/v4/se-uac - - samples/server/others/java-helidon-server/v4/mp-format-test - version: [21] + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-petsore-client-jdk11.yaml b/.github/workflows/samples-java-petsore-client-jdk11.yaml index 91f389fbeab1..5c31b94cd4b8 100644 --- a/.github/workflows/samples-java-petsore-client-jdk11.yaml +++ b/.github/workflows/samples-java-petsore-client-jdk11.yaml @@ -3,6 +3,7 @@ name: Samples Java Petsore Client JDK11 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java/jersey2-java8/** - samples/openapi3/client/petstore/java/jersey2-java8/** @@ -12,6 +13,7 @@ on: - samples/client/petstore/java/okhttp-gson-dynamicOperations/** - samples/client/petstore/java-micronaut-client/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java/jersey2-java8/** - samples/openapi3/client/petstore/java/jersey2-java8/** @@ -21,28 +23,38 @@ on: - samples/client/petstore/java/okhttp-gson-dynamicOperations/** - samples/client/petstore/java-micronaut-client/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/java/jersey2-java8 + samples/openapi3/client/petstore/java/jersey2-java8 + samples/client/petstore/java/jersey3 + samples/client/petstore/java/okhttp-gson + samples/client/petstore/java/okhttp-gson-3.1 + samples/client/petstore/java/okhttp-gson-dynamicOperations + samples/client/petstore/java-micronaut-client + 80:8080 + build: name: Build Java Client JDK11 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/java/jersey2-java8 - - samples/openapi3/client/petstore/java/jersey2-java8 - - samples/client/petstore/java/jersey3 - - samples/client/petstore/java/okhttp-gson - - samples/client/petstore/java/okhttp-gson-3.1 - - samples/client/petstore/java/okhttp-gson-dynamicOperations - - samples/client/petstore/java-micronaut-client - services: - petstore-api: - image: swaggerapi/petstore - ports: - - 80:8080 - env: - SWAGGER_HOST: http://petstore.swagger.io - SWAGGER_BASE_PATH: /v2 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-java-petsore-client-jdk17.yaml b/.github/workflows/samples-java-petsore-client-jdk17.yaml index b2b680c7afaa..727253872e1a 100644 --- a/.github/workflows/samples-java-petsore-client-jdk17.yaml +++ b/.github/workflows/samples-java-petsore-client-jdk17.yaml @@ -3,28 +3,40 @@ name: Samples Java Petsore Client JDK17 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java/jersey3/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/java/jersey3/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/java/jersey3 + 80:8080 + build: name: Build Java Client JDK17 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/java/jersey3 - services: - petstore-api: - image: swaggerapi/petstore - ports: - - 80:8080 - env: - SWAGGER_HOST: http://petstore.swagger.io - SWAGGER_BASE_PATH: /v2 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-java-play-framework.yaml b/.github/workflows/samples-java-play-framework.yaml index 7ce841395cac..74754514c9e1 100644 --- a/.github/workflows/samples-java-play-framework.yaml +++ b/.github/workflows/samples-java-play-framework.yaml @@ -2,32 +2,50 @@ name: Samples Java Play Framework on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/java-play-framework**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/java-play-framework**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/java-play-framework + samples/server/petstore/java-play-framework-api-package-override + samples/server/petstore/java-play-framework-async + samples/server/petstore/java-play-framework-controller-only + samples/server/petstore/java-play-framework-fake-endpoints + samples/server/petstore/java-play-framework-fake-endpoints-with-security + samples/server/petstore/java-play-framework-no-bean-validation + samples/server/petstore/java-play-framework-no-excp-handling + samples/server/petstore/java-play-framework-no-interface + samples/server/petstore/java-play-framework-no-nullable + samples/server/petstore/java-play-framework-no-swagger-ui + samples/server/petstore/java-play-framework-no-wrap-calls + build: name: Build Java Play Framework + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/java-play-framework - - samples/server/petstore/java-play-framework-api-package-override - - samples/server/petstore/java-play-framework-async - - samples/server/petstore/java-play-framework-controller-only - - samples/server/petstore/java-play-framework-fake-endpoints - - samples/server/petstore/java-play-framework-fake-endpoints-with-security - - samples/server/petstore/java-play-framework-no-bean-validation - - samples/server/petstore/java-play-framework-no-excp-handling - - samples/server/petstore/java-play-framework-no-interface - - samples/server/petstore/java-play-framework-no-nullable - - samples/server/petstore/java-play-framework-no-swagger-ui - - samples/server/petstore/java-play-framework-no-wrap-calls + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-sbt.yaml b/.github/workflows/samples-java-sbt.yaml index b8165742ab69..c837637999fe 100644 --- a/.github/workflows/samples-java-sbt.yaml +++ b/.github/workflows/samples-java-sbt.yaml @@ -2,21 +2,39 @@ name: Samples Java (sbt) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/java/okhttp-gson/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/java/okhttp-gson/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/java/okhttp-gson + build: name: Build sbt/Java client, servers + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/petstore/java/okhttp-gson + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-server-jdk8.yaml b/.github/workflows/samples-java-server-jdk8.yaml index 682499bcf3bf..b4fafcd24711 100644 --- a/.github/workflows/samples-java-server-jdk8.yaml +++ b/.github/workflows/samples-java-server-jdk8.yaml @@ -2,6 +2,7 @@ name: Samples Java Server on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/java-vertx-web/**' - 'samples/server/petstore/java-inflector/**' @@ -10,6 +11,7 @@ on: - 'samples/server/petstore/java-undertow/**' - 'samples/server/petstore/java-microprofile/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/java-vertx-web/**' - 'samples/server/petstore/java-inflector/**' @@ -17,19 +19,36 @@ on: #- 'samples/server/petstore/java-undertow/**' - 'samples/server/petstore/java-microprofile/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/java-vertx-web/ + samples/server/petstore/java-inflector/ + samples/server/petstore/java-pkmst/ + samples/server/petstore/java-microprofile/ + # Commented-out samples from original matrix: + #- samples/server/petstore/java-undertow/ + build: name: Build Java Server + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/java-vertx-web/ - - samples/server/petstore/java-inflector/ - - samples/server/petstore/java-pkmst/ - #- samples/server/petstore/java-undertow/ - - samples/server/petstore/java-microprofile/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-java-wiremock.yaml b/.github/workflows/samples-java-wiremock.yaml index be1f677e978a..321b0f07df4e 100644 --- a/.github/workflows/samples-java-wiremock.yaml +++ b/.github/workflows/samples-java-wiremock.yaml @@ -2,20 +2,39 @@ name: Samples Java Wiremock on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/java-wiremock/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/java-wiremock/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/java-wiremock + build: name: Build Java Wiremock + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/server/petstore/java-wiremock + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-javascript.yaml b/.github/workflows/samples-javascript.yaml index c22bafba2e1d..577527f3cfdd 100644 --- a/.github/workflows/samples-javascript.yaml +++ b/.github/workflows/samples-javascript.yaml @@ -2,18 +2,42 @@ name: Samples JS clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: #- samples/client/petstore/javascript-flowtyped/** - samples/client/petstore/javascript-es6/** - samples/client/petstore/javascript-promise-es6/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: #- samples/client/petstore/javascript-flowtyped/** - samples/client/petstore/javascript-es6/** - samples/client/petstore/javascript-promise-es6/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/javascript-es6/ + samples/client/petstore/javascript-promise-es6/ + # Commented-out samples from original matrix: + # clients + build: name: Build projects + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -21,10 +45,7 @@ jobs: node: - "18.x" - "20.x" - sample: - # clients - - samples/client/petstore/javascript-es6/ - - samples/client/petstore/javascript-promise-es6/ + sample: ${{ fromJson(needs.setup.outputs.samples) }} services: petstore-api: image: swaggerapi/petstore diff --git a/.github/workflows/samples-jaxrs-jdk11.yaml b/.github/workflows/samples-jaxrs-jdk11.yaml index 9e12d5d80d84..fbf4dd0aa4af 100644 --- a/.github/workflows/samples-jaxrs-jdk11.yaml +++ b/.github/workflows/samples-jaxrs-jdk11.yaml @@ -2,21 +2,39 @@ name: Samples JAX-RS (JDK11) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/jaxrs/jersey3/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/jaxrs/jersey3/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/jaxrs/jersey3 + build: name: Build JAX-RS + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/jaxrs/jersey3 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-jaxrs.yaml b/.github/workflows/samples-jaxrs.yaml index 698f4ae7261d..e969fdfc4de8 100644 --- a/.github/workflows/samples-jaxrs.yaml +++ b/.github/workflows/samples-jaxrs.yaml @@ -2,42 +2,60 @@ name: Samples JAX-RS on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/jaxrs*/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/jaxrs*/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/jaxrs/jersey2 + samples/server/petstore/jaxrs/jersey2-useTags + samples/server/petstore/jaxrs-jersey + samples/server/petstore/jaxrs-spec + samples/server/petstore/jaxrs-spec-withxml + samples/server/petstore/jaxrs-spec-interface + samples/server/petstore/jaxrs-spec-interface-response + samples/server/petstore/jaxrs-datelib-j8 + samples/server/petstore/jaxrs-resteasy/default + samples/server/petstore/jaxrs-resteasy/eap + samples/server/petstore/jaxrs-resteasy/eap-joda + samples/server/petstore/jaxrs-resteasy/eap-java8 + samples/server/petstore/jaxrs-resteasy/joda + samples/server/petstore/jaxrs-cxf + samples/server/petstore/jaxrs-cxf-annotated-base-path + samples/server/petstore/jaxrs-cxf-cdi + samples/server/petstore/jaxrs-cxf-non-spring-app + samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations + samples/server/petstore/jaxrs-spec-swagger-annotations + samples/server/petstore/jaxrs-spec-swagger-v3-annotations-jakarta + samples/server/petstore/jaxrs-spec-swagger-v3-annotations + samples/server/petstore/jaxrs-spec/quarkus-security + build: name: Build JAX-RS + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/jaxrs/jersey2 - - samples/server/petstore/jaxrs/jersey2-useTags - - samples/server/petstore/jaxrs-jersey - - samples/server/petstore/jaxrs-spec - - samples/server/petstore/jaxrs-spec-withxml - - samples/server/petstore/jaxrs-spec-interface - - samples/server/petstore/jaxrs-spec-interface-response - - samples/server/petstore/jaxrs-datelib-j8 - - samples/server/petstore/jaxrs-resteasy/default - - samples/server/petstore/jaxrs-resteasy/eap - - samples/server/petstore/jaxrs-resteasy/eap-joda - - samples/server/petstore/jaxrs-resteasy/eap-java8 - - samples/server/petstore/jaxrs-resteasy/joda - - samples/server/petstore/jaxrs-cxf - - samples/server/petstore/jaxrs-cxf-annotated-base-path - - samples/server/petstore/jaxrs-cxf-cdi - - samples/server/petstore/jaxrs-cxf-non-spring-app - - samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations - - samples/server/petstore/jaxrs-spec-swagger-annotations - - samples/server/petstore/jaxrs-spec-swagger-v3-annotations-jakarta - - samples/server/petstore/jaxrs-spec-swagger-v3-annotations - - samples/server/petstore/jaxrs-spec/quarkus-security + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml index 33fb66f3229c..30e7c2b28404 100644 --- a/.github/workflows/samples-jdk17.yaml +++ b/.github/workflows/samples-jdk17.yaml @@ -1,6 +1,7 @@ name: Samples JDK17 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: # clients - samples/openapi3/client/petstore/spring-cloud-3/** @@ -23,6 +24,7 @@ on: - samples/server/petstore/java-helidon-server/v3/mp/** - samples/server/petstore/java-helidon-server/v3/se/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: # clients - samples/openapi3/client/petstore/spring-cloud-3/** @@ -45,33 +47,48 @@ on: - samples/server/petstore/java-helidon-server/v3/mp/** - samples/server/petstore/java-helidon-server/v3/se/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/openapi3/client/petstore/spring-cloud-3 + samples/client/petstore/java-helidon-client/v3/mp/ + samples/client/petstore/java-helidon-client/v3/se + samples/client/petstore/spring-http-interface-reactive + samples/client/petstore/spring-http-interface-reactive-bean-validation + samples/client/petstore/spring-http-interface-bean-validation + samples/client/petstore/spring-http-interface + samples/client/petstore/spring-http-interface-reactive-noResponseEntity + samples/client/petstore/spring-http-interface-noResponseEntity + samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator + samples/client/petstore/java/webclient-jakarta + samples/client/petstore/java/microprofile-rest-client-outer-enum + samples/openapi3/server/petstore/springboot-3 + samples/openapi3/server/petstore/springboot-3-include-http-request-context + samples/server/petstore/springboot-x-implements-skip + samples/server/petstore/java-camel/ + samples/server/petstore/java-helidon-server/v3/mp/ + samples/server/petstore/java-helidon-server/v3/se + build: name: Build with JDK17 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/openapi3/client/petstore/spring-cloud-3 - - samples/client/petstore/java-helidon-client/v3/mp/ - - samples/client/petstore/java-helidon-client/v3/se - - samples/client/petstore/spring-http-interface-reactive - - samples/client/petstore/spring-http-interface-reactive-bean-validation - - samples/client/petstore/spring-http-interface-bean-validation - - samples/client/petstore/spring-http-interface - - samples/client/petstore/spring-http-interface-reactive-noResponseEntity - - samples/client/petstore/spring-http-interface-noResponseEntity - - samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator - - samples/client/petstore/java/webclient-jakarta - - samples/client/petstore/java/microprofile-rest-client-outer-enum - # servers - - samples/openapi3/server/petstore/springboot-3 - - samples/openapi3/server/petstore/springboot-3-include-http-request-context - - samples/server/petstore/springboot-x-implements-skip - - samples/server/petstore/java-camel/ - - samples/server/petstore/java-helidon-server/v3/mp/ - - samples/server/petstore/java-helidon-server/v3/se + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-jdk21.yaml b/.github/workflows/samples-jdk21.yaml index 9e04ac03c54a..ba57b17b00d6 100644 --- a/.github/workflows/samples-jdk21.yaml +++ b/.github/workflows/samples-jdk21.yaml @@ -1,6 +1,7 @@ name: Samples JDK21 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: # clients - samples/client/petstore/java-helidon-client/v4/mp/** @@ -9,6 +10,7 @@ on: - samples/server/petstore/java-helidon-server/v4/mp/** - samples/server/petstore/java-helidon-server/v4/se/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: # clients - samples/client/petstore/java-helidon-client/v4/mp/** @@ -17,19 +19,34 @@ on: - samples/server/petstore/java-helidon-server/v4/mp/** - samples/server/petstore/java-helidon-server/v4/se/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/java-helidon-client/v4/mp/ + samples/client/petstore/java-helidon-client/v4/se/ + samples/server/petstore/java-helidon-server/v4/mp/ + samples/server/petstore/java-helidon-server/v4/se/ + build: name: Build with JDK21 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/petstore/java-helidon-client/v4/mp/ - - samples/client/petstore/java-helidon-client/v4/se/ - # servers - - samples/server/petstore/java-helidon-server/v4/mp/ - - samples/server/petstore/java-helidon-server/v4/se/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-julia.yaml b/.github/workflows/samples-julia.yaml index dc851f7793b9..613e8ef210a1 100644 --- a/.github/workflows/samples-julia.yaml +++ b/.github/workflows/samples-julia.yaml @@ -2,10 +2,12 @@ name: Samples Julia on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/julia/**' - 'samples/server/petstore/julia/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/julia/**' - 'samples/server/petstore/julia/**' diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index ce3c3fd3efc8..12cf05203c91 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -2,7 +2,8 @@ name: Samples Kotlin client on: push: - branches: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. + paths: - 'samples/client/petstore/kotlin*/**' - 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**' - samples/client/others/kotlin-integer-enum/** @@ -10,6 +11,7 @@ on: - samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization*/** - samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization*/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/kotlin*/**' - 'samples/client/others/kotlin-jvm-okhttp-parameter-tests/**' @@ -19,70 +21,86 @@ on: - samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization*/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/kotlin + samples/client/petstore/kotlin-explicit + samples/client/petstore/kotlin-gson + samples/client/petstore/kotlin-jackson + samples/client/petstore/kotlin-model-prefix-type-mappings + samples/client/petstore/kotlin-jvm-okhttp4-coroutines + samples/client/petstore/kotlin-moshi-codegen + samples/client/petstore/kotlin-multiplatform + samples/client/petstore/kotlin-multiplatform-kotlinx-datetime + samples/client/petstore/kotlin-multiplatform-allOf-discriminator + samples/client/petstore/kotlin-nonpublic + samples/client/petstore/kotlin-nullable + samples/client/petstore/kotlin-retrofit2 + samples/client/petstore/kotlin-retrofit2-kotlinx_serialization + samples/client/petstore/kotlin-retrofit2-jackson + samples/client/petstore/kotlin-retrofit2-rx3 + samples/client/petstore/kotlin-string + samples/client/petstore/kotlin-threetenbp + samples/client/petstore/kotlin-kotlinx-datetime + samples/client/petstore/kotlin-uppercase-enum + samples/client/petstore/kotlin-array-integer-enum + samples/client/petstore/kotlin-default-values-jvm-okhttp4 + samples/client/petstore/kotlin-default-values-jvm-retrofit2 + samples/client/petstore/kotlin-default-values-multiplatform + samples/client/petstore/kotlin-enum-integers-multiplatform + samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4 + samples/client/petstore/kotlin-array-simple-string-multiplatform + samples/client/petstore/kotlin-array-nullable-items + samples/client/petstore/kotlin-array-nullable-items-multiplatform + samples/client/petstore/kotlin-bigdecimal-default-multiplatform + samples/client/petstore/kotlin-bigdecimal-default-okhttp4 + samples/client/petstore/kotlin-jvm-jackson + samples/client/petstore/kotlin-jvm-ktor-jackson + samples/client/petstore/kotlin-jvm-ktor-gson + samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization + samples/client/petstore/kotlin-jvm-vertx-gson + samples/client/petstore/kotlin-jvm-vertx-jackson + samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines + samples/client/petstore/kotlin-jvm-vertx-moshi + samples/client/petstore/kotlin-jvm-spring-2-webclient + samples/client/petstore/kotlin-jvm-spring-3-webclient + samples/client/echo_api/kotlin-jvm-spring-3-webclient + samples/client/petstore/kotlin-jvm-spring-3-restclient + samples/client/echo_api/kotlin-jvm-spring-3-restclient + samples/client/others/kotlin-jvm-spring-3-restclient-nullable-return + samples/client/petstore/kotlin-name-parameter-mappings + samples/client/others/kotlin-jvm-okhttp-parameter-tests + samples/client/others/kotlin-jvm-okhttp-path-comments + samples/client/others/kotlin-integer-enum + samples/client/petstore/kotlin-allOf-discriminator-kotlinx-serialization + samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization + samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization + samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization-nonPublicApi + samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization-explicitApi + # Commented-out samples from original matrix: + #- samples/client/petstore/kotlin-json-request-string + build: name: Build Kotlin client + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # client - - samples/client/petstore/kotlin - - samples/client/petstore/kotlin-explicit - - samples/client/petstore/kotlin-gson - - samples/client/petstore/kotlin-jackson - - samples/client/petstore/kotlin-model-prefix-type-mappings - # needs Android configured - #- samples/client/petstore/kotlin-json-request-string - - samples/client/petstore/kotlin-jvm-okhttp4-coroutines - - samples/client/petstore/kotlin-moshi-codegen - - samples/client/petstore/kotlin-multiplatform - - samples/client/petstore/kotlin-multiplatform-kotlinx-datetime - - samples/client/petstore/kotlin-multiplatform-allOf-discriminator - - samples/client/petstore/kotlin-nonpublic - - samples/client/petstore/kotlin-nullable - - samples/client/petstore/kotlin-retrofit2 - - samples/client/petstore/kotlin-retrofit2-kotlinx_serialization - - samples/client/petstore/kotlin-retrofit2-jackson - - samples/client/petstore/kotlin-retrofit2-rx3 - - samples/client/petstore/kotlin-string - - samples/client/petstore/kotlin-threetenbp - - samples/client/petstore/kotlin-kotlinx-datetime - - samples/client/petstore/kotlin-uppercase-enum - - samples/client/petstore/kotlin-array-integer-enum - - samples/client/petstore/kotlin-default-values-jvm-okhttp4 - - samples/client/petstore/kotlin-default-values-jvm-retrofit2 - - samples/client/petstore/kotlin-default-values-multiplatform - - samples/client/petstore/kotlin-enum-integers-multiplatform - - samples/client/petstore/kotlin-array-simple-string-jvm-okhttp4 - - samples/client/petstore/kotlin-array-simple-string-multiplatform - - samples/client/petstore/kotlin-array-nullable-items - - samples/client/petstore/kotlin-array-nullable-items-multiplatform - - samples/client/petstore/kotlin-bigdecimal-default-multiplatform - - samples/client/petstore/kotlin-bigdecimal-default-okhttp4 - - samples/client/petstore/kotlin-jvm-jackson - - samples/client/petstore/kotlin-jvm-ktor-jackson - - samples/client/petstore/kotlin-jvm-ktor-gson - - samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization - - samples/client/petstore/kotlin-jvm-vertx-gson - - samples/client/petstore/kotlin-jvm-vertx-jackson - - samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines - - samples/client/petstore/kotlin-jvm-vertx-moshi - - samples/client/petstore/kotlin-jvm-spring-2-webclient - - samples/client/petstore/kotlin-jvm-spring-3-webclient - - samples/client/echo_api/kotlin-jvm-spring-3-webclient - - samples/client/petstore/kotlin-jvm-spring-3-restclient - - samples/client/echo_api/kotlin-jvm-spring-3-restclient - - samples/client/others/kotlin-jvm-spring-3-restclient-nullable-return - - samples/client/petstore/kotlin-name-parameter-mappings - - samples/client/others/kotlin-jvm-okhttp-parameter-tests - - samples/client/others/kotlin-jvm-okhttp-path-comments - - samples/client/others/kotlin-integer-enum - - samples/client/petstore/kotlin-allOf-discriminator-kotlinx-serialization - - samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization - - samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization - - samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization-nonPublicApi - - samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization-explicitApi + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-kotlin-echo-api.yaml b/.github/workflows/samples-kotlin-echo-api.yaml index a5e73a4ff4ee..94331402fe9d 100644 --- a/.github/workflows/samples-kotlin-echo-api.yaml +++ b/.github/workflows/samples-kotlin-echo-api.yaml @@ -2,25 +2,43 @@ name: Kotlin Client (Echo API) JDK17 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/kotlin** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/kotlin** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/echo_api/kotlin-jvm-spring-3-restclient + samples/client/echo_api/kotlin-model-prefix-type-mappings + samples/client/echo_api/kotlin-jvm-okhttp + samples/client/echo_api/kotlin-jvm-okhttp-multipart-json + build: name: Build Kotlin Client JDK17 + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/kotlin-jvm-spring-3-restclient - - samples/client/echo_api/kotlin-model-prefix-type-mappings - - samples/client/echo_api/kotlin-jvm-okhttp - - samples/client/echo_api/kotlin-jvm-okhttp-multipart-json + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-kotlin-server-jdk17.yaml b/.github/workflows/samples-kotlin-server-jdk17.yaml index 8ecbb33a02f3..efedf32a7247 100644 --- a/.github/workflows/samples-kotlin-server-jdk17.yaml +++ b/.github/workflows/samples-kotlin-server-jdk17.yaml @@ -2,6 +2,7 @@ name: Samples Kotlin server (jdk17) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/others/kotlin-server/**' - 'samples/server/others/kotlin-springboot/**' @@ -18,6 +19,7 @@ on: # comment out due to gradle build failure # - samples/server/petstore/kotlin-spring-default/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/others/kotlin-server/**' - 'samples/server/others/kotlin-springboot/**' @@ -38,47 +40,63 @@ env: GRADLE_VERSION: '8.14' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/others/kotlin-springboot/oneOf-discriminator + samples/server/others/kotlin-springboot/oneOf-discriminator-const + samples/server/others/kotlin-springboot/oneOf-enum-discriminator + samples/server/others/kotlin-server/polymorphism-allof-and-discriminator + samples/server/others/kotlin-server/polymorphism-and-discriminator-disabled-jackson-fix + samples/server/others/kotlin-server/polymorphism-and-discriminator + samples/server/others/kotlin-server/polymorphism + samples/server/petstore/kotlin-server-required-and-nullable-properties + samples/server/petstore/kotlin-springboot-3 + samples/server/petstore/kotlin-springboot-3-no-response-entity + samples/server/petstore/kotlin-springboot-additionalproperties + samples/server/petstore/kotlin-springboot-delegate-nodefaults + samples/server/petstore/kotlin-springboot-request-cookie + samples/server/petstore/kotlin-springboot-4 + samples/server/petstore/kotlin-server/jaxrs-spec + samples/server/petstore/kotlin-server/jaxrs-spec-mutiny + samples/server/petstore/kotlin-server/javalin + samples/server/petstore/kotlin-server/javalin-6 + samples/server/petstore/kotlin-server/ktor + samples/server/petstore/kotlin-server/ktor-delegate-pattern/generated + samples/server/petstore/kotlin-server/ktor2 + samples/server/petstore/kotlin-server-modelMutable + samples/server/petstore/kotlin-misk + samples/server/petstore/kotlin-spring-declarative-interface + samples/server/petstore/kotlin-spring-declarative-interface-bean-validation + samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines + samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped + samples/server/petstore/kotlin-spring-declarative-interface-wrapped + samples/server/petstore/kotlin-spring-sealed-interfaces + samples/server/petstore/kotlin-springboot-sort-validation + samples/server/petstore/kotlin-springboot-paged-model + # Commented-out samples from original matrix: + # - samples/server/petstore/kotlin-spring-default/ + build: name: Build Kotlin server (jdk17) + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # server - - samples/server/others/kotlin-springboot/oneOf-discriminator - - samples/server/others/kotlin-springboot/oneOf-discriminator-const - - samples/server/others/kotlin-springboot/oneOf-enum-discriminator - - samples/server/others/kotlin-server/polymorphism-allof-and-discriminator - - samples/server/others/kotlin-server/polymorphism-and-discriminator-disabled-jackson-fix - - samples/server/others/kotlin-server/polymorphism-and-discriminator - - samples/server/others/kotlin-server/polymorphism - - samples/server/petstore/kotlin-server-required-and-nullable-properties - - samples/server/petstore/kotlin-springboot-3 - - samples/server/petstore/kotlin-springboot-3-no-response-entity - - samples/server/petstore/kotlin-springboot-additionalproperties - - samples/server/petstore/kotlin-springboot-delegate-nodefaults - - samples/server/petstore/kotlin-springboot-request-cookie - - samples/server/petstore/kotlin-springboot-4 - - samples/server/petstore/kotlin-server/jaxrs-spec - - samples/server/petstore/kotlin-server/jaxrs-spec-mutiny - - samples/server/petstore/kotlin-server/javalin - - samples/server/petstore/kotlin-server/javalin-6 - - samples/server/petstore/kotlin-server/ktor - - samples/server/petstore/kotlin-server/ktor-delegate-pattern/generated - - samples/server/petstore/kotlin-server/ktor2 - - samples/server/petstore/kotlin-server-modelMutable - - samples/server/petstore/kotlin-misk - - samples/server/petstore/kotlin-spring-declarative-interface - - samples/server/petstore/kotlin-spring-declarative-interface-bean-validation - - samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines - - samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped - - samples/server/petstore/kotlin-spring-declarative-interface-wrapped - - samples/server/petstore/kotlin-spring-sealed-interfaces - - samples/server/petstore/kotlin-springboot-sort-validation - - samples/server/petstore/kotlin-springboot-paged-model - # comment out due to gradle build failure - # - samples/server/petstore/kotlin-spring-default/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-kotlin-server-jdk21.yaml b/.github/workflows/samples-kotlin-server-jdk21.yaml index b4691689bb70..a3a76e2158be 100644 --- a/.github/workflows/samples-kotlin-server-jdk21.yaml +++ b/.github/workflows/samples-kotlin-server-jdk21.yaml @@ -2,12 +2,14 @@ name: Samples Kotlin server (jdk21) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/others/kotlin-server/**' - 'samples/server/others/kotlin-springboot/**' - 'samples/server/petstore/kotlin-server/**' - 'samples/server/petstore/kotlin-server-required-and-nullable-properties/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/others/kotlin-server/**' - 'samples/server/others/kotlin-springboot/**' @@ -18,25 +20,42 @@ env: GRADLE_VERSION: '8.14' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/others/kotlin-springboot/oneOf-discriminator + samples/server/others/kotlin-springboot/oneOf-discriminator-const + samples/server/others/kotlin-springboot/oneOf-enum-discriminator + samples/server/others/kotlin-server/polymorphism-allof-and-discriminator + samples/server/others/kotlin-server/polymorphism-and-discriminator-disabled-jackson-fix + samples/server/others/kotlin-server/polymorphism-and-discriminator + samples/server/others/kotlin-server/polymorphism + samples/server/petstore/kotlin-server/javalin-6 + samples/server/petstore/kotlin-server/ktor + samples/server/petstore/kotlin-server/ktor2 + samples/server/petstore/kotlin-server-required-and-nullable-properties + samples/server/petstore/kotlin-misk + build: name: Build Kotlin server (jdk21) + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/server/others/kotlin-springboot/oneOf-discriminator - - samples/server/others/kotlin-springboot/oneOf-discriminator-const - - samples/server/others/kotlin-springboot/oneOf-enum-discriminator - - samples/server/others/kotlin-server/polymorphism-allof-and-discriminator - - samples/server/others/kotlin-server/polymorphism-and-discriminator-disabled-jackson-fix - - samples/server/others/kotlin-server/polymorphism-and-discriminator - - samples/server/others/kotlin-server/polymorphism - - samples/server/petstore/kotlin-server/javalin-6 - - samples/server/petstore/kotlin-server/ktor - - samples/server/petstore/kotlin-server/ktor2 - - samples/server/petstore/kotlin-server-required-and-nullable-properties - - samples/server/petstore/kotlin-misk + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-kotlin-server.yaml b/.github/workflows/samples-kotlin-server.yaml index 931593dff958..1818338246a6 100644 --- a/.github/workflows/samples-kotlin-server.yaml +++ b/.github/workflows/samples-kotlin-server.yaml @@ -2,6 +2,7 @@ name: Samples Kotlin server (jdk8) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/others/kotlin-server/jaxrs-spec/** - 'samples/server/petstore/kotlin*/**' @@ -9,6 +10,7 @@ on: # comment out due to gradle build failure #- samples/server/petstore/kotlin-spring-default/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/others/kotlin-server/jaxrs-spec/** - 'samples/server/petstore/kotlin*/**' @@ -20,40 +22,55 @@ env: GRADLE_VERSION: 7.6.4 jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/kotlin-springboot + samples/server/petstore/kotlin-springboot-no-response-entity + samples/server/petstore/kotlin-springboot-no-response-entity-delegate + samples/server/petstore/kotlin-springboot-multipart-request-model + samples/server/petstore/kotlin-springboot-bigdecimal-default + samples/server/petstore/kotlin-springboot-delegate + samples/server/petstore/kotlin-springboot-modelMutable + samples/server/petstore/kotlin-springboot-reactive + samples/server/petstore/kotlin-springboot-reactive-without-flow + samples/server/petstore/kotlin-springboot-source-swagger1 + samples/server/petstore/kotlin-springboot-source-swagger2 + samples/server/petstore/kotlin-springboot-x-kotlin-implements + samples/server/petstore/kotlin-springboot-include-http-request-context-delegate + samples/server/petstore/kotlin-server/ktor2 + samples/server/petstore/kotlin-server/jaxrs-spec + samples/server/petstore/kotlin-server/jaxrs-spec-mutiny + samples/server/petstore/kotlin-server/javalin + samples/server/others/kotlin-server/jaxrs-spec + samples/server/others/kotlin-server/jaxrs-spec-array-response + samples/server/petstore/kotlin-spring-cloud + samples/server/petstore/kotlin-misk + samples/server/petstore/kotlin-misk-config + # Commented-out samples from original matrix: + #- samples/server/petstore/kotlin-spring-default + #- samples/server/petstore/kotlin-vertx-modelMutable + build: name: Build Kotlin server (jdk8) + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # server - - samples/server/petstore/kotlin-springboot - - samples/server/petstore/kotlin-springboot-no-response-entity - - samples/server/petstore/kotlin-springboot-no-response-entity-delegate - - samples/server/petstore/kotlin-springboot-multipart-request-model - - samples/server/petstore/kotlin-springboot-bigdecimal-default - - samples/server/petstore/kotlin-springboot-delegate - - samples/server/petstore/kotlin-springboot-modelMutable - - samples/server/petstore/kotlin-springboot-reactive - - samples/server/petstore/kotlin-springboot-reactive-without-flow - - samples/server/petstore/kotlin-springboot-source-swagger1 - - samples/server/petstore/kotlin-springboot-source-swagger2 - - samples/server/petstore/kotlin-springboot-x-kotlin-implements - - samples/server/petstore/kotlin-springboot-include-http-request-context-delegate - - samples/server/petstore/kotlin-server/ktor2 - - samples/server/petstore/kotlin-server/jaxrs-spec - - samples/server/petstore/kotlin-server/jaxrs-spec-mutiny - - samples/server/petstore/kotlin-server/javalin - - samples/server/others/kotlin-server/jaxrs-spec - - samples/server/others/kotlin-server/jaxrs-spec-array-response - - samples/server/petstore/kotlin-spring-cloud - - samples/server/petstore/kotlin-misk - - samples/server/petstore/kotlin-misk-config - # comment out due to gradle build failure - #- samples/server/petstore/kotlin-spring-default - # no build.gradle file - #- samples/server/petstore/kotlin-vertx-modelMutable + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-kotlin-wiremock.yaml b/.github/workflows/samples-kotlin-wiremock.yaml index d2a13fc6fa32..5c79543abc50 100644 --- a/.github/workflows/samples-kotlin-wiremock.yaml +++ b/.github/workflows/samples-kotlin-wiremock.yaml @@ -2,25 +2,44 @@ name: Samples Kotlin WireMock on: push: - branches: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. + paths: - samples/server/petstore/kotlin-wiremock*/** - samples/server/echo_api/kotlin-wiremock/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/kotlin-wiremock*/** - samples/server/echo_api/kotlin-wiremock/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/kotlin-wiremock + samples/server/petstore/kotlin-wiremock-responses + samples/server/echo_api/kotlin-wiremock + build: name: Build Kotlin WireMock + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/server/petstore/kotlin-wiremock - - samples/server/petstore/kotlin-wiremock-responses - - samples/server/echo_api/kotlin-wiremock + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-ocaml.yaml b/.github/workflows/samples-ocaml.yaml index b60f3f6001f0..03cf2a7dc7be 100644 --- a/.github/workflows/samples-ocaml.yaml +++ b/.github/workflows/samples-ocaml.yaml @@ -2,6 +2,7 @@ name: Samples OCaml on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/ocaml/**' - 'samples/client/petstore/ocaml-fake-petstore/**' @@ -10,6 +11,7 @@ on: - 'samples/client/petstore/ocaml-enum-in-composed-schema/**' - 'samples/client/petstore/ocaml-recursion-test/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/ocaml/**' - 'samples/client/petstore/ocaml-fake-petstore/**' @@ -19,19 +21,36 @@ on: - 'samples/client/petstore/ocaml-recursion-test/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + 'samples/client/petstore/ocaml/' + 'samples/client/petstore/ocaml-fake-petstore/' + 'samples/client/petstore/ocaml-oneOf-primitive/' + 'samples/client/petstore/ocaml-additional-properties/' + 'samples/client/petstore/ocaml-enum-in-composed-schema/' + 'samples/client/petstore/ocaml-recursion-test/' + build: name: Build OCaml + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - 'samples/client/petstore/ocaml/' - - 'samples/client/petstore/ocaml-fake-petstore/' - - 'samples/client/petstore/ocaml-oneOf-primitive/' - - 'samples/client/petstore/ocaml-additional-properties/' - - 'samples/client/petstore/ocaml-enum-in-composed-schema/' - - 'samples/client/petstore/ocaml-recursion-test/' + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Set-up OCaml diff --git a/.github/workflows/samples-php-client.yaml b/.github/workflows/samples-php-client.yaml index c5bcd292cfbe..bed72e2efe51 100644 --- a/.github/workflows/samples-php-client.yaml +++ b/.github/workflows/samples-php-client.yaml @@ -2,14 +2,37 @@ name: Samples PHP clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/php/OpenAPIClient-php/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/php/OpenAPIClient-php/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/php/OpenAPIClient-php/ + # Commented-out samples from original matrix: + # clients + build: name: Build PHP projects + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -19,9 +42,7 @@ jobs: - "8.2" - "8.3" - "8.4" - sample: - # clients - - samples/client/petstore/php/OpenAPIClient-php/ + sample: ${{ fromJson(needs.setup.outputs.samples) }} services: petstore-api: image: swaggerapi/petstore diff --git a/.github/workflows/samples-php-server-syntax-check.yaml b/.github/workflows/samples-php-server-syntax-check.yaml index 8402c49658a4..70d67f94aa52 100644 --- a/.github/workflows/samples-php-server-syntax-check.yaml +++ b/.github/workflows/samples-php-server-syntax-check.yaml @@ -2,6 +2,7 @@ name: Samples PHP (Server) Syntax Checker on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/php-symfony/SymfonyBundle-php/** #- samples/server/petstore/php-laravel/** @@ -10,6 +11,7 @@ on: - samples/server/petstore/php-mezzio-ph/** - samples/server/petstore/php-slim4/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/php-symfony/SymfonyBundle-php/** #- samples/server/petstore/php-laravel/** @@ -18,8 +20,34 @@ on: - samples/server/petstore/php-mezzio-ph/** - samples/server/petstore/php-slim4/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/php-symfony/SymfonyBundle-php/ + samples/server/petstore/php-flight/ + samples/server/petstore/php-mezzio-ph-modern/ + samples/server/petstore/php-mezzio-ph/ + samples/server/petstore/php-slim4/ + # Commented-out samples from original matrix: + # servers + #- samples/server/petstore/php-laravel/ + build: name: Build PHP projects + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -29,14 +57,7 @@ jobs: - "8.2" - "8.3" - "8.4" - sample: - # servers - - samples/server/petstore/php-symfony/SymfonyBundle-php/ - #- samples/server/petstore/php-laravel/ - - samples/server/petstore/php-flight/ - - samples/server/petstore/php-mezzio-ph-modern/ - - samples/server/petstore/php-mezzio-ph/ - - samples/server/petstore/php-slim4/ + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 - name: Setup PHP with tools diff --git a/.github/workflows/samples-php-syntax-check.yaml b/.github/workflows/samples-php-syntax-check.yaml index 8a40dd388ada..accf46eb77a7 100644 --- a/.github/workflows/samples-php-syntax-check.yaml +++ b/.github/workflows/samples-php-syntax-check.yaml @@ -2,16 +2,40 @@ name: Samples PHP Syntax Checker on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/php/OpenAPIClient-php/** - samples/client/petstore/php-nextgen/OpenAPIClient-php/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/php/OpenAPIClient-php/** - samples/client/petstore/php-nextgen/OpenAPIClient-php/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/php/OpenAPIClient-php/ + samples/client/petstore/php-nextgen/OpenAPIClient-php/ + # Commented-out samples from original matrix: + # clients + build: name: Build PHP projects + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -21,10 +45,7 @@ jobs: - "8.2" - "8.3" - "8.4" - sample: - # clients - - samples/client/petstore/php/OpenAPIClient-php/ - - samples/client/petstore/php-nextgen/OpenAPIClient-php/ + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 - name: Setup PHP with tools diff --git a/.github/workflows/samples-php8.yaml b/.github/workflows/samples-php8.yaml index 10bd45978742..816f2189960a 100644 --- a/.github/workflows/samples-php8.yaml +++ b/.github/workflows/samples-php8.yaml @@ -2,20 +2,46 @@ name: Samples PHP 8.x on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/php-symfony/SymfonyBundle-php/** - samples/server/petstore/php-flight/** - samples/server/petstore/php-laravel/** - samples/server/petstore/php-laravel-issue-21334/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/php-symfony/SymfonyBundle-php/** - samples/server/petstore/php-flight/** - samples/server/petstore/php-laravel/** - samples/server/petstore/php-laravel-issue-21334/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/php-symfony/SymfonyBundle-php/ + samples/server/petstore/php-flight/ + samples/server/petstore/php-laravel/ + samples/server/petstore/php-laravel-issue-21334/ + # Commented-out samples from original matrix: + # servers + build: name: Build PHP projects + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -25,12 +51,7 @@ jobs: - "8.2" - "8.3" - "8.4" - sample: - # servers - - samples/server/petstore/php-symfony/SymfonyBundle-php/ - - samples/server/petstore/php-flight/ - - samples/server/petstore/php-laravel/ - - samples/server/petstore/php-laravel-issue-21334/ + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 - name: Setup PHP with tools diff --git a/.github/workflows/samples-postman.yaml b/.github/workflows/samples-postman.yaml index 5969faf3bc90..269b39bb11a1 100644 --- a/.github/workflows/samples-postman.yaml +++ b/.github/workflows/samples-postman.yaml @@ -2,22 +2,38 @@ name: Samples Postman on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/schema/postman-collection/python/** - samples/schema/postman-collection/postman.json - .github/workflows/samples-postman.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/schema/postman-collection + "3.12" + build: name: Test Python client + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # schema - - samples/schema/postman-collection - python-version: - - "3.12" + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 diff --git a/.github/workflows/samples-powershell.yaml b/.github/workflows/samples-powershell.yaml index 208cf69332f0..5c4ac4079fb8 100644 --- a/.github/workflows/samples-powershell.yaml +++ b/.github/workflows/samples-powershell.yaml @@ -2,27 +2,40 @@ name: Samples PowerShell on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/powershell/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/powershell/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/powershell/ + 80:8080 + build: + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest name: Test Powershell Clients strategy: - matrix: - sample: - - samples/client/petstore/powershell/ - services: - petstore-api: - image: swaggerapi/petstore - ports: - - 80:8080 - env: - SWAGGER_HOST: http://petstore.swagger.io - SWAGGER_BASE_PATH: /v2 + fail-fast: false + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Build the client diff --git a/.github/workflows/samples-protobuf.yaml b/.github/workflows/samples-protobuf.yaml index 4524cf184760..edcd1cff22a6 100644 --- a/.github/workflows/samples-protobuf.yaml +++ b/.github/workflows/samples-protobuf.yaml @@ -1,26 +1,45 @@ name: Samples Protobuf on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - .github/workflows/samples-protobuf.yaml - samples/config/petstore/protobuf-schema/** - samples/config/petstore/protobuf-schema-config/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - .github/workflows/samples-protobuf.yaml - samples/config/petstore/protobuf-schema/** - samples/config/petstore/protobuf-schema-config/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + 'samples/config/petstore/protobuf-schema/' + 'samples/config/petstore/protobuf-schema-config/' + 'samples/config/petstore/protobuf-schema-config-complex/' + build: name: Build Protobuf Client + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - 'samples/config/petstore/protobuf-schema/' - - 'samples/config/petstore/protobuf-schema-config/' - - 'samples/config/petstore/protobuf-schema-config-complex/' + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Install Protocol Buffers Compiler diff --git a/.github/workflows/samples-python-client-echo-api.yaml b/.github/workflows/samples-python-client-echo-api.yaml index 75092d9834c3..2bf9373fe203 100644 --- a/.github/workflows/samples-python-client-echo-api.yaml +++ b/.github/workflows/samples-python-client-echo-api.yaml @@ -2,27 +2,43 @@ name: Python Client (Echo API) on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/python/** - samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/** - .github/workflows/samples-python-client-echo-api.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/echo_api/python + samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent + "3.10" + "3.11" + "3.12" + "3.13" + "3.14" + build: name: Test Python client + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/python - - samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent - python-version: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - - "3.14" + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 diff --git a/.github/workflows/samples-python-fastapi-server.yaml b/.github/workflows/samples-python-fastapi-server.yaml index 859da39128c1..6961c0d3121f 100644 --- a/.github/workflows/samples-python-fastapi-server.yaml +++ b/.github/workflows/samples-python-fastapi-server.yaml @@ -2,21 +2,39 @@ name: Python FastAPI Server on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/python-fastapi/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/python-fastapi/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/python-fastapi/ + build: name: Test Python FastAPI server + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/python-fastapi/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 diff --git a/.github/workflows/samples-python-petstore.yaml b/.github/workflows/samples-python-petstore.yaml index 071b80db5450..cb7ac68f31c4 100644 --- a/.github/workflows/samples-python-petstore.yaml +++ b/.github/workflows/samples-python-petstore.yaml @@ -2,6 +2,7 @@ name: "Python Client: Petstore" on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/openapi3/client/petstore/python-aiohttp/** - samples/openapi3/client/petstore/python-httpx/** @@ -9,6 +10,26 @@ on: - .github/workflows/samples-python-petstore.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/openapi3/client/petstore/python-aiohttp + samples/openapi3/client/petstore/python-httpx + samples/openapi3/client/petstore/python + samples/openapi3/client/petstore/python-lazyImports + validate-pyproject-toml: name: Validate pyproject.toml runs-on: ubuntu-latest @@ -23,6 +44,8 @@ jobs: run: validate-pyproject samples/openapi3/client/petstore/python/pyproject.toml build: name: Test Python client + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -33,11 +56,7 @@ jobs: - "3.12" - "3.13" - "3.14" - sample: - - samples/openapi3/client/petstore/python-aiohttp - - samples/openapi3/client/petstore/python-httpx - - samples/openapi3/client/petstore/python - - samples/openapi3/client/petstore/python-lazyImports + sample: ${{ fromJson(needs.setup.outputs.samples) }} services: petstore-api: image: swaggerapi/petstore diff --git a/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml b/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml index 7e4b08e07ec2..2d0feaf54520 100644 --- a/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml +++ b/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml @@ -2,26 +2,42 @@ name: Python Client pydantic v1 (Echo API) on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/python-pydantic-v1/** - .github/workflows/samples-python-pydantic-v1-client-echo-api.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/echo_api/python-pydantic-v1/ + "3.8" + "3.9" + "3.10" + "3.11" + "3.12" + build: name: Test Python client + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/python-pydantic-v1/ - python-version: - - "3.8" - - "3.9" - - "3.10" - - "3.11" - - "3.12" + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 diff --git a/.github/workflows/samples-python-pydantic-v1-petstore.yaml b/.github/workflows/samples-python-pydantic-v1-petstore.yaml index dce77c6e1481..1948beb4a9c0 100644 --- a/.github/workflows/samples-python-pydantic-v1-petstore.yaml +++ b/.github/workflows/samples-python-pydantic-v1-petstore.yaml @@ -2,14 +2,35 @@ name: "Python Client pydantic v1: Petstore" on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/** - samples/openapi3/client/petstore/python-pydantic-v1/** - .github/workflows/samples-python-pydantic-v1-petstore.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/openapi3/client/petstore/python-pydantic-v1-aiohttp + samples/openapi3/client/petstore/python-pydantic-v1 + build: name: Test Python client + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -19,9 +40,7 @@ jobs: - "3.10" - "3.11" - "3.12" - sample: - - samples/openapi3/client/petstore/python-pydantic-v1-aiohttp - - samples/openapi3/client/petstore/python-pydantic-v1 + sample: ${{ fromJson(needs.setup.outputs.samples) }} services: petstore-api: image: swaggerapi/petstore diff --git a/.github/workflows/samples-python-server.yaml b/.github/workflows/samples-python-server.yaml index 92cd4e5b6b33..4838db22b024 100644 --- a/.github/workflows/samples-python-server.yaml +++ b/.github/workflows/samples-python-server.yaml @@ -2,21 +2,39 @@ name: Python Server on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/python-aiohttp-srclayout/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/python-aiohttp-srclayout/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/python-aiohttp-srclayout/ + build: name: Test Python server + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/python-aiohttp-srclayout/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 diff --git a/.github/workflows/samples-r.yaml b/.github/workflows/samples-r.yaml index dd34b9e3e0c1..981c9e07fb99 100644 --- a/.github/workflows/samples-r.yaml +++ b/.github/workflows/samples-r.yaml @@ -2,35 +2,46 @@ name: Samples R clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/R/** - samples/client/petstore/R-httr2/** - samples/client/petstore/R-httr2-wrapper/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/R/** - samples/client/petstore/R-httr2/** - samples/client/petstore/R-httr2-wrapper/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/R/ + samples/client/petstore/R-httr2/ + samples/client/petstore/R-httr2-wrapper/ + 80:8080 + build: name: Build R projects + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/petstore/R/ - - samples/client/petstore/R-httr2/ - - samples/client/petstore/R-httr2-wrapper/ - services: - petstore-api: - image: swaggerapi/petstore - ports: - - 80:8080 - env: - SWAGGER_HOST: http://petstore.swagger.io - SWAGGER_BASE_PATH: /v2 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-ruby.yaml b/.github/workflows/samples-ruby.yaml index e2354bfbd42b..4eb4443e1b24 100644 --- a/.github/workflows/samples-ruby.yaml +++ b/.github/workflows/samples-ruby.yaml @@ -2,27 +2,46 @@ name: Samples Ruby on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/echo_api/ruby-httpx/**' - 'samples/client/echo_api/ruby-faraday/**' - 'samples/client/echo_api/ruby-typhoeus/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/echo_api/ruby-httpx/**' - 'samples/client/echo_api/ruby-faraday/**' - 'samples/client/echo_api/ruby-typhoeus/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + 'samples/client/echo_api/ruby-httpx/' + 'samples/client/echo_api/ruby-faraday/' + 'samples/client/echo_api/ruby-typhoeus/' + build: name: Build Ruby + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - 'samples/client/echo_api/ruby-httpx/' - - 'samples/client/echo_api/ruby-faraday/' - - 'samples/client/echo_api/ruby-typhoeus/' + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Setup node.js diff --git a/.github/workflows/samples-rust-client.yaml b/.github/workflows/samples-rust-client.yaml index 93b41e72b234..bb11d2a7b2c8 100644 --- a/.github/workflows/samples-rust-client.yaml +++ b/.github/workflows/samples-rust-client.yaml @@ -2,17 +2,39 @@ name: Samples Rust Clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/client/others/rust/**" - "samples/client/petstore/rust-server/**" pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/client/others/rust/**" - "samples/client/petstore/rust/**" jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/others/rust/ + samples/client/petstore/rust/ + build: name: Build Rust + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest services: petstore-api: @@ -24,11 +46,7 @@ jobs: SWAGGER_BASE_PATH: /v2 strategy: fail-fast: false - matrix: - sample: - # these folders contain sub-projects of rust clients, servers - - samples/client/others/rust/ - - samples/client/petstore/rust/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/samples-rust-server.yaml b/.github/workflows/samples-rust-server.yaml index aa24e23dfc28..910239ce8d28 100644 --- a/.github/workflows/samples-rust-server.yaml +++ b/.github/workflows/samples-rust-server.yaml @@ -2,29 +2,47 @@ name: Samples Rust Servers on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/server/petstore/rust-server/**" - "samples/server/petstore/rust-axum/**" - "samples/server/petstore/rust-salvo/**" pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/server/petstore/rust-server/**" - "samples/server/petstore/rust-axum/**" - "samples/server/petstore/rust-salvo/**" jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/rust-server/ + samples/server/petstore/rust-server-deprecated/ + samples/server/petstore/rust-axum/ + samples/server/petstore/rust-salvo/ + build: name: Build Rust + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # these folders contain sub-projects of rust clients, servers - - samples/server/petstore/rust-server/ - - samples/server/petstore/rust-server-deprecated/ - - samples/server/petstore/rust-axum/ - - samples/server/petstore/rust-salvo/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/samples-scala-client.yaml b/.github/workflows/samples-scala-client.yaml index 04e311456c51..b360e8bf6d20 100644 --- a/.github/workflows/samples-scala-client.yaml +++ b/.github/workflows/samples-scala-client.yaml @@ -2,6 +2,7 @@ name: Samples Scala/sbt client on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/scalaz/** - samples/client/petstore/scala-pekko/** @@ -13,6 +14,7 @@ on: - samples/client/petstore/scala-sttp4/** - samples/client/petstore/scala-sttp4-circe/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/scalaz/** - samples/client/petstore/scala-pekko/** @@ -24,31 +26,40 @@ on: - samples/client/petstore/scala-sttp4/** - samples/client/petstore/scala-sttp4-circe/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/scalaz + samples/client/petstore/scala-pekko + samples/client/petstore/scala-http4s + samples/client/petstore/scala-sttp4-jsoniter + samples/client/petstore/scala-akka + samples/client/petstore/scala-sttp + samples/client/petstore/scala-sttp-circe + samples/client/petstore/scala-sttp4 + samples/client/petstore/scala-sttp4-circe + 80:8080 + build: name: Build sbt/Scala + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/petstore/scalaz - - samples/client/petstore/scala-pekko - - samples/client/petstore/scala-http4s - - samples/client/petstore/scala-sttp4-jsoniter - - samples/client/petstore/scala-akka - - samples/client/petstore/scala-sttp - - samples/client/petstore/scala-sttp-circe - - samples/client/petstore/scala-sttp4 - - samples/client/petstore/scala-sttp4-circe - services: - petstore-api: - image: swaggerapi/petstore - ports: - - 80:8080 - env: - SWAGGER_HOST: http://petstore.swagger.io - SWAGGER_BASE_PATH: /v2 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-scala-server.yaml b/.github/workflows/samples-scala-server.yaml index 8d999d95b85f..44e80521feca 100644 --- a/.github/workflows/samples-scala-server.yaml +++ b/.github/workflows/samples-scala-server.yaml @@ -2,26 +2,44 @@ name: Samples Scala/sbt server on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/scala**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/server/petstore/scala**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/scala-play-server + samples/server/petstore/scala-akka-http-server + samples/server/petstore/scala-pekko-http-server + samples/server/petstore/scalatra + samples/server/petstore/scala-http4s-server + samples/server/petstore/scala-cask + build: name: Build sbt/Scala + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/scala-play-server - - samples/server/petstore/scala-akka-http-server - - samples/server/petstore/scala-pekko-http-server - - samples/server/petstore/scalatra - - samples/server/petstore/scala-http4s-server - - samples/server/petstore/scala-cask + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-spring-jdk11.yaml b/.github/workflows/samples-spring-jdk11.yaml index 82a167f8376a..2e8daac03d82 100644 --- a/.github/workflows/samples-spring-jdk11.yaml +++ b/.github/workflows/samples-spring-jdk11.yaml @@ -2,26 +2,44 @@ name: Samples Java Spring (JDK11) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: # servers - samples/server/petstore/springboot-implicitHeaders/** - samples/server/petstore/springboot-implicitHeaders-annotationLibrary/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: # servers - samples/server/petstore/springboot-implicitHeaders/** - samples/server/petstore/springboot-implicitHeaders-annotationLibrary/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/springboot-implicitHeaders + samples/server/petstore/springboot-implicitHeaders-annotationLibrary + build: name: Build + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # servers - - samples/server/petstore/springboot-implicitHeaders - - samples/server/petstore/springboot-implicitHeaders-annotationLibrary + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-spring-jdk17.yaml b/.github/workflows/samples-spring-jdk17.yaml index f26c2974153f..21e500f57a34 100644 --- a/.github/workflows/samples-spring-jdk17.yaml +++ b/.github/workflows/samples-spring-jdk17.yaml @@ -2,6 +2,7 @@ name: Samples Java Spring (JDK17) on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/openapi3/client/petstore/spring-cloud-3-with-optional/** - samples/openapi3/client/petstore/spring-cloud-4-with-optional/** @@ -20,6 +21,7 @@ on: - samples/openapi3/server/petstore/spring-boot-oneof-interface/** - samples/client/petstore/spring-http-interface-oauth/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/openapi3/client/petstore/spring-cloud-3-with-optional/** - samples/openapi3/client/petstore/spring-cloud-4-with-optional/** @@ -38,31 +40,46 @@ on: - samples/openapi3/server/petstore/spring-boot-oneof-interface/** - samples/client/petstore/spring-http-interface-oauth/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/openapi3/client/petstore/spring-cloud-3-with-optional + samples/openapi3/client/petstore/spring-cloud-4-with-optional + samples/client/petstore/spring-http-interface-springboot-4 + samples/openapi3/server/petstore/springboot-3 + samples/openapi3/server/petstore/springboot-4 + samples/openapi3/server/petstore/springboot-4-jspecify + samples/server/petstore/springboot-api-response-examples + samples/server/petstore/springboot-lombok-data + samples/server/petstore/springboot-lombok-tostring + samples/server/petstore/springboot-file-delegate-optional + samples/server/petstore/springboot-petstore-with-api-response-examples + samples/server/petstore/springboot-sort-validation + samples/server/petstore/springboot-paged-model + samples/openapi3/server/petstore/spring-boot-oneof-sealed + samples/openapi3/server/petstore/spring-boot-oneof-interface + samples/client/petstore/spring-http-interface-oauth + build: name: Build Java Spring (JDK17) + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/openapi3/client/petstore/spring-cloud-3-with-optional - - samples/openapi3/client/petstore/spring-cloud-4-with-optional - - samples/client/petstore/spring-http-interface-springboot-4 - # servers - - samples/openapi3/server/petstore/springboot-3 - - samples/openapi3/server/petstore/springboot-4 - - samples/openapi3/server/petstore/springboot-4-jspecify - - samples/server/petstore/springboot-api-response-examples - - samples/server/petstore/springboot-lombok-data - - samples/server/petstore/springboot-lombok-tostring - - samples/server/petstore/springboot-file-delegate-optional - - samples/server/petstore/springboot-petstore-with-api-response-examples - - samples/server/petstore/springboot-sort-validation - - samples/server/petstore/springboot-paged-model - - samples/openapi3/server/petstore/spring-boot-oneof-sealed - - samples/openapi3/server/petstore/spring-boot-oneof-interface - - samples/client/petstore/spring-http-interface-oauth + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index b133fc4adaaa..c4cfb4922d23 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -2,6 +2,7 @@ name: Samples Java Spring on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: # clients - 'samples/client/petstore/spring*/**' @@ -9,6 +10,7 @@ on: - 'samples/server/petstore/spring*/**' - 'samples/openapi3/server/petstore/spring*/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: # clients - 'samples/client/petstore/spring*/**' @@ -16,52 +18,67 @@ on: - 'samples/server/petstore/spring*/**' - 'samples/openapi3/server/petstore/spring*/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/spring-cloud + samples/client/petstore/spring-cloud-auth + samples/client/petstore/spring-cloud-date-time + samples/client/petstore/spring-cloud-deprecated + samples/client/petstore/spring-cloud-tags + samples/openapi3/client/petstore/spring-cloud + samples/openapi3/client/petstore/spring-cloud-async + samples/openapi3/client/petstore/spring-cloud-date-time + samples/openapi3/client/petstore/spring-cloud-http-basic + samples/openapi3/client/petstore/spring-cloud-spring-pageable + samples/openapi3/client/petstore/spring-stubs + samples/openapi3/client/petstore/spring-stubs-skip-default-interface + samples/openapi3/server/petstore/springboot + samples/openapi3/server/petstore/springboot-implicitHeaders + samples/openapi3/server/petstore/springboot-delegate + samples/openapi3/server/petstore/spring-boot-oneof + samples/server/petstore/spring-boot-nullable-set + samples/server/petstore/spring-boot-defaultInterface-unhandledExcp + samples/server/petstore/springboot + samples/server/petstore/springboot-include-http-request-context + samples/server/petstore/springboot-beanvalidation + samples/server/petstore/springboot-builtin-validation + samples/server/petstore/springboot-delegate + samples/server/petstore/springboot-delegate-no-response-entity + samples/server/petstore/springboot-implicitHeaders + samples/server/petstore/springboot-implicitHeaders-annotationLibrary + samples/server/petstore/springboot-lombok-data + samples/server/petstore/springboot-reactive + samples/server/petstore/springboot-reactive-noResponseEntity + samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8 + samples/server/petstore/springboot-spring-pageable-delegatePattern + samples/server/petstore/springboot-spring-pageable-without-j8 + samples/server/petstore/springboot-spring-pageable + samples/server/petstore/springboot-spring-provide-args + samples/server/petstore/springboot-useoptional + samples/server/petstore/springboot-virtualan + samples/openapi3/server/petstore/spring-boot-oneof-interface + build: name: Build Java Spring + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/petstore/spring-cloud - - samples/client/petstore/spring-cloud-auth - - samples/client/petstore/spring-cloud-date-time - - samples/client/petstore/spring-cloud-deprecated - - samples/client/petstore/spring-cloud-tags - - samples/openapi3/client/petstore/spring-cloud - - samples/openapi3/client/petstore/spring-cloud-async - - samples/openapi3/client/petstore/spring-cloud-date-time - - samples/openapi3/client/petstore/spring-cloud-http-basic - - samples/openapi3/client/petstore/spring-cloud-spring-pageable - - samples/openapi3/client/petstore/spring-stubs - - samples/openapi3/client/petstore/spring-stubs-skip-default-interface - # servers - - samples/openapi3/server/petstore/springboot - - samples/openapi3/server/petstore/springboot-implicitHeaders - - samples/openapi3/server/petstore/springboot-delegate - - samples/openapi3/server/petstore/spring-boot-oneof - - samples/server/petstore/spring-boot-nullable-set - - samples/server/petstore/spring-boot-defaultInterface-unhandledExcp - - samples/server/petstore/springboot - - samples/server/petstore/springboot-include-http-request-context - - samples/server/petstore/springboot-beanvalidation - - samples/server/petstore/springboot-builtin-validation - - samples/server/petstore/springboot-delegate - - samples/server/petstore/springboot-delegate-no-response-entity - - samples/server/petstore/springboot-implicitHeaders - - samples/server/petstore/springboot-implicitHeaders-annotationLibrary - - samples/server/petstore/springboot-lombok-data - - samples/server/petstore/springboot-reactive - - samples/server/petstore/springboot-reactive-noResponseEntity - - samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8 - - samples/server/petstore/springboot-spring-pageable-delegatePattern - - samples/server/petstore/springboot-spring-pageable-without-j8 - - samples/server/petstore/springboot-spring-pageable - - samples/server/petstore/springboot-spring-provide-args - - samples/server/petstore/springboot-useoptional - - samples/server/petstore/springboot-virtualan - - samples/openapi3/server/petstore/spring-boot-oneof-interface + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-swift5.yaml b/.github/workflows/samples-swift5.yaml index 3c9bc00070a1..2bcfcc763da3 100644 --- a/.github/workflows/samples-swift5.yaml +++ b/.github/workflows/samples-swift5.yaml @@ -2,32 +2,52 @@ name: Samples Swift 5 on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/swift5/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/swift5/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/swift5/alamofireLibrary + samples/client/petstore/swift5/asyncAwaitLibrary + samples/client/petstore/swift5/combineLibrary + samples/client/petstore/swift5/default + samples/client/petstore/swift5/objcCompatible + samples/client/petstore/swift5/oneOf + samples/client/petstore/swift5/promisekitLibrary + samples/client/petstore/swift5/resultLibrary + samples/client/petstore/swift5/rxswiftLibrary + samples/client/petstore/swift5/urlsessionLibrary + samples/client/petstore/swift5/validation + # NOTE: disabled as vaporLibrary doesnt build when adding this CI config + #- samples/client/petstore/swift5/vaporLibrary + build: + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} strategy: fail-fast: false matrix: os: [macos-latest] - sample: - - samples/client/petstore/swift5/alamofireLibrary - - samples/client/petstore/swift5/asyncAwaitLibrary - - samples/client/petstore/swift5/combineLibrary - - samples/client/petstore/swift5/default - - samples/client/petstore/swift5/objcCompatible - - samples/client/petstore/swift5/oneOf - - samples/client/petstore/swift5/promisekitLibrary - - samples/client/petstore/swift5/resultLibrary - - samples/client/petstore/swift5/rxswiftLibrary - - samples/client/petstore/swift5/urlsessionLibrary - - samples/client/petstore/swift5/validation - # NOTE: disabled as vaporLibrary doesnt build when adding this CI config - #- samples/client/petstore/swift5/vaporLibrary + sample: ${{ fromJson(needs.setup.outputs.samples) }} include: - os: ubuntu-latest sample: samples/client/petstore/swift5/alamofireLibrary diff --git a/.github/workflows/samples-terraform.yaml b/.github/workflows/samples-terraform.yaml index 04504f8f7c16..a56854432a54 100644 --- a/.github/workflows/samples-terraform.yaml +++ b/.github/workflows/samples-terraform.yaml @@ -2,12 +2,14 @@ name: Samples Terraform on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/terraform/**' - 'samples/client/petstore/terraform-addpet/**' - 'samples/client/petstore/terraform-server/**' - 'samples/client/others/terraform/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/terraform/**' - 'samples/client/petstore/terraform-addpet/**' @@ -15,19 +17,36 @@ on: - 'samples/client/others/terraform/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/terraform/ + samples/client/petstore/terraform-addpet/ + samples/client/petstore/terraform-server/ + samples/client/others/terraform/allof-discriminator/ + samples/client/others/terraform/oneof-anyof-required/ + samples/client/others/terraform/oneof-discriminator-lookup/ + build: name: Build Terraform Provider + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/terraform/ - - samples/client/petstore/terraform-addpet/ - - samples/client/petstore/terraform-server/ - - samples/client/others/terraform/allof-discriminator/ - - samples/client/others/terraform/oneof-anyof-required/ - - samples/client/others/terraform/oneof-discriminator-lookup/ + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-go@v6 diff --git a/.github/workflows/samples-typescript-axios-echo-api.yaml b/.github/workflows/samples-typescript-axios-echo-api.yaml index 0341edb5ced8..9f90038ea0f1 100644 --- a/.github/workflows/samples-typescript-axios-echo-api.yaml +++ b/.github/workflows/samples-typescript-axios-echo-api.yaml @@ -2,23 +2,39 @@ name: TypeScript Axios Client (Echo API) on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/echo_api/typescript-axios/** - .github/workflows/samples-typescript-axios-echo-api.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/echo_api/typescript-axios/test + 16 + 18 + 20 + build: name: Test TypeScript Axios client + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/echo_api/typescript-axios/test - node-version: - - 16 - - 18 - - 20 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/samples-typescript-client.yaml b/.github/workflows/samples-typescript-client.yaml index d646cd164f5f..a5a1308c97dc 100644 --- a/.github/workflows/samples-typescript-client.yaml +++ b/.github/workflows/samples-typescript-client.yaml @@ -2,6 +2,7 @@ name: Samples TS clients on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/others/typescript-angular/** - samples/client/others/typescript-angular-v20/** @@ -43,6 +44,7 @@ on: # comment out due to build failure #- samples/client/petstore/typescript-axios/tests/default/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/others/typescript-angular/** - samples/client/others/typescript-angular-v20/** @@ -77,8 +79,59 @@ on: - samples/client/petstore/typescript-axios/builds/with-npm-version/** #- samples/client/petstore/typescript-axios/tests/default/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/others/typescript-angular/ + samples/client/others/typescript-angular-v20/ + samples/client/petstore/typescript-angular-v16-provided-in-root/ + samples/client/petstore/typescript-angular-v17-provided-in-root/ + samples/client/petstore/typescript-angular-v18-provided-in-root/ + samples/client/petstore/typescript-angular-v19-provided-in-root/ + samples/client/petstore/typescript-angular-v20-provided-in-root/ + samples/client/petstore/typescript-angular-v21-provided-in-root/ + samples/openapi3/client/petstore/typescript/builds/default/ + samples/openapi3/client/petstore/typescript/builds/jquery/ + samples/openapi3/client/petstore/typescript/builds/object_params/ + samples/openapi3/client/petstore/typescript/builds/browser/ + samples/client/petstore/typescript-fetch/builds/default/ + samples/client/petstore/typescript-fetch/builds/es6-target/ + samples/client/petstore/typescript-fetch/builds/with-npm-version/ + samples/client/petstore/typescript-fetch/tests/default/ + samples/client/petstore/typescript-rxjs/builds/with-npm-version/ + samples/client/petstore/typescript-axios/builds/with-npm-version/ + # Commented-out samples from original matrix: + #- samples/client/petstore/typescript-angular-v12-provided-in-root/ + #- samples/client/petstore/typescript-angular-v13-provided-in-root/ + #- samples/client/petstore/typescript-angular-v14-provided-in-root/ + #- samples/client/petstore/typescript-angular-v15-provided-in-root/ + #- samples/openapi3/client/petstore/typescript/tests/default/ + #- samples/openapi3/client/petstore/typescript/tests/jquery/ + #- samples/openapi3/client/petstore/typescript/tests/object_params/ + #- samples/openapi3/client/petstore/typescript/builds/inversify/ + #- samples/openapi3/client/petstore/typescript/tests/inversify/ + #- samples/openapi3/client/petstore/typescript/tests/deno/ + #- samples/openapi3/client/petstore/typescript/tests/browser/ + #- samples/openapi3/client/petstore/typescript/builds/nullable-enum/ + #- samples/client/petstore/typescript-node/npm/ + #- samples/client/petstore/typescript-axios/tests/default/ + build: name: Build projects + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest services: petstore-api: @@ -94,39 +147,7 @@ jobs: node: #- "18.x" - "20.x" - sample: - - samples/client/others/typescript-angular/ - - samples/client/others/typescript-angular-v20/ - #- samples/client/petstore/typescript-angular-v12-provided-in-root/ - #- samples/client/petstore/typescript-angular-v13-provided-in-root/ - #- samples/client/petstore/typescript-angular-v14-provided-in-root/ - #- samples/client/petstore/typescript-angular-v15-provided-in-root/ - - samples/client/petstore/typescript-angular-v16-provided-in-root/ - - samples/client/petstore/typescript-angular-v17-provided-in-root/ - - samples/client/petstore/typescript-angular-v18-provided-in-root/ - - samples/client/petstore/typescript-angular-v19-provided-in-root/ - - samples/client/petstore/typescript-angular-v20-provided-in-root/ - - samples/client/petstore/typescript-angular-v21-provided-in-root/ - - samples/openapi3/client/petstore/typescript/builds/default/ - #- samples/openapi3/client/petstore/typescript/tests/default/ - - samples/openapi3/client/petstore/typescript/builds/jquery/ - #- samples/openapi3/client/petstore/typescript/tests/jquery/ - - samples/openapi3/client/petstore/typescript/builds/object_params/ - #- samples/openapi3/client/petstore/typescript/tests/object_params/ - #- samples/openapi3/client/petstore/typescript/builds/inversify/ - #- samples/openapi3/client/petstore/typescript/tests/inversify/ - #- samples/openapi3/client/petstore/typescript/tests/deno/ - - samples/openapi3/client/petstore/typescript/builds/browser/ - #- samples/openapi3/client/petstore/typescript/tests/browser/ - #- samples/openapi3/client/petstore/typescript/builds/nullable-enum/ - - samples/client/petstore/typescript-fetch/builds/default/ - - samples/client/petstore/typescript-fetch/builds/es6-target/ - - samples/client/petstore/typescript-fetch/builds/with-npm-version/ - - samples/client/petstore/typescript-fetch/tests/default/ - #- samples/client/petstore/typescript-node/npm/ - - samples/client/petstore/typescript-rxjs/builds/with-npm-version/ - - samples/client/petstore/typescript-axios/builds/with-npm-version/ - #- samples/client/petstore/typescript-axios/tests/default/ + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-typescript-encode-decode.yaml b/.github/workflows/samples-typescript-encode-decode.yaml index 4794e08df42b..56b17996293c 100644 --- a/.github/workflows/samples-typescript-encode-decode.yaml +++ b/.github/workflows/samples-typescript-encode-decode.yaml @@ -2,23 +2,39 @@ name: TypeScript Client (Encoding / Decoding Test) on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/others/typescript/encode-decode/** - .github/workflows/samples-typescript-encode-decode.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/others/typescript/encode-decode/test + 20 + 22 + 24 + build: name: Test TypeScript Encoding / Decoding + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/others/typescript/encode-decode/test - node-version: - - 20 - - 22 - - 24 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/samples-typescript-nestjs-server.yaml b/.github/workflows/samples-typescript-nestjs-server.yaml index 0b3d0b3d0331..9bb43dc880c7 100644 --- a/.github/workflows/samples-typescript-nestjs-server.yaml +++ b/.github/workflows/samples-typescript-nestjs-server.yaml @@ -2,23 +2,39 @@ name: TypeScript NestJS Server on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/typescript-nestjs-server/** - .github/workflows/samples-typescript-nestjs-server.yaml - .github/workflows/samples-typescript-nestjs-server-parameters.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/typescript-nestjs-server + 20 + 22 + build: name: Test TypeScript NestJS Server + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/server/petstore/typescript-nestjs-server - node-version: - - 20 - - 22 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/samples-typescript-node-encode-decode.yaml b/.github/workflows/samples-typescript-node-encode-decode.yaml index 8758d429e6e8..eb3273ab2808 100644 --- a/.github/workflows/samples-typescript-node-encode-decode.yaml +++ b/.github/workflows/samples-typescript-node-encode-decode.yaml @@ -2,23 +2,39 @@ name: TypeScript Node Client (Encoding / Decoding Test) on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/others/typescript-node/encode-decode/** - .github/workflows/samples-typescript-node-encode-decode.yaml jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/others/typescript-node/encode-decode/test + 16 + 18 + 20 + build: name: Test TypeScript Node Encoding / Decoding + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - # clients - - samples/client/others/typescript-node/encode-decode/test - node-version: - - 16 - - 18 - - 20 + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/samples-typescript-server.yaml b/.github/workflows/samples-typescript-server.yaml index 002819f77d75..5ef8fea93f29 100644 --- a/.github/workflows/samples-typescript-server.yaml +++ b/.github/workflows/samples-typescript-server.yaml @@ -2,14 +2,35 @@ name: Samples TS servers on: push: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/typescript-nestjs-server/** pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/server/petstore/typescript-nestjs-server/** jobs: + setup: + runs-on: ubuntu-latest + outputs: + samples: ${{ steps.filter.outputs.samples }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/server/petstore/typescript-nestjs-server/ + build: name: Build projects + needs: setup + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -17,8 +38,7 @@ jobs: node: - "18.x" - "20.x" - sample: - - samples/server/petstore/typescript-nestjs-server/ + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 - name: Use Node.js 20.x diff --git a/.github/workflows/samples-typescript-typecheck.yaml b/.github/workflows/samples-typescript-typecheck.yaml index 222da1cd22a7..8a3797ac0949 100644 --- a/.github/workflows/samples-typescript-typecheck.yaml +++ b/.github/workflows/samples-typescript-typecheck.yaml @@ -2,6 +2,7 @@ name: TypeScript clients type checks on: pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/** - bin/ts-typecheck-all.sh diff --git a/.github/workflows/samples-zapier.yaml b/.github/workflows/samples-zapier.yaml index a5c04ea5f8ac..47b9f5808ae9 100644 --- a/.github/workflows/samples-zapier.yaml +++ b/.github/workflows/samples-zapier.yaml @@ -2,21 +2,40 @@ name: Samples Zapier on: push: - branches: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. + paths: - 'samples/client/petstore/zapier/**' pull_request: + # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - 'samples/client/petstore/zapier/**' jobs: + setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.filter.outputs.matrix }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: filter + uses: ./.github/actions/compute-matrix + with: + # List of sample directories to consider building (one per line). + # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. + # To add a new sample: add it here AND add a matching entry to the paths: trigger above. + all_samples: | + samples/client/petstore/zapier + validate: name: Test zapier generation + needs: setup + if: ${{ needs.setup.outputs.matrix != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - sample: - - samples/client/petstore/zapier + matrix: ${{ fromJson(needs.setup.outputs.matrix) }} steps: - uses: actions/checkout@v5 - name: Setup node From eab54b1bd22e0f5d3dc4a9033ef1686df9061c19 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 11:08:44 +0200 Subject: [PATCH 02/15] fix: remove ${{ }} template expressions from action.yaml output descriptions to prevent evaluation failure in composite action context --- .github/actions/compute-matrix/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/compute-matrix/action.yaml b/.github/actions/compute-matrix/action.yaml index 5f26c53e75ee..4c678850c560 100644 --- a/.github/actions/compute-matrix/action.yaml +++ b/.github/actions/compute-matrix/action.yaml @@ -16,13 +16,13 @@ outputs: matrix: description: > Use this for single-dimension sample matrices. - JSON object {"sample":["path/a","path/b"]} ready for: matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + JSON object {"sample":["path/a","path/b"]} - assign directly to the matrix: key using fromJson(). Returns the string "[]" when no samples changed (use in an if: guard to skip the job). value: ${{ steps.filter.outputs.matrix }} samples: description: > Use this for multi-dimensional matrices (e.g. os + sample, php-version + sample). - Plain JSON array ["path/a","path/b"] to assign to the sample: dimension only. + Plain JSON array ["path/a","path/b"] - assign to the sample: dimension only using fromJson(). Returns the string "[]" when no samples changed (use in an if: guard to skip the job). value: ${{ steps.filter.outputs.samples }} From 811713581e624497e2199fc8dc5de5270e2042fe Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 11:30:42 +0200 Subject: [PATCH 03/15] skip unit tests and doc check for sample-only changes in openapi-generator.yaml --- .github/workflows/openapi-generator.yaml | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index d6d9661bdcc1..4181bce1c211 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -11,6 +11,38 @@ on: - '[5-9]+.[0-9]+.x' jobs: + # Detect whether source files (modules/, pom.xml, bin/) changed. + # When only samples/ changed, the unit tests and doc checks are skipped — they are + # not affected by sample-only changes and the samples job still runs to verify freshness. + setup: + name: Detect source changes + runs-on: ubuntu-latest + outputs: + source-changed: ${{ steps.check.outputs.source-changed }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: check + shell: bash + env: + BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} + HEAD_SHA: ${{ github.sha }} + run: | + if [[ "$BASE_SHA" == "0000000000000000000000000000000000000000" ]] || [[ -z "$BASE_SHA" ]]; then + BASE_SHA=$(git rev-parse HEAD~1 2>/dev/null || echo "") + fi + if [[ -n "$BASE_SHA" ]]; then + CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" 2>/dev/null || git diff --name-only HEAD~1 HEAD) + else + CHANGED=$(git diff --name-only HEAD~1 HEAD) + fi + if echo "$CHANGED" | grep -qE '^(modules/|pom\.xml|bin/|\.mvn/)'; then + echo "source-changed=true" >> "$GITHUB_OUTPUT" + else + echo "source-changed=false" >> "$GITHUB_OUTPUT" + fi + build: name: Build runs-on: ubuntu-latest @@ -52,7 +84,10 @@ jobs: name: Unit tests runs-on: ubuntu-latest needs: + - setup - build + # Unit tests are not affected by sample-only changes — skip to save CI time. + if: needs.setup.outputs.source-changed == 'true' steps: - uses: actions/checkout@v5 - name: Set up JDK 11 @@ -90,7 +125,10 @@ jobs: name: Docs up-to-date runs-on: ubuntu-latest needs: + - setup - build + # Docs are generated from codegen metadata — skipped when only samples changed. + if: needs.setup.outputs.source-changed == 'true' steps: - uses: actions/checkout@v5 - name: Set up JDK 11 From 3f84a08580916a723724cdba8c5511d4130a9166 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 11:40:02 +0200 Subject: [PATCH 04/15] skip unit tests for bin/ changes --- .github/workflows/openapi-generator.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index 4181bce1c211..d6b010c3e359 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -11,9 +11,11 @@ on: - '[5-9]+.[0-9]+.x' jobs: - # Detect whether source files (modules/, pom.xml, bin/) changed. - # When only samples/ changed, the unit tests and doc checks are skipped — they are - # not affected by sample-only changes and the samples job still runs to verify freshness. + # Detect whether source files (modules/, pom.xml) changed. + # When only samples/ or bin/configs/ changed, the unit tests and doc checks are skipped — + # they are not affected by sample or config-only changes. The samples job still runs to + # verify freshness. Nothing in bin/ affects mvn test; those scripts are used by the + # documentation and samples jobs which run unconditionally. setup: name: Detect source changes runs-on: ubuntu-latest @@ -37,7 +39,7 @@ jobs: else CHANGED=$(git diff --name-only HEAD~1 HEAD) fi - if echo "$CHANGED" | grep -qE '^(modules/|pom\.xml|bin/|\.mvn/)'; then + if echo "$CHANGED" | grep -qE '^(modules/|pom\.xml|\.mvn/)'; then echo "source-changed=true" >> "$GITHUB_OUTPUT" else echo "source-changed=false" >> "$GITHUB_OUTPUT" From 67ae687a41dc8444feefff0737b4bda0640a4e79 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 11:59:08 +0200 Subject: [PATCH 05/15] implement fixes --- .github/workflows/samples-clojure.yaml | 11 +++++++++-- .github/workflows/samples-cpp-httplib-server.yaml | 2 -- .github/workflows/samples-dotnet-standard.yaml | 2 -- .github/workflows/samples-go-client.yaml | 4 ++-- .github/workflows/samples-java-helidon-v4.yaml | 2 +- .../workflows/samples-java-petsore-client-jdk11.yaml | 9 ++++++++- .../workflows/samples-java-petsore-client-jdk17.yaml | 9 ++++++++- 7 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/samples-clojure.yaml b/.github/workflows/samples-clojure.yaml index 4aa1a709ed48..d1f469349600 100644 --- a/.github/workflows/samples-clojure.yaml +++ b/.github/workflows/samples-clojure.yaml @@ -25,8 +25,7 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - samples/client/petstore/clojure/ - 80:8080 + samples/client/petstore/clojure build: name: Build Clojure Client (JDK11) @@ -36,6 +35,14 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-cpp-httplib-server.yaml b/.github/workflows/samples-cpp-httplib-server.yaml index 79c2e790bd6e..4d8dfd273b1f 100644 --- a/.github/workflows/samples-cpp-httplib-server.yaml +++ b/.github/workflows/samples-cpp-httplib-server.yaml @@ -5,12 +5,10 @@ on: # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/server/petstore/cpp-httplib-server/**" - - ".github/workflows/samples-cpp-httplib-server.yaml" pull_request: # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - "samples/server/petstore/cpp-httplib-server/**" - - ".github/workflows/samples-cpp-httplib-server.yaml" env: GRADLE_VERSION: 6.9 diff --git a/.github/workflows/samples-dotnet-standard.yaml b/.github/workflows/samples-dotnet-standard.yaml index 3d178d7be714..91432b19eae1 100644 --- a/.github/workflows/samples-dotnet-standard.yaml +++ b/.github/workflows/samples-dotnet-standard.yaml @@ -7,14 +7,12 @@ on: - samples/client/petstore/csharp/generichost/standard2.0/** - samples/client/petstore/csharp/httpclient/standard2.0/** - samples/client/petstore/csharp/restsharp/standard2.0/** - - samples/client/petstore/csharp/unityWebRequest/standard2.0/** pull_request: # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - samples/client/petstore/csharp/generichost/standard2.0/** - samples/client/petstore/csharp/httpclient/standard2.0/** - samples/client/petstore/csharp/restsharp/standard2.0/** - - samples/client/petstore/csharp/unityWebRequest/standard2.0/** jobs: setup: runs-on: ubuntu-latest diff --git a/.github/workflows/samples-go-client.yaml b/.github/workflows/samples-go-client.yaml index 9e4da351d7db..4eacc7c476e8 100644 --- a/.github/workflows/samples-go-client.yaml +++ b/.github/workflows/samples-go-client.yaml @@ -35,8 +35,8 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/' - 'samples/openapi3/client/petstore/go-petstore-withXml/' + samples/openapi3/client/petstore/go/go-petstore-aws-signature + samples/openapi3/client/petstore/go-petstore-withXml samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/ samples/client/others/go/allof_multiple_ref_and_discriminator/ samples/client/others/go/oneof-anyof-required/ diff --git a/.github/workflows/samples-java-helidon-v4.yaml b/.github/workflows/samples-java-helidon-v4.yaml index 8e513580b5e9..019a0ba63214 100644 --- a/.github/workflows/samples-java-helidon-v4.yaml +++ b/.github/workflows/samples-java-helidon-v4.yaml @@ -49,7 +49,7 @@ jobs: - uses: actions/setup-java@v5 with: distribution: 'temurin' - java-version: ${{ matrix.version }} + java-version: '21' - name: Cache maven dependencies uses: actions/cache@v5 env: diff --git a/.github/workflows/samples-java-petsore-client-jdk11.yaml b/.github/workflows/samples-java-petsore-client-jdk11.yaml index 5c31b94cd4b8..bd19366a7e7a 100644 --- a/.github/workflows/samples-java-petsore-client-jdk11.yaml +++ b/.github/workflows/samples-java-petsore-client-jdk11.yaml @@ -45,7 +45,6 @@ jobs: samples/client/petstore/java/okhttp-gson-3.1 samples/client/petstore/java/okhttp-gson-dynamicOperations samples/client/petstore/java-micronaut-client - 80:8080 build: name: Build Java Client JDK11 @@ -55,6 +54,14 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-java-petsore-client-jdk17.yaml b/.github/workflows/samples-java-petsore-client-jdk17.yaml index 727253872e1a..03dc6dff27c9 100644 --- a/.github/workflows/samples-java-petsore-client-jdk17.yaml +++ b/.github/workflows/samples-java-petsore-client-jdk17.yaml @@ -27,7 +27,6 @@ jobs: # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | samples/client/petstore/java/jersey3 - 80:8080 build: name: Build Java Client JDK17 @@ -37,6 +36,14 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts From 3a5fa1b1cd9bb518d20f2e52a6649629d32d765a Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 12:20:38 +0200 Subject: [PATCH 06/15] fix: run all samples when base SHA is unreachable after force-push When github.event.before points to a commit rewritten by a force-push, git diff fails and the HEAD~1 fallback only examines the latest commit, silently skipping sample builds for changes in earlier commits. Add a git cat-file reachability check: if BASE_SHA is unreachable, set RUN_ALL=true and include all samples in the matrix output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/actions/compute-matrix/action.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/actions/compute-matrix/action.yaml b/.github/actions/compute-matrix/action.yaml index 4c678850c560..dea033cd5fd4 100644 --- a/.github/actions/compute-matrix/action.yaml +++ b/.github/actions/compute-matrix/action.yaml @@ -38,16 +38,25 @@ runs: HEAD_SHA: ${{ github.sha }} ALL_SAMPLES: ${{ inputs.all_samples }} run: | + RUN_ALL=false + # Resolve the base SHA — github.event.before is all zeros for brand-new branches if [[ "$BASE_SHA" == "0000000000000000000000000000000000000000" ]] || [[ -z "$BASE_SHA" ]]; then BASE_SHA=$(git rev-parse HEAD~1 2>/dev/null || echo "") + elif ! git cat-file -e "$BASE_SHA^{commit}" 2>/dev/null; then + # BASE_SHA is set but unreachable locally — happens after a force-push that rewrites + # history. git diff would fail and fall back to HEAD~1, which only sees the latest + # commit and can miss changes in earlier commits. Run all samples to be safe. + RUN_ALL=true fi # Get list of changed files relative to the base commit - if [[ -n "$BASE_SHA" ]]; then - CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" 2>/dev/null || git diff --name-only HEAD~1 HEAD) - else - CHANGED=$(git diff --name-only HEAD~1 HEAD) + if [[ "$RUN_ALL" == "false" ]]; then + if [[ -n "$BASE_SHA" ]]; then + CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" 2>/dev/null || git diff --name-only HEAD~1 HEAD) + else + CHANGED=$(git diff --name-only HEAD~1 HEAD) + fi fi # Filter: keep only sample dirs where at least one changed file lives inside them @@ -62,7 +71,7 @@ runs: sample="${sample%/}" # A file belongs to a sample dir if its path starts with "/" - if echo "$CHANGED" | grep -q "^${sample}/"; then + if [[ "$RUN_ALL" == "true" ]] || echo "$CHANGED" | grep -q "^${sample}/"; then RESULT+=("$sample") fi done <<< "$ALL_SAMPLES" From 94a37e7cb335569513aa3ec4b69cd5b9780581dd Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 12:42:28 +0200 Subject: [PATCH 07/15] ci: tighten paths: trigger in echo-api java workflows to per-sample granularity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace broad samples/client/echo_api/java/** glob with explicit per-sample paths matching all_samples:. A new sample added without updating paths: will no longer silently trigger the workflow and produce an empty matrix — the workflow simply won't fire, making the missing paths: entry immediately visible. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../samples-java-client-echo-api-jdk11.yaml | 12 ++++++++++-- .../samples-java-client-echo-api-jdk17.yaml | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/samples-java-client-echo-api-jdk11.yaml b/.github/workflows/samples-java-client-echo-api-jdk11.yaml index 65d6177f9ec4..ef346fdb8b41 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk11.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk11.yaml @@ -4,11 +4,19 @@ on: push: # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - - samples/client/echo_api/java/** + - samples/client/echo_api/java/apache-httpclient/** + - samples/client/echo_api/java/native/** + - samples/client/echo_api/java/feign-gson/** + - samples/client/echo_api/java/resttemplate/** + - samples/client/echo_api/java/resteasy/** pull_request: # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - - samples/client/echo_api/java/** + - samples/client/echo_api/java/apache-httpclient/** + - samples/client/echo_api/java/native/** + - samples/client/echo_api/java/feign-gson/** + - samples/client/echo_api/java/resttemplate/** + - samples/client/echo_api/java/resteasy/** jobs: setup: runs-on: ubuntu-latest diff --git a/.github/workflows/samples-java-client-echo-api-jdk17.yaml b/.github/workflows/samples-java-client-echo-api-jdk17.yaml index 477b5a863d78..cce8052adb21 100644 --- a/.github/workflows/samples-java-client-echo-api-jdk17.yaml +++ b/.github/workflows/samples-java-client-echo-api-jdk17.yaml @@ -4,11 +4,21 @@ on: push: # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - - samples/client/echo_api/java/** + - samples/client/echo_api/java/apache-httpclient/** + - samples/client/echo_api/java/native/** + - samples/client/echo_api/java/feign-gson/** + - samples/client/echo_api/java/resttemplate/** + - samples/client/echo_api/java/resteasy/** + - samples/client/echo_api/java/restclient/** pull_request: # Determines whether this workflow fires at all. Keep in sync with all_samples: in the setup job below. paths: - - samples/client/echo_api/java/** + - samples/client/echo_api/java/apache-httpclient/** + - samples/client/echo_api/java/native/** + - samples/client/echo_api/java/feign-gson/** + - samples/client/echo_api/java/resttemplate/** + - samples/client/echo_api/java/resteasy/** + - samples/client/echo_api/java/restclient/** jobs: setup: runs-on: ubuntu-latest From 7e2dc7c5f325aac1fdf433bc7e2952732822ba3b Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 12:52:13 +0200 Subject: [PATCH 08/15] fix: use merge-base diff for pull_request events to avoid stale base SHA over-triggering For pull_request events, github.sha is the synthetic merge commit, and github.event.pull_request.base.sha may be stale if the base branch advanced after the PR was last synced. Diffing base.sha..merge_commit includes unrelated base-branch changes, causing extra sample builds. Fix: detect pull_request events via PR_HEAD_SHA env var and compute the three-way diff using git merge-base PR_HEAD BASE_SHA as the diff base. This isolates only the PR author's changes regardless of base advancement. Push events are unaffected and continue to use the existing BASE_SHA..HEAD_SHA logic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/actions/compute-matrix/action.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/actions/compute-matrix/action.yaml b/.github/actions/compute-matrix/action.yaml index dea033cd5fd4..9f7e58b64127 100644 --- a/.github/actions/compute-matrix/action.yaml +++ b/.github/actions/compute-matrix/action.yaml @@ -32,10 +32,13 @@ runs: - id: filter shell: bash env: - # For pull_request events, base.sha is the target branch tip. + # For pull_request events, base.sha is the target branch tip (may be stale if base advanced). # For push events, event.before is the previous HEAD (all-zeros for new branches). BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} HEAD_SHA: ${{ github.sha }} + # PR head SHA (only set for pull_request events). Used to isolate just the PR's changes + # via merge-base, avoiding false positives from unrelated base-branch advances. + PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} ALL_SAMPLES: ${{ inputs.all_samples }} run: | RUN_ALL=false @@ -52,7 +55,19 @@ runs: # Get list of changed files relative to the base commit if [[ "$RUN_ALL" == "false" ]]; then - if [[ -n "$BASE_SHA" ]]; then + if [[ -n "$PR_HEAD_SHA" ]]; then + # pull_request event: use merge-base to isolate only the PR's own changes. + # Diffing base.sha..merge_commit would include unrelated changes from the base + # branch that landed after the PR was last synchronised. Using merge-base gives + # only the commits that are in the PR branch but not in the base branch. + MERGE_BASE=$(git merge-base "$PR_HEAD_SHA" "$BASE_SHA" 2>/dev/null || echo "") + if [[ -n "$MERGE_BASE" ]]; then + CHANGED=$(git diff --name-only "$MERGE_BASE" "$PR_HEAD_SHA") + else + CHANGED=$(git diff --name-only "$BASE_SHA" "$PR_HEAD_SHA" 2>/dev/null || git diff --name-only HEAD~1 HEAD) + fi + elif [[ -n "$BASE_SHA" ]]; then + # push event: diff from the previous HEAD CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" 2>/dev/null || git diff --name-only HEAD~1 HEAD) else CHANGED=$(git diff --name-only HEAD~1 HEAD) From d86b3c17aa75e149f9992527d1c7df5cda8f7bdb Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 13:04:42 +0200 Subject: [PATCH 09/15] fix: remove literal quotes from ruby all_samples and restore nestjs node-version matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit samples-ruby.yaml: all three all_samples entries were wrapped in single quotes ('samples/...'). YAML block scalars treat these as literal characters so compute-matrix prefix matching never matched — ruby builds silently skipped on every PR regardless of what changed. samples-typescript-nestjs-server.yaml: the original workflow had a 2D matrix (node-version x sample). The refactor accidentally placed node versions 20 and 22 into all_samples: and dropped the node-version static dimension, making matrix.node-version undefined at runtime. Restores node-version: [20, 22] as a static dimension alongside the samples output (same pattern as samples-swift5.yaml uses for os: + sample:). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/samples-ruby.yaml | 6 +++--- .../workflows/samples-typescript-nestjs-server.yaml | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/samples-ruby.yaml b/.github/workflows/samples-ruby.yaml index 4eb4443e1b24..46e3c0deb9a2 100644 --- a/.github/workflows/samples-ruby.yaml +++ b/.github/workflows/samples-ruby.yaml @@ -30,9 +30,9 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - 'samples/client/echo_api/ruby-httpx/' - 'samples/client/echo_api/ruby-faraday/' - 'samples/client/echo_api/ruby-typhoeus/' + samples/client/echo_api/ruby-httpx + samples/client/echo_api/ruby-faraday + samples/client/echo_api/ruby-typhoeus build: name: Build Ruby diff --git a/.github/workflows/samples-typescript-nestjs-server.yaml b/.github/workflows/samples-typescript-nestjs-server.yaml index 9bb43dc880c7..4d5b987eb19b 100644 --- a/.github/workflows/samples-typescript-nestjs-server.yaml +++ b/.github/workflows/samples-typescript-nestjs-server.yaml @@ -11,7 +11,7 @@ jobs: setup: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.filter.outputs.matrix }} + samples: ${{ steps.filter.outputs.samples }} steps: - uses: actions/checkout@v5 with: @@ -24,17 +24,17 @@ jobs: # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | samples/server/petstore/typescript-nestjs-server - 20 - 22 build: name: Test TypeScript NestJS Server needs: setup - if: ${{ needs.setup.outputs.matrix != '[]' }} + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + matrix: + node-version: [20, 22] + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 From 39bfcef1a3b8c0f1ad5525601d2f8020c8ec981f Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 13:15:52 +0200 Subject: [PATCH 10/15] ci: skip linux/windows tests for non-source changes Add setup job to detect source changes (modules/, pom.xml, .mvn/ only). Gate build jobs with if: needs.setup.outputs.source-changed == 'true' to skip expensive platform-specific tests when only .github/ or docs files changed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/linux.yaml | 31 +++++++++++++++++++++++++++++++ .github/workflows/windows.yaml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index fdf92a05671c..4051a22f6dca 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -11,9 +11,40 @@ on: - '[5-9]+.[0-9]+.x' jobs: + setup: + name: Detect source changes + runs-on: ubuntu-latest + outputs: + source-changed: ${{ steps.check.outputs.source-changed }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: check + shell: bash + env: + BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} + HEAD_SHA: ${{ github.sha }} + run: | + if [[ "$BASE_SHA" == "0000000000000000000000000000000000000000" ]] || [[ -z "$BASE_SHA" ]]; then + BASE_SHA=$(git rev-parse HEAD~1 2>/dev/null || echo "") + fi + if [[ -n "$BASE_SHA" ]]; then + CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" 2>/dev/null || git diff --name-only HEAD~1 HEAD) + else + CHANGED=$(git diff --name-only HEAD~1 HEAD) + fi + if echo "$CHANGED" | grep -qE '^(modules/|pom\.xml|\.mvn/)'; then + echo "source-changed=true" >> "$GITHUB_OUTPUT" + else + echo "source-changed=false" >> "$GITHUB_OUTPUT" + fi + build: name: 'Build: JDK ${{ matrix.java }} (${{ matrix.os }})' runs-on: ${{ matrix.os }} + needs: setup + if: needs.setup.outputs.source-changed == 'true' strategy: matrix: java: [11, 17] diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 2990c11f6d77..0f2d5c5feb29 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -11,9 +11,40 @@ on: - '[5-9]+.[0-9]+.x' jobs: + setup: + name: Detect source changes + runs-on: ubuntu-latest + outputs: + source-changed: ${{ steps.check.outputs.source-changed }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - id: check + shell: bash + env: + BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} + HEAD_SHA: ${{ github.sha }} + run: | + if [[ "$BASE_SHA" == "0000000000000000000000000000000000000000" ]] || [[ -z "$BASE_SHA" ]]; then + BASE_SHA=$(git rev-parse HEAD~1 2>/dev/null || echo "") + fi + if [[ -n "$BASE_SHA" ]]; then + CHANGED=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" 2>/dev/null || git diff --name-only HEAD~1 HEAD) + else + CHANGED=$(git diff --name-only HEAD~1 HEAD) + fi + if echo "$CHANGED" | grep -qE '^(modules/|pom\.xml|\.mvn/)'; then + echo "source-changed=true" >> "$GITHUB_OUTPUT" + else + echo "source-changed=false" >> "$GITHUB_OUTPUT" + fi + build: name: Build runs-on: windows-latest + needs: setup + if: needs.setup.outputs.source-changed == 'true' strategy: matrix: java: [11, 17] From 646cd3fbe27445f8e8a6afe56e9d4003b53d3177 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Sun, 7 Jun 2026 13:26:42 +0200 Subject: [PATCH 11/15] ci: add smart change detection to CircleCI nodes to skip unnecessary tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add should_run_tests() helper function that checks if relevant files changed since origin/master before running each node's integration tests. Decision logic (in order): 1. If origin/master unavailable (fresh CI env) → run tests (safe default) 2. If git diff fails → run tests (safe default) 3. If generator/config changed (modules/, bin/configs/, pom.xml, .mvn/) → run tests 4. If node's sample directories changed → run tests 5. Otherwise → skip tests Logs the decision-making process clearly for each node so users can understand why tests ran or were skipped. Prevents wasted CI resources on pure .github/ changes or unrelated sample changes (e.g., don't run perl tests if only ruby sample changed). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CI/circle_parallel.sh | 101 +++++++++++++++++++++++++++++++++++------- 1 file changed, 86 insertions(+), 15 deletions(-) diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index 83d48b12aeb1..edf67c165d05 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -9,36 +9,107 @@ set -e export NODE_ENV=test +# Helper function to check if tests should run for this node based on changed files +should_run_tests() { + local node_index=$1 + local sample_patterns=$2 # space-separated glob patterns for samples this node tests + + echo "" + echo "════════════════════════════════════════════════════════════════" + echo "Node $node_index: Determining if tests should run" + echo "════════════════════════════════════════════════════════════════" + + # Always run tests if origin/master doesn't exist (e.g., fresh CI environment) + if ! git rev-parse origin/master >/dev/null 2>&1; then + echo "ℹ️ origin/master not available locally (fresh checkout or CI environment)" + echo "✓ DECISION: Running tests (cannot determine changes safely)" + return 0 + fi + + # Try to get list of changed files since origin/master + local changed + changed=$(git diff --name-only origin/master HEAD 2>/dev/null) || { + echo "⚠️ git diff origin/master HEAD failed" + echo "✓ DECISION: Running tests (cannot determine changes safely)" + return 0 + } + + if [ -z "$changed" ]; then + echo "ℹ️ No files changed since origin/master" + echo "✗ DECISION: Skipping tests (nothing to test)" + return 1 + fi + + echo "Changed files:" + echo "$changed" | sed 's/^/ /' + + # Check if generator source or config changed (affects all samples) + echo "" + echo "Checking for generator/config changes (affects all samples)..." + if echo "$changed" | grep -qE '^(modules/|bin/configs/|pom\.xml|\.mvn/)'; then + echo "✓ Found: generator or config files changed" + echo "✓ DECISION: Running tests (generator/config affects all samples)" + return 0 + fi + + # Check if this node's sample directories changed + echo "" + echo "Checking for sample changes relevant to this node..." + for pattern in $sample_patterns; do + if echo "$changed" | grep -q "^$pattern"; then + echo "✓ Found: $pattern" + echo "✓ DECISION: Running tests (relevant sample changed)" + return 0 + fi + done + + echo "✗ No relevant sample changes found for node $node_index" + echo "✗ DECISION: Skipping tests (no relevant changes)" + return 1 +} + if [ "$NODE_INDEX" = "1" ]; then echo "Running node $NODE_INDEX ..." - sudo apt-get -y install cpanminus + if should_run_tests "$NODE_INDEX" "samples/client/petstore/perl/"; then + sudo apt-get -y install cpanminus - echo "Testing perl" - (cd samples/client/petstore/perl && /bin/bash ./test.bash) + echo "Testing perl" + (cd samples/client/petstore/perl && /bin/bash ./test.bash) + else + echo "Skipping perl tests — no relevant changes" + fi elif [ "$NODE_INDEX" = "2" ]; then echo "Running node $NODE_INDEX to test cpp-restsdk" - # install cpprestsdk - sudo apt-get install libcpprest-dev - wget "https://github.com/aminya/setup-cpp/releases/download/v0.37.0/setup-cpp-x64-linux" - chmod +x ./setup-cpp-x64-linux - sudo ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true - source ~/.cpprc # activate cpp environment variables + if should_run_tests "$NODE_INDEX" "samples/client/petstore/cpp-restsdk/"; then + # install cpprestsdk + sudo apt-get install libcpprest-dev + wget "https://github.com/aminya/setup-cpp/releases/download/v0.37.0/setup-cpp-x64-linux" + chmod +x ./setup-cpp-x64-linux + sudo ./setup-cpp-x64-linux --compiler llvm --cmake true --ninja true + source ~/.cpprc # activate cpp environment variables - (cd samples/client/petstore/cpp-restsdk/client && mvn integration-test) + (cd samples/client/petstore/cpp-restsdk/client && mvn integration-test) + else + echo "Skipping cpp-restsdk tests — no relevant changes" + fi elif [ "$NODE_INDEX" = "3" ]; then echo "Running node $NODE_INDEX ... " - echo "Testing ruby" - (cd samples/client/petstore/ruby && mvn integration-test) - (cd samples/client/petstore/ruby-faraday && mvn integration-test) - (cd samples/client/petstore/ruby-httpx && mvn integration-test) - (cd samples/client/petstore/ruby-autoload && mvn integration-test) + if should_run_tests "$NODE_INDEX" "samples/client/petstore/ruby"; then + echo "Testing ruby" + (cd samples/client/petstore/ruby && mvn integration-test) + (cd samples/client/petstore/ruby-faraday && mvn integration-test) + (cd samples/client/petstore/ruby-httpx && mvn integration-test) + (cd samples/client/petstore/ruby-autoload && mvn integration-test) + else + echo "Skipping ruby tests — no relevant changes" + fi else echo "Running node $NODE_INDEX ..." From fcbc9a4157c6b2cc60baba3487dbb11d30989187 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Mon, 8 Jun 2026 09:04:23 +0200 Subject: [PATCH 12/15] ci: enhance test execution strategy for feature branches to skip unnecessary runs (always run after merge to master) --- CI/circle_parallel.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index edf67c165d05..c334addb06b6 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -2,6 +2,15 @@ # # A bash script to run CircleCI node/test in parallel # +# STRATEGY: +# - On master branch: Always run all tests (post-merge verification) +# - On feature branches: Use short-circuit logic to skip tests if no relevant files changed +# This speeds up CI by avoiding unnecessary test runs when only docs/unrelated files changed. +# +# The reference branch for comparison is origin/master. Feature branches are compared against it +# to determine if affected samples or generator code changed. If a feature branch has no diffs +# from master in any relevant files, that node's tests are skipped. +# NODE_INDEX=${CIRCLE_NODE_INDEX:-0} @@ -19,6 +28,19 @@ should_run_tests() { echo "Node $node_index: Determining if tests should run" echo "════════════════════════════════════════════════════════════════" + # CRITICAL: Always run tests on master branch (after merge) + # When on master, there are no differences between the current commit and origin/master, + # which would incorrectly trigger the short-circuit. To ensure post-merge testing on master, + # we detect the branch and bypass the diff check entirely on the reference branch. + # + # Note: We compare against origin/master for feature branches, so we need to ensure + # that when the current branch IS master, we always run tests. + if [ "$CIRCLE_BRANCH" = "master" ]; then + echo "ℹ️ Current branch is master (reference branch)" + echo "✓ DECISION: Running tests (always test on master after merge)" + return 0 + fi + # Always run tests if origin/master doesn't exist (e.g., fresh CI environment) if ! git rev-parse origin/master >/dev/null 2>&1; then echo "ℹ️ origin/master not available locally (fresh checkout or CI environment)" @@ -44,6 +66,7 @@ should_run_tests() { echo "$changed" | sed 's/^/ /' # Check if generator source or config changed (affects all samples) + # These are core files that impact all sample outputs echo "" echo "Checking for generator/config changes (affects all samples)..." if echo "$changed" | grep -qE '^(modules/|bin/configs/|pom\.xml|\.mvn/)'; then @@ -52,7 +75,9 @@ should_run_tests() { return 0 fi - # Check if this node's sample directories changed + # Short-circuit: Check if this node's sample directories changed + # Each node tests specific sample directories. If none of the relevant samples changed, + # there's no point in running this node's tests. echo "" echo "Checking for sample changes relevant to this node..." for pattern in $sample_patterns; do From b926c2871bbd9b078eaad2d8e1e81f470bcd9a2d Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Mon, 8 Jun 2026 09:25:33 +0200 Subject: [PATCH 13/15] fix: correct 11 workflow conversion bugs in compute-matrix refactor Bug 1 - 80:8080 in all_samples (5 workflows): crystal, groovy, powershell, r, scala-client - Remove port-mapping string from sample-list input - Add petstore-api service container to build job Bug 2 - single-quoted paths in all_samples (3 workflows): c-libcurl-client, ocaml, protobuf - Remove surrounding single-quotes so grep matching works - Remove trailing slashes (normalised by compute-matrix anyway) Bug 3 - python version literals in all_samples (3 workflows): postman, python-client-echo-api, python-pydantic-v1-client-echo-api - Move version strings to static python-version: matrix dimension - Switch to samples output from compute-matrix for sample: dimension - Update if: guard to check needs.setup.outputs.samples != '[]' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../workflows/samples-c-libcurl-client.yaml | 6 +++--- .github/workflows/samples-crystal.yaml | 11 ++++++++-- .github/workflows/samples-groovy.yaml | 9 ++++++++- .github/workflows/samples-ocaml.yaml | 12 +++++------ .github/workflows/samples-postman.yaml | 10 ++++++---- .github/workflows/samples-powershell.yaml | 11 ++++++++-- .github/workflows/samples-protobuf.yaml | 6 +++--- .../samples-python-client-echo-api.yaml | 18 +++++++++-------- ...es-python-pydantic-v1-client-echo-api.yaml | 20 ++++++++++--------- .github/workflows/samples-r.yaml | 15 ++++++++++---- .github/workflows/samples-scala-client.yaml | 9 ++++++++- 11 files changed, 84 insertions(+), 43 deletions(-) diff --git a/.github/workflows/samples-c-libcurl-client.yaml b/.github/workflows/samples-c-libcurl-client.yaml index 19e5566b95f0..9c8a25223013 100644 --- a/.github/workflows/samples-c-libcurl-client.yaml +++ b/.github/workflows/samples-c-libcurl-client.yaml @@ -30,9 +30,9 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - 'samples/client/petstore/c/' - 'samples/client/petstore/c-useJsonUnformatted/' - 'samples/client/others/c/bearerAuth/' + samples/client/petstore/c + samples/client/petstore/c-useJsonUnformatted + samples/client/others/c/bearerAuth build: name: Build c libcurl client diff --git a/.github/workflows/samples-crystal.yaml b/.github/workflows/samples-crystal.yaml index 1029545080fa..119fa114e743 100644 --- a/.github/workflows/samples-crystal.yaml +++ b/.github/workflows/samples-crystal.yaml @@ -25,8 +25,7 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - samples/client/petstore/crystal/ - 80:8080 + samples/client/petstore/crystal build: name: Build Crystal projects @@ -36,6 +35,14 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 steps: - uses: actions/checkout@v5 - name: Install Crystal diff --git a/.github/workflows/samples-groovy.yaml b/.github/workflows/samples-groovy.yaml index 069bb4d4e61e..596869ad9b0f 100644 --- a/.github/workflows/samples-groovy.yaml +++ b/.github/workflows/samples-groovy.yaml @@ -30,7 +30,6 @@ jobs: # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | samples/client/petstore/groovy - 80:8080 build: name: Build Groovy @@ -40,6 +39,14 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 steps: - uses: actions/checkout@v5 - uses: actions/setup-java@v5 diff --git a/.github/workflows/samples-ocaml.yaml b/.github/workflows/samples-ocaml.yaml index 03cf2a7dc7be..25704e5a4824 100644 --- a/.github/workflows/samples-ocaml.yaml +++ b/.github/workflows/samples-ocaml.yaml @@ -36,12 +36,12 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - 'samples/client/petstore/ocaml/' - 'samples/client/petstore/ocaml-fake-petstore/' - 'samples/client/petstore/ocaml-oneOf-primitive/' - 'samples/client/petstore/ocaml-additional-properties/' - 'samples/client/petstore/ocaml-enum-in-composed-schema/' - 'samples/client/petstore/ocaml-recursion-test/' + samples/client/petstore/ocaml + samples/client/petstore/ocaml-fake-petstore + samples/client/petstore/ocaml-oneOf-primitive + samples/client/petstore/ocaml-additional-properties + samples/client/petstore/ocaml-enum-in-composed-schema + samples/client/petstore/ocaml-recursion-test build: name: Build OCaml diff --git a/.github/workflows/samples-postman.yaml b/.github/workflows/samples-postman.yaml index 269b39bb11a1..49680c1970a0 100644 --- a/.github/workflows/samples-postman.yaml +++ b/.github/workflows/samples-postman.yaml @@ -11,7 +11,7 @@ jobs: setup: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.filter.outputs.matrix }} + samples: ${{ steps.filter.outputs.samples }} steps: - uses: actions/checkout@v5 with: @@ -24,16 +24,18 @@ jobs: # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | samples/schema/postman-collection - "3.12" build: name: Test Python client needs: setup - if: ${{ needs.setup.outputs.matrix != '[]' }} + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + matrix: + python-version: + - "3.12" + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 diff --git a/.github/workflows/samples-powershell.yaml b/.github/workflows/samples-powershell.yaml index 5c4ac4079fb8..14931c9899cd 100644 --- a/.github/workflows/samples-powershell.yaml +++ b/.github/workflows/samples-powershell.yaml @@ -25,8 +25,7 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - samples/client/petstore/powershell/ - 80:8080 + samples/client/petstore/powershell build: needs: setup @@ -36,6 +35,14 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 steps: - uses: actions/checkout@v5 - name: Build the client diff --git a/.github/workflows/samples-protobuf.yaml b/.github/workflows/samples-protobuf.yaml index edcd1cff22a6..978fbebe20e0 100644 --- a/.github/workflows/samples-protobuf.yaml +++ b/.github/workflows/samples-protobuf.yaml @@ -28,9 +28,9 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - 'samples/config/petstore/protobuf-schema/' - 'samples/config/petstore/protobuf-schema-config/' - 'samples/config/petstore/protobuf-schema-config-complex/' + samples/config/petstore/protobuf-schema + samples/config/petstore/protobuf-schema-config + samples/config/petstore/protobuf-schema-config-complex build: name: Build Protobuf Client diff --git a/.github/workflows/samples-python-client-echo-api.yaml b/.github/workflows/samples-python-client-echo-api.yaml index 2bf9373fe203..9105ca54906c 100644 --- a/.github/workflows/samples-python-client-echo-api.yaml +++ b/.github/workflows/samples-python-client-echo-api.yaml @@ -11,7 +11,7 @@ jobs: setup: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.filter.outputs.matrix }} + samples: ${{ steps.filter.outputs.samples }} steps: - uses: actions/checkout@v5 with: @@ -25,20 +25,22 @@ jobs: all_samples: | samples/client/echo_api/python samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent - "3.10" - "3.11" - "3.12" - "3.13" - "3.14" build: name: Test Python client needs: setup - if: ${{ needs.setup.outputs.matrix != '[]' }} + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + matrix: + python-version: + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 diff --git a/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml b/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml index 2d0feaf54520..0362b419be59 100644 --- a/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml +++ b/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml @@ -11,7 +11,7 @@ jobs: setup: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.filter.outputs.matrix }} + samples: ${{ steps.filter.outputs.samples }} steps: - uses: actions/checkout@v5 with: @@ -23,21 +23,23 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - samples/client/echo_api/python-pydantic-v1/ - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" + samples/client/echo_api/python-pydantic-v1 build: name: Test Python client needs: setup - if: ${{ needs.setup.outputs.matrix != '[]' }} + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + matrix: + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 diff --git a/.github/workflows/samples-r.yaml b/.github/workflows/samples-r.yaml index 981c9e07fb99..4c69e21766e3 100644 --- a/.github/workflows/samples-r.yaml +++ b/.github/workflows/samples-r.yaml @@ -29,10 +29,9 @@ jobs: # Action inputs don't support arrays, so this is a newline-delimited string parsed in the action script. # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | - samples/client/petstore/R/ - samples/client/petstore/R-httr2/ - samples/client/petstore/R-httr2-wrapper/ - 80:8080 + samples/client/petstore/R + samples/client/petstore/R-httr2 + samples/client/petstore/R-httr2-wrapper build: name: Build R projects @@ -42,6 +41,14 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts diff --git a/.github/workflows/samples-scala-client.yaml b/.github/workflows/samples-scala-client.yaml index b360e8bf6d20..74dbe6efb182 100644 --- a/.github/workflows/samples-scala-client.yaml +++ b/.github/workflows/samples-scala-client.yaml @@ -50,7 +50,6 @@ jobs: samples/client/petstore/scala-sttp-circe samples/client/petstore/scala-sttp4 samples/client/petstore/scala-sttp4-circe - 80:8080 build: name: Build sbt/Scala @@ -60,6 +59,14 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 steps: - uses: actions/checkout@v5 - name: Add hosts to /etc/hosts From 8ff22d1d7e66009aac82196b631b50954c2833bc Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Mon, 8 Jun 2026 09:44:50 +0200 Subject: [PATCH 14/15] fix: restore node-version matrix dimension in 3 TypeScript workflows samples-typescript-axios-echo-api.yaml samples-typescript-encode-decode.yaml samples-typescript-node-encode-decode.yaml Node version numbers (16, 18, 20, 22, 24) had leaked into all_samples as bare integer literals. compute-matrix treated them as fake sample paths, and the build matrix was replaced wholesale, dropping the node-version dimension and breaking matrix.node-version references. Fix mirrors the earlier Python workflow fix: - Remove version literals from all_samples - Switch setup output to samples (not matrix) - Add static node-version: dimension alongside sample: in build matrix - Update if: guard to check needs.setup.outputs.samples != '[]' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../samples-typescript-axios-echo-api.yaml | 14 ++++++++------ .../samples-typescript-encode-decode.yaml | 14 ++++++++------ .../samples-typescript-node-encode-decode.yaml | 14 ++++++++------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/samples-typescript-axios-echo-api.yaml b/.github/workflows/samples-typescript-axios-echo-api.yaml index 9f90038ea0f1..d86e8a27bc6b 100644 --- a/.github/workflows/samples-typescript-axios-echo-api.yaml +++ b/.github/workflows/samples-typescript-axios-echo-api.yaml @@ -10,7 +10,7 @@ jobs: setup: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.filter.outputs.matrix }} + samples: ${{ steps.filter.outputs.samples }} steps: - uses: actions/checkout@v5 with: @@ -23,18 +23,20 @@ jobs: # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | samples/client/echo_api/typescript-axios/test - 16 - 18 - 20 build: name: Test TypeScript Axios client needs: setup - if: ${{ needs.setup.outputs.matrix != '[]' }} + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + matrix: + node-version: + - 16 + - 18 + - 20 + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/samples-typescript-encode-decode.yaml b/.github/workflows/samples-typescript-encode-decode.yaml index 56b17996293c..641e6b4e6990 100644 --- a/.github/workflows/samples-typescript-encode-decode.yaml +++ b/.github/workflows/samples-typescript-encode-decode.yaml @@ -10,7 +10,7 @@ jobs: setup: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.filter.outputs.matrix }} + samples: ${{ steps.filter.outputs.samples }} steps: - uses: actions/checkout@v5 with: @@ -23,18 +23,20 @@ jobs: # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | samples/client/others/typescript/encode-decode/test - 20 - 22 - 24 build: name: Test TypeScript Encoding / Decoding needs: setup - if: ${{ needs.setup.outputs.matrix != '[]' }} + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + matrix: + node-version: + - 20 + - 22 + - 24 + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/samples-typescript-node-encode-decode.yaml b/.github/workflows/samples-typescript-node-encode-decode.yaml index eb3273ab2808..8d1c9ca09d7e 100644 --- a/.github/workflows/samples-typescript-node-encode-decode.yaml +++ b/.github/workflows/samples-typescript-node-encode-decode.yaml @@ -10,7 +10,7 @@ jobs: setup: runs-on: ubuntu-latest outputs: - matrix: ${{ steps.filter.outputs.matrix }} + samples: ${{ steps.filter.outputs.samples }} steps: - uses: actions/checkout@v5 with: @@ -23,18 +23,20 @@ jobs: # To add a new sample: add it here AND add a matching entry to the paths: trigger above. all_samples: | samples/client/others/typescript-node/encode-decode/test - 16 - 18 - 20 build: name: Test TypeScript Node Encoding / Decoding needs: setup - if: ${{ needs.setup.outputs.matrix != '[]' }} + if: ${{ needs.setup.outputs.samples != '[]' }} runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{ fromJson(needs.setup.outputs.matrix) }} + matrix: + node-version: + - 16 + - 18 + - 20 + sample: ${{ fromJson(needs.setup.outputs.samples) }} steps: - uses: actions/checkout@v5 From b8d8fb0771d4705657c76738d64eeafef97f8992 Mon Sep 17 00:00:00 2001 From: Jachym Metlicka Date: Mon, 8 Jun 2026 09:50:24 +0200 Subject: [PATCH 15/15] fix: hardcode java-version '17' in samples-java-helidon-v3.yaml matrix.version was referenced but the version: matrix dimension was removed during the compute-matrix refactor, causing setup-java to receive an empty string. Consistent with the v4 fix (hardcoded '21'). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/samples-java-helidon-v3.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/samples-java-helidon-v3.yaml b/.github/workflows/samples-java-helidon-v3.yaml index b21a2506e595..90a6fae2d656 100644 --- a/.github/workflows/samples-java-helidon-v3.yaml +++ b/.github/workflows/samples-java-helidon-v3.yaml @@ -48,7 +48,7 @@ jobs: - uses: actions/setup-java@v5 with: distribution: 'temurin' - java-version: ${{ matrix.version }} + java-version: '17' - name: Cache maven dependencies uses: actions/cache@v5 env: