Skip to content

Commit

Permalink
build: fix api-doc workflow and replace api-lint with spectral lint (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
psmagin authored Apr 22, 2024
1 parent 056d3b8 commit 24d231d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/api-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ name: api-doc

env:
API_TYPES: 'OAS'
API_DIRECTORIES: 'src/main/resources/swagger.api'
API_EXCLUDES: 'paths responses'
API_DIRECTORIES: 'target/api/openapi'
API_INPUT_SPEC: 'src/main/resources/swagger.api/mod-search.yaml'
API_EXCLUDES: ''
OUTPUT_DIR: 'folio-api-docs'
AWS_S3_BUCKET: 'foliodocs'
AWS_S3_FOLDER: 'api'
Expand All @@ -28,6 +29,7 @@ env:
AWS_S3_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}

on:
workflow_dispatch:
push:
branches: [ main, master ]
paths:
Expand All @@ -43,6 +45,13 @@ jobs:
with:
ref: ${{ github.REF }}
submodules: recursive
- name: Build spec
uses: s4u/[email protected]
- run: |
mvn openapi-generator:generate \
-Dopenapi.generator.maven.plugin.inputSpec=${{ env.API_INPUT_SPEC }} \
-Dopenapi.generator.maven.plugin.generatorName=openapi-yaml \
-Dopenapi.generator.maven.plugin.output=target/api
- name: Prepare folio-tools
run: |
git clone https://github.com/folio-org/folio-tools
Expand Down Expand Up @@ -88,4 +97,3 @@ jobs:
destination_prefix: ${{ env.AWS_S3_FOLDER }}
delete: false
quiet: false

14 changes: 7 additions & 7 deletions .github/workflows/api-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ env:
API_EXCLUDES: 'paths responses'
API_WARNINGS: false

on:
push:
paths:
- 'src/main/resources/swagger.api/**'
pull_request:
paths:
- 'src/main/resources/swagger.api/**'
#on:
# push:
# paths:
# - 'src/main/resources/swagger.api/**'
# pull_request:
# paths:
# - 'src/main/resources/swagger.api/**'

jobs:
api-lint:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/api-schema-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ env:
API_DIRECTORIES: 'src/main/resources/swagger.api'
API_EXCLUDES: ''

on:
push:
paths:
- 'src/main/resources/swagger.api/**'
pull_request:
paths:
- 'src/main/resources/swagger.api/**'
#on:
# push:
# paths:
# - 'src/main/resources/swagger.api/**'
# pull_request:
# paths:
# - 'src/main/resources/swagger.api/**'

jobs:
api-schema-lint:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/spectral-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Run Spectral on Pull Requests

on:
- pull_request
push:
paths:
- 'src/main/resources/swagger.api/**'
pull_request:
paths:
- 'src/main/resources/swagger.api/**'

jobs:
build:
Expand Down

0 comments on commit 24d231d

Please sign in to comment.