diff --git a/.github/workflows/samples-typescript-client.yaml b/.github/workflows/samples-typescript-client.yaml new file mode 100644 index 000000000000..2aee47a85e1c --- /dev/null +++ b/.github/workflows/samples-typescript-client.yaml @@ -0,0 +1,140 @@ +name: Samples TS clients + +on: + push: + paths: + - samples/client/others/typescript-angular/** + # comment out angular released before Nov 2023 + #- 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/** + # comment out below as there's no pom.xml + #- 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/openapi3/client/petstore/typescript/builds/default/** + # comment out due to build failure + #- samples/openapi3/client/petstore/typescript/tests/default/** + - samples/openapi3/client/petstore/typescript/builds/jquery/** + # comment out due to build failure + #- samples/openapi3/client/petstore/typescript/tests/jquery/** + - samples/openapi3/client/petstore/typescript/builds/object_params/** + # comment out due to build failure + #- 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/** + # comment out due to build failure + #- 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/** + # comment out due to build failure + #- samples/client/petstore/typescript-node/npm/** + - samples/client/petstore/typescript-rxjs/builds/with-npm-version/** + - samples/client/petstore/typescript-axios/builds/with-npm-version/** + # comment out due to build failure + #- samples/client/petstore/typescript-axios/tests/default/** + pull_request: + paths: + - samples/client/others/typescript-angular/** + #- 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/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/** +jobs: + build: + name: Build projects + runs-on: ubuntu-latest + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 + strategy: + fail-fast: false + matrix: + node: + #- "18.x" + - "20.x" + sample: + - samples/client/others/typescript-angular/ + #- 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/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/ + steps: + - uses: actions/checkout@v5 + - name: Add hosts to /etc/hosts + run: | + sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' # Specify your desired Java version + distribution: 'temurin' # Or 'adopt', 'oracle', etc. + cache: maven # Cache Maven dependencies for faster builds + - name: Use Node.js + uses: actions/setup-node@v5 + with: + node-version: ${{ matrix.node }} + cache: 'npm' # Or 'yarn' + - name: mvn integration-test + working-directory: ${{ matrix.sample }} + run: mvn integration-test diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index b7646e47587c..160c6e912046 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -62,51 +62,51 @@ elif [ "$NODE_INDEX" = "3" ]; then echo "Running node $NODE_INDEX ... " - # Install node@stable (for angular 6) - set +e - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash - export NVM_DIR="/opt/circleci/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - #nvm install stable - # install v16 instead of the latest stable version - nvm install 18 - nvm alias default 18 - node --version - - # Each step uses the same `$BASH_ENV`, so need to modify it - echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV - echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV - - (cd samples/client/others/typescript-angular && mvn integration-test) - (cd samples/client/petstore/typescript-angular-v12-provided-in-root && mvn integration-test) - (cd samples/client/petstore/typescript-angular-v13-provided-in-root && mvn integration-test) - (cd samples/client/petstore/typescript-angular-v14-provided-in-root && mvn integration-test) - (cd samples/client/petstore/typescript-angular-v15-provided-in-root && mvn integration-test) - (cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test) - (cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test) - (cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test) - (cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/tests/jquery && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/builds/object_params && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/tests/object_params && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/builds/inversify && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/tests/inversify && mvn integration-test) - #(cd samples/openapi3/client/petstore/typescript/tests/deno && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/builds/browser && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/tests/browser && mvn integration-test) - (cd samples/openapi3/client/petstore/typescript/builds/nullable-enum && mvn integration-test) - (cd samples/client/petstore/typescript-fetch/builds/default && mvn integration-test) - (cd samples/client/petstore/typescript-fetch/builds/es6-target && mvn integration-test) - (cd samples/client/petstore/typescript-fetch/builds/with-npm-version && mvn integration-test) - (cd samples/client/petstore/typescript-fetch/tests/default && mvn integration-test) - (cd samples/client/petstore/typescript-node/npm && mvn integration-test) - (cd samples/client/petstore/typescript-rxjs/builds/with-npm-version && mvn integration-test) - (cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test) - (cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test) - (cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test) + ## Install node@stable (for angular 6) + #set +e + #curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash + #export NVM_DIR="/opt/circleci/.nvm" + #[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + ##nvm install stable + ## install v16 instead of the latest stable version + #nvm install 18 + #nvm alias default 18 + #node --version + + ## Each step uses the same `$BASH_ENV`, so need to modify it + #echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV + #echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV + + #(cd samples/client/others/typescript-angular && mvn integration-test) + #(cd samples/client/petstore/typescript-angular-v12-provided-in-root && mvn integration-test) + #(cd samples/client/petstore/typescript-angular-v13-provided-in-root && mvn integration-test) + #(cd samples/client/petstore/typescript-angular-v14-provided-in-root && mvn integration-test) + #(cd samples/client/petstore/typescript-angular-v15-provided-in-root && mvn integration-test) + #(cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test) + #(cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test) + #(cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test) + #(cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/tests/jquery && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/builds/object_params && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/tests/object_params && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/builds/inversify && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/tests/inversify && mvn integration-test) + ##(cd samples/openapi3/client/petstore/typescript/tests/deno && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/builds/browser && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/tests/browser && mvn integration-test) + #(cd samples/openapi3/client/petstore/typescript/builds/nullable-enum && mvn integration-test) + #(cd samples/client/petstore/typescript-fetch/builds/default && mvn integration-test) + #(cd samples/client/petstore/typescript-fetch/builds/es6-target && mvn integration-test) + #(cd samples/client/petstore/typescript-fetch/builds/with-npm-version && mvn integration-test) + #(cd samples/client/petstore/typescript-fetch/tests/default && mvn integration-test) + #(cd samples/client/petstore/typescript-node/npm && mvn integration-test) + #(cd samples/client/petstore/typescript-rxjs/builds/with-npm-version && mvn integration-test) + #(cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test) + #(cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test) + #(cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test) else echo "Running node $NODE_INDEX ..." diff --git a/samples/client/others/typescript-angular/pom.xml b/samples/client/others/typescript-angular/pom.xml index e0d6e9aae9ef..d35ca7859677 100644 --- a/samples/client/others/typescript-angular/pom.xml +++ b/samples/client/others/typescript-angular/pom.xml @@ -60,3 +60,4 @@ + diff --git a/samples/client/petstore/typescript-axios/tests/default/pom.xml b/samples/client/petstore/typescript-axios/tests/default/pom.xml index 62e700087e8c..06dd6d622a6b 100644 --- a/samples/client/petstore/typescript-axios/tests/default/pom.xml +++ b/samples/client/petstore/typescript-axios/tests/default/pom.xml @@ -57,3 +57,4 @@ + diff --git a/samples/openapi3/client/petstore/typescript/builds/nullable-enum/pom.xml b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/pom.xml new file mode 100644 index 000000000000..b0d6689b4333 --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/nullable-enum/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + org.openapitools + TypeScriptBuildNullableEnumPetstoreClientSample + pom + 1.0-SNAPSHOT + TS Nullable Enum Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + npm-build + pre-integration-test + + exec + + + npm + + run + build + + + + + + + +