Skip to content

Commit

Permalink
add CI for OpenAPI bundle test/build
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Jan 3, 2024
1 parent c342cc5 commit 4ee41f4
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-openapi-bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build OpenAPI bundle

on:
push:
branches:
- master
paths:
- 'core/openapi/**.yaml'

jobs:
build-openapi-bundle:
name: Generate OpenAPI bundle
runs-on: ubuntu-latest
steps:
- name: Setup npm
uses: actions/setup-node@v2
- name: Install dependencies
run: npm install -g @apidevtools/swagger-cli
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Generate OpenAPI bundle
run: |
cd core/openapi
swagger-cli bundle -o ogcapi-records-1.bundled.json ogcapi-records-1.yaml
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Tom Kralidis
author_email: tomkralidis@gmail.com
message: 'Updating OpenAPI bundle'
add: '*.json'
cwd: './core/openapi/'

30 changes: 30 additions & 0 deletions .github/workflows/test-build-openapi-bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test build OpenAPI bundle

on:
pull_request:
branches:
- master
paths:
- 'core/openapi/**.yaml'

jobs:
test-build-openapi-bundle:
name: Generate OpenAPI bundle
runs-on: ubuntu-latest
steps:
- name: Setup npm
uses: actions/setup-node@v2
- name: Install dependencies
run: npm install -g @apidevtools/swagger-cli
- name: Checkout
uses: actions/checkout@v2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
#with:
# fetch-depth: 0
- name: Generate OpenAPI bundle
run: |
cd core/openapi
swagger-cli bundle -o ogcapi-records-1.bundled.json ogcapi-records-1.yaml

0 comments on commit 4ee41f4

Please sign in to comment.