-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (85 loc) · 3.62 KB
/
run_tests.yaml
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
name: Lint and Test
on:
workflow_call:
jobs:
run_unit_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Repo checkout
uses: actions/checkout@main
- name: Set up Python 3.12
uses: actions/setup-python@main
with:
python-version: 3.12
- name: Install Poetry
uses: snok/install-poetry@main
- name: Install dependencies
id: install_deps
run: poetry install
- name: poetry run pytest -rP tests/
id: run_pytest
run: |
poetry run pytest --cov=credit_engine --cov-report=xml -rP tests/
continue-on-error: true
- name: Send to Codecov
id: send_to_codecov
uses: codecov/codecov-action@main
continue-on-error: true
with:
files: ./coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: outcome failure
if: steps.run_pytest.outcome != 'success' || steps.send_to_codecov.outcome != 'success'
run: |
echo "Python tests: ${{ steps.run_pytest.outcome }}"
echo "upload coverage: ${{ steps.send_to_codecov.outcome }}"
exit 1
- name: outcome success
run: |
echo "Python tests: ${{ steps.run_pytest.outcome }}"
echo "upload coverage: ${{ steps.send_to_codecov.outcome }}"
exit 0
run_linkml_tasks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Repo checkout
uses: actions/checkout@main
- name: Set up Python 3.12
uses: actions/setup-python@main
with:
python-version: 3.12
- name: Install dependencies
id: install_deps
run: pip install linkml check-jsonschema 'jsonschema[format]'
- name: Lint linkml file
id: lint_linkml
run: |
linkml-lint ./schema/kbase/linkml/credit_metadata.yaml --ignore-warnings
continue-on-error: true
- name: Validate kbase sample data against the schema
id: validate_kbase_data
run: |
linkml-validate -s schema/kbase/linkml/credit_metadata.yaml sample_data/kbase/**/*kbcms.json
continue-on-error: true
- name: Validate kbase sample data against JSONschema
id: validate_kbase_data_against_jsonschema
run: |
check-jsonschema --schemafile schema/kbase/jsonschema/credit_metadata.schema.json --verbose sample_data/kbase/**/*kbcms.json
continue-on-error: true
- name: outcome failure
if: steps.lint_linkml.outcome != 'success' # || steps.validate_kbase_data.outcome != 'success'
run: |
echo "linkml linting: ${{ steps.lint_linkml.outcome }}"
echo "KBase sample data validation: ${{ steps.validate_kbase_data.outcome }}"
exit 1
- name: outcome success
if: steps.lint_linkml.outcome == 'success' # || steps.validate_kbase_data.outcome != 'success'
run: |
echo "linkml linting: ${{ steps.lint_linkml.outcome }}"
echo "KBase sample data validation: ${{ steps.validate_kbase_data.outcome }}"
exit 0