updated xml files #49
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 conventions and glossary | |
on: | |
push: | |
branches: | |
- "**" | |
paths: | |
# - "implementation/demo_ontology/xmi_conceptual_model/demo_ontology_CM.xml" | |
# - "implementation/demo_ontology_module/xmi_conceptual_model/demo_ontology_module_CM.xml" | |
- "implementation/core_person/xmi_conceptual_model/core_person_CM.xml" | |
- "implementation/core_location/xmi_conceptual_model/core_location_CM.xml" | |
- "implementation/core_public_organisation/xmi_conceptual_model/core_public_organisation_CM.xml" | |
jobs: | |
report_and_glossary: | |
runs-on: ubuntu-latest | |
env: | |
OUTPUT_GLOSSARY_PATH: glossary/ | |
steps: | |
- uses: actions/checkout@master | |
with: | |
ref: ${{ github.ref }} | |
- name: get model2owl | |
run: | | |
git clone https://github.com/OP-TED/model2owl.git | |
pwd | |
- name: get-saxon | |
run: pwd && cd model2owl && make get-saxon | |
- name: generate convention report and glossary | |
run: | | |
AVAILABLE_IMPLEMENTATIONS=(core_person core_location core_public_organisation) | |
for implementation in "${AVAILABLE_IMPLEMENTATIONS[@]}" | |
do | |
echo "-------------------${implementation}---------------------------------" | |
sed -i "s/test\/ePO-default-config/..\/implementation\/${implementation}\/model2owl-config/g" model2owl/config-proxy.xsl | |
cat model2owl/config-proxy.xsl | |
CM_FILE_NAME=$(echo "${implementation}_CM.xml") | |
CM_FILE_PATH=$(echo "implementation/$implementation/xmi_conceptual_model/${CM_FILE_NAME}") | |
OUTPUT_CONVENTION_REPORT_PATH=$(echo "implementation/$implementation/conventions_report/") | |
OUTPUT_GLOSSARY_FILE_NAME=$(echo "${implementation}_glossary.html") | |
ls -la implementation/$implementation/xmi_conceptual_model/ | |
echo "CM_FILE_PATH is $CM_FILE_PATH" | |
echo "OUTPUT_REPORT_PATH is $OUTPUT_CONVENTION_REPORT_PATH" | |
echo "OUTPUT_GLOSSARY_FILE_NAME is $OUTPUT_GLOSSARY_FILE_NAME" | |
mkdir -p $OUTPUT_CONVENTION_REPORT_PATH | |
rm -f $OUTPUT_CONVENTION_REPORT_PATH*.html || true | |
ls -la | |
cd model2owl | |
ls -la | |
make generate-convention-report XMI_INPUT_FILE_PATH=../$CM_FILE_PATH OUTPUT_CONVENTION_REPORT_PATH=../$OUTPUT_CONVENTION_REPORT_PATH | |
make generate-glossary XMI_INPUT_FILE_PATH=../$CM_FILE_PATH OUTPUT_GLOSSARY_PATH=../$OUTPUT_GLOSSARY_PATH | |
sed -i "s/..\/implementation\/${implementation}\/model2owl-config/test\/ePO-default-config/g" config-proxy.xsl | |
cd .. | |
done | |
shell: bash | |
- name: merge implementations xmi files into one | |
run: | | |
AVAILABLE_IMPLEMENTATIONS=(core_person core_location core_public_organisation) | |
cd model2owl | |
mkdir -p merge-xmis | |
for implementation in "${AVAILABLE_IMPLEMENTATIONS[@]}" | |
do | |
cp ../implementation/$implementation/xmi_conceptual_model/*_CM.xml merge-xmis | |
done | |
ls merge-xmis | |
make merge-xmi FIRST_XMI_TO_BE_MERGED_FILE_PATH=merge-xmis/core_person_CM.xml | |
echo "merged XMI file" | |
ls output/combined-xmi | |
shell: bash | |
- name: generate combined glossary from the merged xmi | |
run: | | |
cd model2owl | |
make generate-glossary XMI_INPUT_FILE_PATH=output/combined-xmi/ontologies-combined.xmi OUTPUT_GLOSSARY_PATH=../$OUTPUT_GLOSSARY_PATH | |
- name: remove unnecessary files | |
run: | | |
sudo rm -rf model2owl | |
shell: bash | |
- name: commit files | |
id: commit | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions" | |
git pull | |
git status | |
git add . | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "::set-output name=push::false" | |
else | |
git commit -m "Adding convention report and glossary files" | |
echo "::set-output name=push::true" | |
fi | |
shell: bash | |
- name: Push changes | |
if: steps.commit.outputs.push == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |