Skip to content

Commit

Permalink
Add validation and publishing actions
Browse files Browse the repository at this point in the history
  • Loading branch information
KaushikGondaliya authored and cy303 committed Jun 28, 2024
1 parent 975cae8 commit ec511d3
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/build-ontology.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
release:
types: [created]

name: Build ontology

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: prepare single ttl file
run: |
sh validate.sh
sh singleTTL.sh
- name: Publish Asset
uses: softprops/action-gh-release@v1
with:
tag_name: test
files: graphit-ontology.ttl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

16 changes: 16 additions & 0 deletions .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Validate ontology

on: pull_request

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: validate ontology
run: |
./validate.sh
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ language: java
jdk:
- oraclejdk8
install: true # skip
script: find . -type f -name "*.ttl" | xargs java -jar bin/ogit-validator.jar
script: find . -type f ! -name 'graphit-ontology.*' -name "*.ttl" | xargs java -jar bin/ogit-validator.jar

12 changes: 12 additions & 0 deletions singleTTL.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

TTLFILE=graphit-ontology.ttl
rm -f $TTLFILE


find . -type f -name '*.ttl' -exec cat {} \; -exec echo $'\n' \;> TMP_cat_all.txt
grep "@prefix" TMP_cat_all.txt | awk '{$1=$1}!A[toupper($0)]++' > TMP_prefixed.txt
grep -v "@prefix" TMP_cat_all.txt > TMP_no_prefixes.txt
cat TMP_prefixed.txt TMP_no_prefixes.txt > $TTLFILE
rm TMP_prefixed.txt TMP_no_prefixes.txt TMP_cat_all.txt
echo $TTLFILE 'has been generated.'
1 change: 1 addition & 0 deletions validate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find . -type f ! -name 'graphit-ontology.*' -name "*.ttl" | xargs java -jar bin/ogit-validator.jar

0 comments on commit ec511d3

Please sign in to comment.