Feature/Automatisation de la génération de nouveaux schémas #22
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: Generate schemas and relevant generator config files and java classes | |
on: | |
workflow_dispatch: {} | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
generate-schemas: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install python requirements | |
working-directory: ./csv_parser | |
run: pip install -r ./requirements.txt | |
- name: Run csv_parser to generate schemas.yaml | |
working-directory: ./csv_parser | |
run: python workflow.py --stage output_schemas_yaml | |
- name: Collect schemas.yaml and copy it to automatic-schema-generator | |
run: | | |
cp ./csv_parser/out/schemas.yaml ./automatic-schema-generator/schemas.yaml | |
- name: Setup gomplate | |
uses: jason-dour/[email protected] | |
with: | |
gomplate-version: v4.2.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: gomplate --version | |
- name: Run automatic-schema-generator and move generated files to corresponding locations | |
working-directory: ./automatic-schema-generator | |
run: | | |
rm -r output || true | |
chmod +x ./automatic-generator.sh | |
./automatic-generator.sh | |
cp -r output/generator .. | |
cp -r output/edxl ../src/main/java/com/hubsante/model | |
cp -r output/json-schema ../src/main/resources | |
cp -r output/xsd ../src/main/resources | |
- name: Commit and push changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: ⚙️ Auto-génération des schemas et fichiers de configuration | |