-
Notifications
You must be signed in to change notification settings - Fork 89
113 lines (109 loc) · 5.33 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
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
# This is a basic workflow to help you get started with Actions
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:
validate_yaml_and_metadata:
runs-on: ubuntu-latest
container: geneontology/dev-base:latest
steps:
- uses: actions/checkout@v2
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
# - name: Set up Ruby
# uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
# with:
# ruby-version: 2.2.10
- name: Install packages
run: apt-get update -qq && apt-get install -y kwalify python3 python3-pip mmv -qq
- name: Install python stuff
run: pip3 install pyyaml typing graphstore/rule-runner linkml==1.7.4
## Users.
- name: Test users schema.
run: |
kwalify -E -f metadata/db-xrefs.schema.yaml metadata/db-xrefs.yaml 2>&1
kwalify -E -f metadata/db-xrefs.schema.yaml metadata/db-xrefs.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
- name: Test users metadata.
run: |
kwalify -E -f metadata/users.schema.yaml metadata/users.yaml 2>&1
kwalify -E -f metadata/users.schema.yaml metadata/users.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
## Groups.
- name: Test groups schema.
run: |
kwalify -E -m metadata/groups.schema.yaml 2>&1
kwalify -E -m metadata/groups.schema.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
- name: Test groups metadata.
run: |
kwalify -E -f metadata/groups.schema.yaml metadata/groups.yaml 2>&1
kwalify -E -f metadata/groups.schema.yaml metadata/groups.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
## DB Xrefs.
- name: Test dbxrefs schema.
run: |
kwalify -E -m metadata/db-xrefs.schema.yaml 2>&1
kwalify -E -m metadata/db-xrefs.schema.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
- name: Test dbxrefs metadata.
run: |
kwalify -E -f metadata/db-xrefs.schema.yaml metadata/db-xrefs.yaml 2>&1
kwalify -E -f metadata/db-xrefs.schema.yaml metadata/db-xrefs.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
## Datasets.
- name: Test datasets schema.
run: |
kwalify -E -m metadata/datasets.schema.yaml 2>&1
kwalify -E -m metadata/datasets.schema.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
- name: Test datasets metadata.
run: |
kwalify -E -f metadata/datasets.schema.yaml metadata/datasets/*.yaml 2>&1
kwalify -E -f metadata/datasets.schema.yaml metadata/datasets/*.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
## Extension constraints.
- name: Test extension constraints schema.
run: |
kwalify -E -m metadata/extensions-constraints.schema.yaml 2>&1
kwalify -E -m metadata/extensions-constraints.schema.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
- name: Test extension constraints metadata.
run: |
kwalify -E -f metadata/extensions-constraints.schema.yaml metadata/extensions-constraints.yaml 2>&1
kwalify -E -f metadata/extensions-constraints.schema.yaml metadata/extensions-constraints.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
## GO reference species set.
- name: Test reference species set schema.
run: |
kwalify -E -m metadata/go-reference-species.schema.yaml 2>&1
kwalify -E -m metadata/go-reference-species.schema.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
- name: Test reference species set metadata.
run: |
kwalify -E -f metadata/go-reference-species.schema.yaml metadata/go-reference-species.yaml 2>&1
kwalify -E -f metadata/go-reference-species.schema.yaml metadata/go-reference-species.yaml 2>&1 | grep 'INVALID\|ERROR' > invalid.log || true
test $(stat -c %s invalid.log) -eq 0
- name: Test GO_REF metadata
run: |
linkml-validate -s metadata/gorefs.schema.yaml metadata/gorefs.yaml
## Cross-test metadata
- name: Cross-test users and groups.
run: python3 ./scripts/sanity-check-users-and-groups.py --verbose --users metadata/users.yaml --groups metadata/groups.yaml
- name: Info
run: which sparta
## SPARTA
- name: SPARTA.
run: sparta valid --rules metadata/rules/ --schema metadata/rules.schema.yaml
## Run GO Rule examples
- name: GO Rule example validation
run: pip3 install -r pipeline/requirements.txt && ./scripts/rule-example-validation.sh