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: # 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/odklite:v1.3.0 steps: - uses: actions/checkout@v2 # Checks-out main branch under "main" directory - uses: actions/checkout@v2 with: ref: master path: master - name: Diff classification run: export ROBOT_JAVA_ARGS=-Xmx6G; robot diff --labels True --left master/src/ontology/aeon-edit.owl --left-catalog master/src/ontology/catalog-v001.xml --right src/ontology/aeon-edit.owl --right-catalog src/ontology/catalog-v001.xml -f markdown -o edit-diff.md - name: Upload diff uses: actions/upload-artifact@v2 with: name: edit-diff.md path: edit-diff.md classify_branch: runs-on: ubuntu-latest container: obolibrary/odklite:v1.3.0 steps: - uses: actions/checkout@v2 - name: Classify ontology run: cd src/ontology; make IMP=FALSE PAT=FALSE MIR=FALSE aeon.owl - name: Upload PR aeon.owl uses: actions/upload-artifact@v2 with: name: aeon-pr.owl path: src/ontology/aeon.owl retention-days: 1 classify_main: runs-on: ubuntu-latest container: obolibrary/odklite:v1.3.0 steps: - uses: actions/checkout@v2 with: ref: master - name: Classify ontology run: cd src/ontology; make IMP=FALSE PAT=FALSE MIR=FALSE aeon.owl - name: Upload master aeon.owl uses: actions/upload-artifact@v2 with: name: aeon-master.owl path: src/ontology/aeon.owl retention-days: 1 diff_classification: needs: - classify_branch - classify_main runs-on: ubuntu-latest container: obolibrary/odklite:v1.3.0 steps: - uses: actions/checkout@v2 - name: Download master classification uses: actions/download-artifact@v2 with: name: aeon-master.owl path: src/ontology/aeon-master.owl - name: Download PR classification uses: actions/download-artifact@v2 with: name: aeon-pr.owl path: src/ontology/aeon-pr.owl - name: Diff classification run: export ROBOT_JAVA_ARGS=-Xmx6G; cd src/ontology; robot diff --labels True --left aeon-master.owl/aeon.owl --left-catalog catalog-v001.xml --right aeon-pr.owl/aeon.owl --right-catalog catalog-v001.xml -f markdown -o classification-diff.md - name: Upload diff uses: actions/upload-artifact@v2 with: name: classification-diff.md path: src/ontology/classification-diff.md post_comment: needs: [diff_classification, edit_file] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Download reasoned diff uses: actions/download-artifact@v2 with: name: classification-diff.md path: classification-diff.md - name: Prepare reasoned comment run: "echo \"
\n Here's a diff of how these changes impact the classified ontology: \n\" >comment.md; cat classification-diff.md/classification-diff.md >>comment.md" - name: Post reasoned comment env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} uses: NejcZdovc/comment-pr@v1.1.1 with: file: "../../comment.md" identifier: "REASONED" - uses: actions/checkout@v2 - name: Download edit diff uses: actions/download-artifact@v2 with: name: edit-diff.md path: edit-diff.md - name: Prepare edit file comment run: "echo \"
\n Here's a diff of your edit file (unreasoned) \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/comment-pr@v1.1.1 with: file: "../../edit-comment.md" identifier: "UNREASONED"