-
Notifications
You must be signed in to change notification settings - Fork 29
119 lines (113 loc) · 5.18 KB
/
diff.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: 'Create ROBOT diffs on Pull requests'
on:
issue_comment:
types: [created]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
diff-reports:
if: ${{ github.event.issue.pull_request }}
runs-on: macos-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: khan/pull-request-comment-trigger@v1.1.0
id: check
with:
trigger: '#gogoeditdiff'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: better0fdead/actions-setup-docker@better0fdead/increase-timeout
if: steps.check.outputs.triggered == 'true'
- run: |
set -x
docker version
if: steps.check.outputs.triggered == 'true'
- name: Install ODK
run: docker pull obolibrary/odklite
if: steps.check.outputs.triggered == 'true'
# Checks-out current branch
- uses: xt0rted/pull-request-comment-branch@v2.0.0
id: comment-branch
- uses: actions/checkout@v3
if: steps.check.outputs.triggered == 'true'
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
# Checks-out master branch under "master" directory
- uses: actions/checkout@v3
if: steps.check.outputs.triggered == 'true'
with:
ref: master
path: master
- name: Diff classification
if: steps.check.outputs.triggered == 'true'
run: |
cd src/ontology
docker run -v $PWD/../../:/work -w /work/src/ontology -e ROBOT_JAVA_ARGS='-Xmx9G' -e JAVA_OPTS='-Xmx9G' --rm obolibrary/odklite robot diff --left ../../master/src/ontology/uberon-edit.obo --left-catalog ../../master/src/ontology/catalog-v001.xml --right uberon-edit.obo --right-catalog catalog-v001.xml -f markdown -o edit-diff.md
- name: Upload diff
if: steps.check.outputs.triggered == 'true'
uses: actions/upload-artifact@v3
with:
name: edit-diff.md
path: src/ontology/edit-diff.md
- name: Make step for branch
if: steps.check.outputs.triggered == 'true'
run: cd src/ontology && mkdir -p tmp reports mirror && docker run -v $PWD/../../:/work -w /work/src/ontology -e ROBOT_JAVA_ARGS='-Xmx9G' -e JAVA_OPTS='-Xmx9G' --rm obolibrary/odklite make BRI=false MIR=false PAT=false IMP=false uberon-simple.owl > TESTLOG.log
- name: Make step for master
if: steps.check.outputs.triggered == 'true'
run: cd master/src/ontology && mkdir -p tmp reports mirror && docker run -v $PWD/../../:/work -w /work/src/ontology -e ROBOT_JAVA_ARGS='-Xmx9G' -e JAVA_OPTS='-Xmx9G' --rm obolibrary/odklite make BRI=false MIR=false PAT=false IMP=false uberon-simple.owl > TESTLOG.log
- name: Diff report
if: steps.check.outputs.triggered == 'true'
run: |
cd src/ontology
docker run -v $PWD/../../:/work -w /work/src/ontology -e ROBOT_JAVA_ARGS='-Xmx9G' -e JAVA_OPTS='-Xmx9G' --rm obolibrary/odklite robot diff --left ../../master/src/ontology/uberon-simple.owl --left-catalog catalog-v001.xml --right uberon-simple.owl --right-catalog ../../master/src/ontology/catalog-v001.xml -f markdown -o simple-report.md
- name: Upload diff
if: steps.check.outputs.triggered == 'true'
uses: actions/upload-artifact@v3
with:
name: simple-report.md
path: src/ontology/simple-report.md
post_comment:
needs: [diff-reports]
runs-on: ubuntu-latest
steps:
- uses: khan/pull-request-comment-trigger@v1.1.0
id: check
with:
trigger: '#gogoeditdiff'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: actions/checkout@v3
if: steps.check.outputs.triggered == 'true'
- name: Download reasoned diff
if: steps.check.outputs.triggered == 'true'
uses: actions/download-artifact@v3
with:
name: simple-report.md
- name: Prepare reasoned comment
run: "echo \"<details>\n <summary> Here's a diff of how these changes impact the classified ontology (on -simple file): </summary> \n\" > comment.md; cat simple-report.md >> comment.md"
if: steps.check.outputs.triggered == 'true'
- name: Post reasoned comment
if: steps.check.outputs.triggered == 'true'
uses: NejcZdovc/comment-pr@v2.0.0
with:
file: "../../comment.md"
identifier: "REASONED"
github_token: ${{secrets.GITHUB_TOKEN}}
- uses: actions/checkout@v3
if: steps.check.outputs.triggered == 'true'
- name: Download edit diff
if: steps.check.outputs.triggered == 'true'
uses: actions/download-artifact@v2
with:
name: 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-comment.md"
if: steps.check.outputs.triggered == 'true'
- name: Post comment
if: steps.check.outputs.triggered == 'true'
uses: NejcZdovc/comment-pr@v2.0.0
with:
file: "../../edit-comment.md"
identifier: "UNREASONED"
github_token: ${{secrets.GITHUB_TOKEN}}