-
Notifications
You must be signed in to change notification settings - Fork 2
129 lines (105 loc) · 3.56 KB
/
ci_tests.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
name: CI - Tests
on:
pull_request:
push:
branches:
- 'master'
- 'push-action/**' # Allow pushing to protected branches (using CasperWA/push-protected)
jobs:
basic-tests:
name: External
uses: SINTEF/ci-cd/.github/workflows/ci_tests.yml@v2.8.3
with:
## General settings:
install_extras: "[dev]"
## pre-commit
run_pre-commit: false
## pylint & safety
python_version_pylint_safety: "3.9"
# pylint-specific settings
run_pylint: true
pylint_runs: |
--rcfile=pyproject.toml tripper
--rcfile=pyproject.toml --disable=import-outside-toplevel,redefined-outer-name tests
# 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/
# https://data.safetycli.com/v/72715/97c/ # update to mkdocs>=9.5.32
safety_options: |
--ignore=48547
--ignore=44715
--ignore=44716
--ignore=44717
--ignore=70612
--ignore=72715
## Build package
run_build_package: true
python_version_package: "3.9"
build_libs: flit
build_cmd: flit build
## Build documentation
run_build_docs: true
python_version_docs: "3.9"
warnings_as_errors: true
use_mkdocs: true
# mkdocs-specific settings
update_python_api_ref: true
update_docs_landing_page: true
package_dirs: tripper
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout tripper
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt install graphviz
python -m pip install -U pip
pip install -U setuptools wheel flit
pip install -e .[testing]
- name: List installed packages
run: pip freeze
- name: Test with pytest
run: pytest -vvv --cov-report=xml --doctest-modules
- name: Upload coverage to Codecov
if: matrix.python-version == '3.9' && github.repository == 'EMMC-ASBL/tripper'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run doctest on tutorial
run: python -m doctest docs/tutorial.md
pytest-no-extra-dependencies: # Test for basic version, without extras installed
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout tripper
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt install graphviz
python -m pip install -U pip
pip install -U setuptools wheel flit
pip install -e .[testing-core]
- name: Test with pytest, but without other extra dependencies
run: pytest -vvv tests/