From 6c833d3b114a0c87025c92228e89d25176979e57 Mon Sep 17 00:00:00 2001 From: sraj Date: Wed, 2 Aug 2023 23:34:12 -0700 Subject: [PATCH] Addingn workflows and updating script --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0094d8b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, and execute run scripts on the repository. This is based on the default Node.js actions. + +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm i + - run: find openapi -name '*.json' -exec npm run-script bundle-deref -- {} \; + - run: find openapi -name '*.json' -exec npm run-script lint-redocly -- {} \; + - run: find openapi -name '*.json' -exec npm run-script lint-spectral -- {} \; + - run: find openapi -name '*.json' -exec npm run-script lint-openapi -- {} \; + - run: find openapi -name '*.json' -exec npm run-script codegen-java -- {} \; -exec rm -rf generated/java \; + - run: find openapi -name '*.json' -exec npm run-script codegen-typescript-node -- {} \; -exec rm -rf generated/typescript-node \; diff --git a/package.json b/package.json index 4f0d7db..a32ddaf 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "lint-redocly": "redocly --format summary lint", "lint-spectral": "spectral --format pretty lint", "lint-openapi": "openapi-generator-cli validate -i", - "codegen-java": "openapi-generator-cli generate -g java -o generated/java -i", - "codegen-typescript-node": "openapi-generator-cli generate -g typescript-node -o generated/typescript-node -i" + "codegen-java": "openapi-generator-cli generate --skip-validate-spec -g java -o generated/java -i", + "codegen-typescript-node": "openapi-generator-cli generate --skip-validate-spec -g typescript-node -o generated/typescript-node -i" } }