diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00d2944aeca..ee0e809a0eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,14 +7,14 @@ on: - master - renovate/** pull_request: - types: [ assigned, opened, synchronize, reopened ] + types: [assigned, opened, synchronize, reopened] jobs: build: name: Build runs-on: ubuntu-latest strategy: matrix: - node-version: [ 22.x ] + node-version: [22.x] steps: - name: Checkout @@ -48,13 +48,13 @@ jobs: path: dist/apps/package.tgz e2e: - name: "E2E local: (${{ matrix.os }})" + name: 'E2E local: (${{ matrix.os }})' needs: build runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] - node-version: [ 22.x ] + os: [ubuntu-latest, macos-latest, windows-latest] + node-version: [22.x] steps: - name: Checkout @@ -69,10 +69,15 @@ jobs: with: name: package.tgz - - name: Test + - name: set yarn to PATH + shell: bash + run: echo $(yarn global bin) >> $GITHUB_PATH + + - name: Test (1/2) + shell: bash run: | cd ./examples - yarn global add json && export PATH="$(yarn global bin):$PATH" + yarn global add json yarn cache clean && yarn add $GITHUB_WORKSPACE/package.tgz npm run oa version npm run oa completion @@ -84,7 +89,16 @@ jobs: (npm run oa version-manager set 6.0 && npm run oa version | grep -q '6.0.1') || exit 1 (npm run oa version-manager set 4.3.1 && npm run oa version | grep -q '4.3.1') || exit 1 (npm run oa version-manager set 4.3.1 && npm run oa version | grep -q '4.3.1') || exit 1 - (export OPENAPI_GENERATOR_CLI_SEARCH_URL=DEFAULT && npm run oa version-manager set 7.2.0 && npm run oa version | grep -q '7.2.0') || exit 1 + + - name: set environment variable + shell: bash + run: echo "OPENAPI_GENERATOR_CLI_SEARCH_URL=DEFAULT" >> $GITHUB_ENV + + - name: Test (2/2) + shell: bash + run: | + cd ./examples + (npm run oa version-manager set 7.2.0 && npm run oa version | grep -q '7.2.0') || exit 1 json -I -f openapitools.json -e 'this["generator-cli"]["storageDir"]="./my/storage/"' (npm run oa version-manager set 4.3.0 && npm run oa version | grep -q '4.3.0') || exit 1 test -f ./my/storage/4.3.0.jar || exit 1 @@ -99,6 +113,7 @@ jobs: # yarn cache clean && yarn add $GITHUB_WORKSPACE/package.tgz # export HTTP_PROXY=http://proxy_ip:proxy_port # npm run oa generate -- -g ruby -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o $GITHUB_WORKSPACE/tmp/ruby-client + # rel#ease: # if: github.event.pull_request.merged == 'true' # name: Release (Dry) diff --git a/apps/generator-cli/src/app/services/config.service.ts b/apps/generator-cli/src/app/services/config.service.ts index e087e00d919..eff20ec33c6 100644 --- a/apps/generator-cli/src/app/services/config.service.ts +++ b/apps/generator-cli/src/app/services/config.service.ts @@ -6,8 +6,7 @@ import { Command } from 'commander'; @Injectable() export class ConfigService { - public readonly cwd = - process.env.PWD || process.env.INIT_CWD || process.cwd(); + public readonly cwd = process.cwd(); public readonly configFile = this.configFileOrDefault(); private configFileOrDefault() {