Skip to content

Documenting differences in ontology files (attempt 2) #1

Documenting differences in ontology files (attempt 2)

Documenting differences in ontology files (attempt 2) #1

Workflow file for this run

name: 'Create OAK 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:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
edit_file:
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5
steps:
# Checks-out main branch under "main" directory
- uses: actions/checkout@v4
with:
ref: master
path: master
# - name: Install oaklib
# run: pip install oaklib
# - name: Diff classification
# run: |
# export ROBOT_JAVA_ARGS=-Xmx6G
# runoak -i simpleobo:tmp/hp-edit-master.obo diff -X simpleobo:tmp/hp-edit-pr.obo -o reports/difference_main-branch_base.md --output-type md
# - name: Upload diff
# uses: actions/upload-artifact@v4
# with:
# name: difference_main-branch_base.md
# path: src/ontology/reports/difference_main-branch_base.md
classify_branch:
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5
steps:
- uses: actions/checkout@v4
- name: Classify ontology
run: |
cd src/ontology; make IMP=FALSE PAT=FALSE MIR=FALSE hp-edit.owl && make tmp/hp-edit.obo
- name: Upload PR hp-edit.obo
uses: actions/upload-artifact@v4
with:
name: hp-edit-pr.obo
path: src/ontology/tmp/hp-edit.obo
retention-days: 1
classify_main:
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5
steps:
- uses: actions/checkout@v3
with:
ref: master
- name: Classify ontology
run: cd src/ontology; make IMP=FALSE PAT=FALSE MIR=FALSE hp-edit.owl && make tmp/hp-edit.obo
- name: Upload master hp-edit.obo
uses: actions/upload-artifact@v4
with:
name: hp-edit-master.obo
path: src/ontology/tmp/hp-edit.obo
retention-days: 1
diff_classification:
needs:
- classify_branch
- classify_main
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5
steps:
- uses: actions/checkout@v4
- name: Download master classification
uses: actions/download-artifact@v4
with:
name: hp-edit-master.obo
path: src/ontology/tmp/hp-edit-master.obo
- name: Download PR classification
uses: actions/download-artifact@v4
with:
name: hp-edit-pr.obo
path: src/ontology/tmp/hp-edit-pr.obo
- name: Diff classification
run: |
export ROBOT_JAVA_ARGS=-Xmx6G; cd src/ontology;
runoak -i simpleobo:tmp/hp-edit-master.obo diff -X simpleobo:tmp/hp-edit-pr.obo -o reports/difference_main-branch_base.md --output-type md
- name: Upload diff
uses: actions/upload-artifact@v4
with:
name: difference_main-branch_base.md
path: src/ontology/reports/difference_main-branch_base.md
post_comment:
needs: [diff_classification, edit_file]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download reasoned diff
uses: actions/download-artifact@v4
with:
name: difference_main-branch_base.md
path: src/ontology/reports/difference_main-branch_base.md
- name: Prepare reasoned comment
run: "echo \"<details>\n <summary> Here's a diff of how these changes impact the classified ontology: </summary> \n\" >comment.md; cat difference_main-branch_base.md/difference_main-branch_base.md >>comment.md"
- name: Post reasoned comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: NejcZdovc/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
file: "../../comment.md"
identifier: "REASONED"
- uses: actions/checkout@v4
- name: Download edit diff
uses: actions/download-artifact@v4
with:
name: edit-diff.md
path: edit-diff.md
- name: Prepare edit file comment
run: "echo \"<details>\n <summary> Here's a diff of your edit file (unreasoned) </summary> \n\" >edit-comment.md; cat edit-diff.md/edit-diff.md >>edit-comment.md"
- name: Post comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: NejcZdovc/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
file: "../../edit-comment.md"
identifier: "UNREASONED"