Release 2.3.11 #1382
Workflow file for this run
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
name: Platform Schema (OpenAPI) | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
ods_branch: | |
description: 'If set, pip install ods-tools branch [git ref]' | |
required: false | |
workflow_call: | |
inputs: | |
ods_branch: | |
description: 'If set, pip install ods-tools branch [git ref]' | |
required: false | |
type: string | |
jobs: | |
ods_tools: | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
uses: OasisLMF/ODS_Tools/.github/workflows/build.yml@main | |
secrets: inherit | |
with: | |
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'main' || inputs.ods_branch }} | |
schema: | |
if: ${{ ! failure() || ! cancelled() }} | |
needs: ods_tools | |
env: | |
SCHEMA_ALL: 'reports/openapi-schema.json' | |
SCHEMA_V1: 'reports/v1-openapi-schema.json' | |
SCHEMA_V2: 'reports/v2-openapi-schema.json' | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install requirments | |
run: pip install -r requirements-server.txt | |
- name: Download package | |
if: needs.ods_tools.outputs.whl_filename != '' | |
uses: actions/download-artifact@v4 | |
with: | |
name: bin_package | |
path: ${{ github.workspace }}/ | |
- name: Install package | |
if: needs.ods_tools.outputs.whl_filename != '' | |
run: | | |
pip uninstall ods-tools -y | |
pip install ${{ needs.ods_tools.outputs.whl_filename }} | |
- name: Generate OpenAPI | |
run: | | |
test -d $(dirname ${{ env.SCHEMA_ALL }}) || mkdir -p $(dirname ${{ env.SCHEMA_ALL }}) | |
python ./manage.py migrate | |
python ./manage.py generate_swagger ${{ env.SCHEMA_ALL }} | |
- name: Generate OpenAPI (only v1) | |
run: | | |
test -d $(dirname ${{ env.SCHEMA_V1 }}) || mkdir -p $(dirname ${{ env.SCHEMA_V1 }}) | |
python ./manage.py migrate | |
python ./manage.py generate_swagger ${{ env.SCHEMA_V1 }} | |
env: | |
OASIS_GEN_SWAGGER_V1: 1 | |
- name: Generate OpenAPI (only v2) | |
run: | | |
test -d $(dirname ${{ env.SCHEMA_V2 }}) || mkdir -p $(dirname ${{ env.SCHEMA_V2 }}) | |
python ./manage.py migrate | |
python ./manage.py generate_swagger ${{ env.SCHEMA_V2 }} | |
env: | |
OASIS_GEN_SWAGGER_V2: 1 | |
- name: Store OpenAPI schema | |
uses: actions/upload-artifact@v4 | |
with: | |
name: openapi-schema | |
path: ${{ env.SCHEMA_ALL }} | |
retention-days: 3 | |
- name: Store OpenAPI schema (only v1) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: v1-openapi-schema | |
path: ${{ env.SCHEMA_V1 }} | |
retention-days: 3 | |
- name: Store OpenAPI schema (only v2) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: v2-openapi-schema | |
path: ${{ env.SCHEMA_V2 }} | |
retention-days: 3 | |
- name: Test Schema | |
run: ./scripts/build-maven.sh $(cat VERSION) |