-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from ucoProject/Feature-CP-39
Implement CI based on rdf-toolkit and 'make check' design pattern
- Loading branch information
Showing
7 changed files
with
210 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This software was developed at the National Institute of Standards | ||
# and Technology by employees of the Federal Government in the course | ||
# of their official duties. Pursuant to title 17 Section 105 of the | ||
# United States Code this software is not subject to copyright | ||
# protection and is in the public domain. NIST assumes no | ||
# responsibility whatsoever for its use by other parties, and makes | ||
# no guarantees, expressed or implied, about its quality, | ||
# reliability, or any other characteristic. | ||
# | ||
# We would appreciate acknowledgement if the software is used. | ||
|
||
# This workflow uses Make to confirm ontology files have been | ||
# normalized. | ||
|
||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ master, develop ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Start from clean state | ||
run: make clean | ||
- name: Run tests | ||
run: make check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.jar | ||
.*.ttl | ||
.lib.done.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/make -f | ||
|
||
# This software was developed at the National Institute of Standards | ||
# and Technology by employees of the Federal Government in the course | ||
# of their official duties. Pursuant to title 17 Section 105 of the | ||
# United States Code this software is not subject to copyright | ||
# protection and is in the public domain. NIST assumes no | ||
# responsibility whatsoever for its use by other parties, and makes | ||
# no guarantees, expressed or implied, about its quality, | ||
# reliability, or any other characteristic. | ||
# | ||
# We would appreciate acknowledgement if the software is used. | ||
|
||
SHELL := /bin/bash | ||
|
||
turtle_directories := $(wildcard uco-*) | ||
|
||
all_directories := $(foreach turtle_directory,$(turtle_directories),all-$(turtle_directory)) | ||
|
||
check_directories := $(foreach turtle_directory,$(turtle_directories),check-$(turtle_directory)) | ||
|
||
clean_directories := $(foreach turtle_directory,$(turtle_directories),clean-$(turtle_directory)) | ||
|
||
all: \ | ||
$(all_directories) | ||
|
||
all-%: \ | ||
% \ | ||
.lib.done.log | ||
$(MAKE) \ | ||
--directory $< \ | ||
--file $$PWD/src/review.mk | ||
|
||
.lib.done.log: | ||
$(MAKE) \ | ||
--directory lib | ||
touch $@ | ||
|
||
check: \ | ||
$(check_directories) | ||
|
||
check-%: \ | ||
% \ | ||
.lib.done.log | ||
$(MAKE) \ | ||
--directory $< \ | ||
--file $$PWD/src/review.mk \ | ||
check | ||
|
||
clean: \ | ||
$(clean_directories) | ||
@rm -f .lib.done.log | ||
|
||
clean-%: \ | ||
% | ||
@$(MAKE) \ | ||
--directory $< \ | ||
--file $$PWD/src/review.mk \ | ||
clean |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/make -f | ||
|
||
# This software was developed at the National Institute of Standards | ||
# and Technology by employees of the Federal Government in the course | ||
# of their official duties. Pursuant to title 17 Section 105 of the | ||
# United States Code this software is not subject to copyright | ||
# protection and is in the public domain. NIST assumes no | ||
# responsibility whatsoever for its use by other parties, and makes | ||
# no guarantees, expressed or implied, about its quality, | ||
# reliability, or any other characteristic. | ||
# | ||
# We would appreciate acknowledgement if the software is used. | ||
|
||
SHELL := /bin/bash | ||
|
||
all: \ | ||
rdf-toolkit.jar | ||
|
||
# Downloading rdf-toolkit was previously done following the directions | ||
# at: | ||
# https://github.com/edmcouncil/rdf-toolkit | ||
# However, on the file becoming temporarily unavailable, CASE has placed | ||
# a verified copy at a custom location, as a fallback for an alternative | ||
# retrieval from an EDM Council member's repository. | ||
# The checksum of the original file from EDM Council's build server is | ||
# confirmed before moving file into position. (This practice will | ||
# probably require frequent updates, unless a signed checksum for the | ||
# jar can be retrieved somehow.) | ||
# In case there are concerns on potentially multiple writes to the same | ||
# file, the documentation for wget's "--output-document file" flag notes | ||
# that "... file will be truncated immediately, and all downloaded | ||
# content will be written there." | ||
rdf-toolkit.jar: | ||
test -r rdf-toolkit.jar.sha512 | ||
# Try retrieval from Github, then from files.caseontology.org. | ||
wget \ | ||
--output-document $@_ \ | ||
https://github.com/trypuz/openfibo/blob/1f9ab415e8ebd131eadcc9b0fc46241adeeb0384/etc/serialization/rdf-toolkit.jar?raw=true \ | ||
|| wget \ | ||
--output-document $@_ \ | ||
http://files.caseontology.org/rdf-toolkit.jar | ||
test \ | ||
"x$$(openssl dgst -sha512 $@_ | awk '{print($$NF)}')" \ | ||
== \ | ||
"x$$(head -n1 rdf-toolkit.jar.sha512)" | ||
mv $@_ $@ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
24890b4aa484a46803841fbe5938daf60bf2d0889c0e231102c033d71cb84a2bfa8b44419df3ad896d833609afddd4b3910d2ce28660b3350cca22bea0770dad |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/make -f | ||
|
||
# This software was developed at the National Institute of Standards | ||
# and Technology by employees of the Federal Government in the course | ||
# of their official duties. Pursuant to title 17 Section 105 of the | ||
# United States Code this software is not subject to copyright | ||
# protection and is in the public domain. NIST assumes no | ||
# responsibility whatsoever for its use by other parties, and makes | ||
# no guarantees, expressed or implied, about its quality, | ||
# reliability, or any other characteristic. | ||
# | ||
# We would appreciate acknowledgement if the software is used. | ||
|
||
SHELL := /bin/bash | ||
|
||
# This Makefile is assumed to execute in a repository directory /uco-*. | ||
top_srcdir := $(shell cd .. ; pwd) | ||
|
||
srcdir := $(shell pwd) | ||
|
||
# Determine the basenames of the ontology turtle files. | ||
# Note plurality - this also identifies domain assertion files ("*-da.ttl"). | ||
# This computation is done to avoid catching temporary render files (".check-*.ttl") | ||
srcdir_without_ucohyphen := $(subst uco-,,$(shell basename "$(srcdir)")) | ||
ifeq ($(srcdir_without_ucohyphen),master) | ||
ttl_basenames := uco.ttl | ||
else | ||
ttl_basenames := $(wildcard $(srcdir_without_ucohyphen)*.ttl) | ||
endif | ||
|
||
# These are reference files, named with a leading dot. | ||
check_reference_basenames := $(foreach ttl_basename,$(ttl_basenames),.check-$(ttl_basename)) | ||
|
||
# These are recipe targets, not intended to be created files. | ||
check_targets := $(foreach ttl_basename,$(ttl_basenames),check-$(ttl_basename)) | ||
|
||
all: \ | ||
$(check_reference_basenames) | ||
|
||
.check-%.ttl: \ | ||
%.ttl \ | ||
$(top_srcdir)/.lib.done.log | ||
java -jar $(top_srcdir)/lib/rdf-toolkit.jar \ | ||
--infer-base-iri \ | ||
--inline-blank-nodes \ | ||
--source $< \ | ||
--source-format turtle \ | ||
--target $@_ \ | ||
--target-format turtle | ||
mv $@_ $@ | ||
|
||
check: \ | ||
$(check_targets) | ||
|
||
# Reminder: diff exits non-0 on finding any differences. | ||
# Reminder: The $^ automatic Make variable is the name of all recipe prerequisites. | ||
check-%.ttl: \ | ||
%.ttl \ | ||
.check-%.ttl | ||
diff $^ | ||
|
||
clean: | ||
@rm -f $(check_reference_basenames) |
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