Skip to content

Commit 9d561e3

Browse files
committed
add code generation and updated linting
1 parent 2366aad commit 9d561e3

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on: [push]
2+
jobs:
3+
deutschland_generation:
4+
name: "Deutschland Generation"
5+
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
python-version: ['3.7.8' ]
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
# Create default .spectral.yaml file used for linting if its not existing already
14+
- name: "Create spectral file if it not exists"
15+
continue-on-error: true
16+
run: |
17+
set -C; echo "extends: spectral:oas" > .spectral.yaml
18+
19+
# Runs a single command using the runners shell
20+
- name: "Lint file"
21+
uses: stoplightio/spectral-action@v0.8.1
22+
with:
23+
file_glob: "openapi.yaml"
24+
25+
- name: "Generate deutschland code"
26+
uses: wirthual/deutschland-generator-action@latest
27+
with:
28+
openapi-file: ${{ github.workspace }}/openapi.yaml
29+
commit-to-git: true
30+
upload-to-pypi: true
31+
upload-to-testpypi: false
32+
pypi-token: ${{ secrets.PYPI_API_TOKEN }}
33+
testpypi-token: ${{ secrets.TEST_PYPI_API_TOKEN }}
34+
python-version: ${{ matrix.python-version }}

.github/workflows/openapi_check.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ jobs:
77
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
88
- uses: actions/checkout@v2
99

10+
# Create default .spectral.yaml file used for linting if its not existing already
11+
- name: "Create spectral file if it not exists"
12+
continue-on-error: true
13+
run: |
14+
set -C; echo "extends: spectral:oas" > .spectral.yaml
15+
1016
# Run Spectral
1117
- uses: stoplightio/spectral-action@v0.8.1
1218
with:

generator_config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
templateDir: deutschland_templates # For local use: ./local/deutschland_templates
2+
additionalProperties:
3+
packageName: "mudab"
4+
infoName: "BundesAPI"
5+
infoEmail: "kontakt@bund.dev"
6+
packageVersion: 0.1.0
7+
packageUrl: "https://github.com/bundesAPI/mudab-api"
8+
namespace: "deutschland"
9+
docLanguage: "de"
10+
gitHost: "github.com"
11+
gitUserId: "bundesAPI"
12+
gitRepoId: "mudab-api"
13+
files:
14+
pyproject.mustache:
15+
destinationFilename: pyproject.toml
16+
templateType: SupportingFiles
17+
requirements.txt: {}
18+
create_doc.mustache:
19+
destinationFilename: create_doc.py
20+
templateType: SupportingFiles
21+
rename_generated_code.mustache:
22+
destinationFilename: rename_generated_code.py
23+
templateType: SupportingFiles
24+
README.mustache:
25+
destinationFilename: README.md
26+
templateType: SupportingFiles

0 commit comments

Comments
 (0)