-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from open-zaak/feature/gh-check-oas
👷 add OAS checks as gh actions
- Loading branch information
Showing
6 changed files
with
105 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: generate-postman-collection | ||
|
||
on: | ||
push: | ||
paths: | ||
- "src/openapi.yaml" | ||
- ".github/workflows/generate-postman-collection.yml" | ||
branches: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
name: Generate Postman collection | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
- name: Install dependencies | ||
run: npm install -g openapi-to-postmanv2 | ||
- name: Create tests folder | ||
run: mkdir -p ./tests/postman | ||
- name: Generate Postman collection | ||
run: openapi2postmanv2 -s ./src/openapi.yaml -o ./tests/postman/collection.json --pretty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: generate-sdks | ||
|
||
on: | ||
push: | ||
paths: | ||
- "src/openapi.yaml" | ||
- ".github/workflows/generate-sdks.yml" | ||
branches: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
name: Generate SDK | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
- name: Install dependencies | ||
run: npm install -g @openapitools/openapi-generator-cli | ||
- name: Determing oas path | ||
id: vars | ||
run: echo ::set-output name=oas::./src/openapi.yaml | ||
- name: Validate schema | ||
run: openapi-generator-cli validate -i ${{ steps.vars.outputs.oas }} | ||
- name: Generate Java client | ||
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \ | ||
-o ./sdks/java -g java --additional-properties=dateLibrary=java8,java8=true,optionalProjectFile=false,optionalAssemblyInfo=false | ||
- name: Generate .NET client | ||
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \ | ||
-o ./sdks/net -g csharp --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false | ||
- name: Generate Python client | ||
run: openapi-generator-cli generate -i ${{ steps.vars.outputs.oas }} --global-property=modelTests=false,apiTests=false,modelDocs=false,apiDocs=false \ | ||
-o ./sdks/python -g python --additional-properties=optionalProjectFile=false,optionalAssemblyInfo=false+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: lint-oas | ||
|
||
on: | ||
push: | ||
paths: | ||
- "src/openapi.yaml" | ||
- .github/workflows/lint-oas.yml | ||
branches: | ||
- '**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
name: Lint OAS | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
- name: Install spectral | ||
run: npm install -g @stoplight/spectral@5 | ||
- name: Run OAS linter | ||
run: spectral lint ./src/openapi.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters