Skip to content

Commit

Permalink
Add github action for checking ontology version
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed Oct 7, 2024
1 parent e77af95 commit 68652bf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/scripts/check_schema_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
ONTOLOGY_VERSION=$(mvn help:evaluate -Dexpression=ontology.version -q -DforceStdout)

# Check for changes and compare versions
if git diff --quiet "main:$(git ls-tree -r --name-only main | grep 'iguana.owx')" 'src/main/resources/iguana.owx'; then
DIFF_STATUS=0
else
DIFF_STATUS=1
fi

if [ $DIFF_STATUS = '1' ] && [ "$PROJECT_VERSION" != "$ONTOLOGY_VERSION" ];
then
echo "Schema has changed, update ontology version to the project version inside the pom!"
exit 1
fi

exit 0
3 changes: 2 additions & 1 deletion .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: .github/scripts/tagcheck.sh v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- run: .github/scripts/tagcheck.sh v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- run: .github/scripts/check_schema_version.sh
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<minor.version>1</minor.version>
<build.version>0</build.version>

<ontology.version>4.1.0</ontology.version>
<ontology.version>4.0.0</ontology.version>

<java.version>17</java.version>
<jena.version>4.2.0</jena.version>
Expand Down

0 comments on commit 68652bf

Please sign in to comment.