-
Notifications
You must be signed in to change notification settings - Fork 50
63 lines (53 loc) · 2.21 KB
/
qc.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
# Basic ODK workflow
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
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:
# This workflow contains a single job called "ontology_qc"
ontology_qc:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5.3
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Run ontology QC checks
id: check
continue-on-error: true
env:
DEFAULT_BRANCH: master
run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false MIR=false
- name: Reason over taxon constraints
id: explaintc
continue-on-error: true
if: steps.check.outcome == 'failure'
run: |
if [ -s src/ontology/reports/taxon-constraint-check.txt ]; then
robot explain -i src/ontology/tmp/cl-plus-taxon-disjoints.ofn -M unsatisfiability -u all -r ELK -e taxon-unsats.md
echo "<details>\n<summary>This PR violates some taxon constraints. Here is what the reasoner has to say:</summary>\n" > comments.md
cat taxon-unsats.md >> comment.md
echo "</details>" >> comment.md
exit 1
fi
- name: Post explanation for taxon constraint violations
if: steps.explaintc.outcome == 'failure'
uses: NejcZdovc/comment-pr@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
file: "../../comment.md"
identifier: "TAXON_CONSTRAINTS_REASONING"
# If the check failed, then the entire job should fail, even if we
# allowed it to continue so that we could post the message with
# the explanations.
- name: Fail on error
if: steps.check.outcome == 'failure'
run: exit 1