-
Notifications
You must be signed in to change notification settings - Fork 11
171 lines (142 loc) · 4.92 KB
/
ci_workflow.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: CI Tests
on:
pull_request:
push:
branches:
- master
- 'push-action/**'
jobs:
tests:
name: External
uses: SINTEF/ci-cd/.github/workflows/[email protected]
with:
# General
install_extras: "[dev,docs]"
# pre-commit
run_pre-commit: true
python_version_pre-commit: "3.9"
skip_pre-commit_hooks: pylint
# pylint
run_pylint: true
python_version_pylint_safety: "3.9"
pylint_options: "--rcfile=pyproject.toml"
pylint_targets: "*.py tools emmopy ontopy"
# safety-specific settings
run_safety: true
# 48547: RDFLib vulnerability: https://pyup.io/vulnerabilities/PVE-2022-48547/48547/
# 44715-44717: NumPy vulnerabilities:
# https://pyup.io/vulnerabilities/CVE-2021-41495/44715/
# https://pyup.io/vulnerabilities/CVE-2021-41496/44716/
# https://pyup.io/vulnerabilities/CVE-2021-34141/44717/
# 70612: Jinja2 vulnerability. Only used as subdependency for mkdocs++ in tripper.
# https://data.safetycli.com/v/70612/97c/
safety_options: |
--ignore=48547
--ignore=44715
--ignore=44716
--ignore=44717
--ignore=70612
# Build distribution
run_build_package: true
python_version_package: "3.9"
build_cmd: "python -m build"
# Build documentation
# Exclude base classes in emmopy.emmocheck
run_build_docs: true
python_version_docs: "3.9"
update_python_api_ref: true
update_docs_landing_page: true
package_dirs: |
emmopy
ontopy
special_file_api_ref_options: "emmopy/emmocheck.py,show_bases: false"
landing_page_replacements: |
(LICENSE.txt),(LICENSE.md)
(tools),(../tools)
pytest:
name: pytest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y graphviz openjdk-11-jre-headless
- name: Install Python dependencies (and EMMOntoPy)
run: |
python -m pip install --upgrade pip
pip install -U setuptools wheel
pip install -U -e .[dev]
- name: Test
run: pytest -vvv --cov=ontopy --cov=emmopy --cov-report=xml --cov-report=term --doctest-modules
- name: Upload coverage to Codecov
if: matrix.python-version == '3.9' && github.repository == 'emmo-repo/EMMOntoPy'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
# - name: Run vertical demo
# run: |
# cd demo/vertical
# python define_ontology.py
# python plot_ontology.py
# cd -
# - name: Run horizontal demo
# run: |
# cd demo/horizontal
# python step1_generate_metadata.py
# python step2_define_metadata.py
# python step3_instantiate.py
# python step4_map_instance.py
# cd -
ontodoc:
name: EMMO documentation (test using ontodoc)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Check Ubuntu version we are running under
run: |
uname -a
sudo apt-get update
- name: Current environment
run: env
- name: Install pandoc 2.1.2
run: |
#sudo apt-get install -y pandoc
wget https://github.com/jgm/pandoc/releases/download/2.1.2/pandoc-2.1.2-1-amd64.deb
sudo apt-get install -y ./pandoc-2.1.2-1-amd64.deb
- name: Install tzdata non-interactively
run: |
sudo ln -fs /usr/share/zoneinfo/Europe/Oslo /etc/localtime
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends tzdata
sudo dpkg-reconfigure --frontend noninteractive tzdata
- name: Install other dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
sudo apt-get update
sudo apt-get install -y graphviz
sudo apt-get install -y texlive-xetex
sudo apt-get install -y texlive-latex-extra
- name: Install EMMOntoPy
run: |
python setup.py install
- name: Create EMMO documentation
run: |
cd examples/emmodoc
python ../../tools/ontodoc -f simple-html emmo-inferred emmo-simple.html
python ../../tools/ontodoc -t emmo.md -p no-self-contained emmo-inferred emmo.html
# pdf generation is commented out as there is a xetex error which
# needs to be resolved if we decide to keep ontodoc as a tool.
# python ../../tools/ontodoc -t emmo.md emmo-inferred emmo.pdf
cd -