closes #4611; closes #4610; closes #4608; closes #4604; closes #4599;… #162
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: 'Create ROBOT diffs on Pull requests' | |
on: | |
# Triggers the workflow on pull request events for the master branch | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
create_diff_file: | |
runs-on: ubuntu-latest | |
container: obolibrary/odklite:v1.4 | |
steps: | |
# Checks-out the branch being merged into master in the root directory | |
# The ontology obo file path will be: src/ontology/fypo-edit.owl | |
- uses: actions/checkout@v2 | |
# Checks-out the master branch in a subfolder called master | |
# The ontology obo file path will be: master/src/ontology/fypo-edit.owl | |
- uses: actions/checkout@v2 | |
with: | |
ref: master | |
path: master | |
- name: Run robot diff | |
# -Xmx6G extension is to set 6gb of memory for java virtual machine | |
# The second line produces the difference in the edit files only | |
# The third line produces the difference after reasoner. I still have to figure what the best file for this is. | |
# robot diff --labels True --left master/fypo.owl --right fypo.owl -f markdown -o reasoned-diff.md; | |
# To edit the second and third line for another ontology, test the robot code locally, and edit accordingly. | |
# For example, FYPO does not need an extra --right-catalog but other ontologies may need it | |
# See https://github.com/obophenotype/cell-ontology/blob/master/.github/workflows/diff.yml | |
run: > | |
export ROBOT_JAVA_ARGS=-Xmx6G; | |
robot diff --labels True --left master/src/ontology/fypo-edit.owl --right src/ontology/fypo-edit.owl -f markdown -o edit-diff.md; | |
robot --catalog src/ontology/catalog-v001.xml report -i src/ontology/fypo-edit.owl -l true --fail-on None --base-iri http://purl.obolibrary.org/obo/FYPO_ --base-iri http://purl.obolibrary.org/obo/fypo --print 5 -o errors.tsv; | |
- name: Format comment | |
# Create a comment where the diffs can be folded, so it does not take so much space | |
# add this eventually: cat reasoned-diff.md >> comment.md; | |
run: > | |
printf "# Changes added to the edit file this PR\n" > comment.md; | |
printf "<details>\n<summary>Click to expand</summary>\n\n" >> comment.md; | |
cat edit-diff.md >> comment.md; | |
printf "\n</details\n\n>" >> comment.md; | |
printf "# Changes to ontology after reasoner runs\n" >> comment.md; | |
printf "<details>\n<summary>Click to expand</summary>\n\n" >> comment.md; | |
printf "\nComing soon\n>" >> comment.md; | |
printf "\n</details>\n\n" >> comment.md; | |
printf "# Errors reported\n\n" >> comment.md; | |
printf "\`\`\`\n" >> comment.md; | |
cat errors.tsv >> comment.md; | |
printf "\n\`\`\`\n" >> comment.md; | |
- name: Post comment in the PR | |
# Note how the path to comment.md needs ../../ in the path. | |
# Because we provide an identifier, the comment will be overwritten every time the action | |
# is run. I guess one could have an identifier that contains the commit_id so that a new | |
# comment is posted every time a change is made in the branch that is being merged. | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
uses: NejcZdovc/[email protected] | |
with: | |
file: "../../comment.md" | |
identifier: "DIFF_COMMENT" |