Skip to content

action conventions and glossary testing 5 #5

action conventions and glossary testing 5

action conventions and glossary testing 5 #5

name: generate conventions and glossary
on:
push:
branches:
- "**"
paths:
- "implementation/demo_ontology/xmi_conceptual_model/demo_ontology_CM.xml"
jobs:
transform:
runs-on: ubuntu-latest
env:
OUTPUT_GLOSSARY_PATH: glossary/
MODEL2OWL_FOLDER: model2owl/
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: get model2owl
run: |
git clone --branch 2.0.0 https://github.com/OP-TED/model2owl.git
pwd
ls -la
# cp ./model2owl/Makefile /home/runner/work/ePO/ePO/
- name: get-saxon
run: pwd && cd model2owl && make get-saxon
- name: transform step
run: |
AVAILABLE_IMPLEMENTATIONS=(demo_ontology)
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_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
cd model2owl
make generate-convention-report
make generate-glossary
sed -i "s/..\/..\/implementation\/${implementation}\/model2owl-config/test\/ePO-default-config/g" model2owl/config-proxy.xsl
done
shell: bash
# - name: merge implementations xmi files into one
# run: |
# AVAILABLE_IMPLEMENTATIONS=(eOrdering eNotice eCatalogue eFulfilment eContract ePO)
# for implementation in "${AVAILABLE_IMPLEMENTATIONS[@]}"
# do
# cp implementation/$implementation/xmi_conceptual_model/*_CM.xml transform/merge-xmis
# done
# ls transform/merge-xmis
# make merge-xmi COMBINED_XMI_DIRECTORY=transform/merged-xmis-result SAXON=transform/saxon-he-10.6.jar FIRST_INPUT_XMI_FILE=/home/runner/work/ePO/ePO/transform/merge-xmis/ePO_CM.xml MODEL2OWL_DIR=transform/model2owl
# echo "merged XMI file"
# ls transform/merged-xmis-result
# shell: bash
#
# - name: change config to core
# run: |
# sed -i "s/test\/ePO-default-config/..\/..\/implementation\/ePO\/model2owl-config/g" transform/model2owl/config-proxy.xsl
# cat transform/model2owl/config-proxy.xsl
#
# - name: generate combined glossary from the merged xmi
# run: |
# make generate-glossary OUTPUT_GLOSSARY_PATH=${OUTPUT_GLOSSARY_PATH} UML_INPUT_FILENAME=./transform/merged-xmis-result/ePO-combined.xmi SAXON=transform/saxon-he-10.6.jar MODEL2OWL_DIR=transform/model2owl
- 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 status
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "::set-output name=push::false"
else
git commit -m "Adding transformation 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 }}