Skip to content

Commit

Permalink
MODLD-602: Update workflow/api-**.yml files based on https://github.c…
Browse files Browse the repository at this point in the history
  • Loading branch information
pkjacob committed Nov 21, 2024
1 parent eeb4b91 commit d53abc6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/api-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ name: api-doc

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

on:
workflow_dispatch:
push:
branches: [ main, master ]
paths:
- 'src/main/resources/swagger.api/**'
tags: '[vV][0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:

jobs:
api-doc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
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 @@ -86,9 +78,6 @@ jobs:
- name: Show generated files
working-directory: ${{ env.OUTPUT_DIR }}
run: ls -R
- name: Fix dead link
run: jq '.config.oas.files[] |= if . == "${{ env.API_DIRECTORIES }}/openapi.yaml" then "${{ env.API_INPUT_SPEC }}" else . end' */config-doc.json > tmp.json && mv tmp.json */config-doc.json
working-directory: ${{ env.OUTPUT_DIR }}
- name: Publish to AWS S3
uses: sai-sharan/[email protected]
with:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/api-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,24 @@ name: api-lint
env:
API_TYPES: 'OAS'
API_DIRECTORIES: 'src/main/resources/swagger.api'
API_EXCLUDES: 'paths responses src/main/resources/swagger.api/folio-modules.yaml'
API_EXCLUDES: 'folio-modules.yaml'
API_WARNINGS: false

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

jobs:
api-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare folio-tools
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/api-schema-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@ name: api-schema-lint

env:
API_DIRECTORIES: 'src/main/resources/swagger.api'
API_EXCLUDES: 'src/main/resources/swagger.api/folio-modules.yaml'
API_EXCLUDES: ''

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

jobs:
api-schema-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare folio-tools
Expand Down

0 comments on commit d53abc6

Please sign in to comment.