Skip to content

Commit

Permalink
Merge pull request #80 from djarecka/autogen_testing_branch
Browse files Browse the repository at this point in the history
updates to the automatic generation GA workflows
  • Loading branch information
djarecka authored Nov 5, 2024
2 parents c30dd97 + 6570f47 commit a4c4ad9
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 7,521 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate_other_formats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
cd linkml-schema
for file in *.yaml; do
if [ "$file" != "bican_biolink.yaml" ]; then
if [[ "$file" != *bican* && "$file" != *core* ]];; then
name=`basename ${file} .yaml`;
echo "Processing $name file..";
gen-json-schema ${file} > ../json-schema-autogen/${name}.json;
Expand Down
43 changes: 32 additions & 11 deletions .github/workflows/test_other_formats.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
pull_request:

permissions:
contents: write

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -25,25 +28,43 @@ jobs:
- name: Other installations
run: |
sudo apt-get update
sudo apt-get install -y build-essential git wget curl
sudo apt-get install -y build-essential git wget curl colordiff
- name: Generate other model representations
run: |
cd linkml-schema
mkdir tests_artifacts
mkdir tests_artifacts/json-schema-autogen
mkdir tests_artifacts/jsonld-context-autogen
mkdir tests_artifacts/models_py-autogen
mkdir tests_artifacts/erdiagram-autogen
for file in *.yaml; do
if [ "$file" != "bican_biolink.yaml" ]; then
if [[ "$file" != *bican* && "$file" != *core* ]]; then
name=`basename ${file} .yaml`;
echo "Processing $name file..";
# generating json schema
gen-json-schema ${file};
# generating jsonld context
gen-jsonld-context ${file};
# generating pydantic schema
gen-pydantic ${file};
if [ ${name} != "library_generation" ] && [ ${name} != "genome_annotation" ]; then
gen-erdiagram ${file};
gen-json-schema ${file} > tests_artifacts/json-schema-autogen/${name}.json;
echo "Diff in json schema for $name file (comparing to the current version)"
colordiff ../json-schema-autogen/${name}.json tests_artifacts/json-schema-autogen/${name}.json || true
# generating jsonld context and removing generation_date field to avoid constant updates
gen-jsonld-context ${file} > tests_artifacts/jsonld-context-autogen/${name}.context.jsonld;
sed -i "/generation_date/d" tests_artifacts/jsonld-context-autogen/${name}.context.jsonld;
echo "Diff in jsonld context for $name file (comparing to the current version)"
colordiff ../jsonld-context-autogen/${name}.context.jsonld tests_artifacts/jsonld-context-autogen/${name}.context.jsonld || true
gen-pydantic ${file} > tests_artifacts/models_py-autogen/${name}.py;
echo "Diff in pydantic model for $name file (comparing to the current version)"
colordiff ../models_py-autogen/${name}.py tests_artifacts/models_py-autogen/${name}.py || true
if [ ${name} = "library_generation" ] || [ ${name} = "genome_annotation" ]; then
echo "Creating and Fixing diagrams for $name";
python ../utils/fix_and_create_erdiagram.py
else
gen-erdiagram ${file} > tests_artifacts/erdiagram-autogen/${name}.md;
fi
fi
done
cd ..
ls -l tests_artifacts/json-schema-autogen
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: artifacts
path: linkml-schema/tests_artifacts/*
20 changes: 0 additions & 20 deletions erdiagram-autogen/anatomical_structure_core.md

This file was deleted.

262 changes: 0 additions & 262 deletions erdiagram-autogen/bican_core.md

This file was deleted.

15 changes: 0 additions & 15 deletions erdiagram-autogen/bican_prov.md

This file was deleted.

9 changes: 0 additions & 9 deletions json-schema-autogen/anatomical_structure_core.json

This file was deleted.

Loading

0 comments on commit a4c4ad9

Please sign in to comment.