-
-
Notifications
You must be signed in to change notification settings - Fork 70
109 lines (99 loc) · 4.18 KB
/
Copy pathtests.yml
File metadata and controls
109 lines (99 loc) · 4.18 KB
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
# This file configures the continuous integration (CI) system on GitHub.
# Introductory materials can be found here: https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions.
# Documentation for editing this file can be found here: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: Tests
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
name: Code Quality
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.14", "3.10"]
tox-command: ["lint", "pyroma", "mypy"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Install uv"
uses: "astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57" # v8.0.0
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: "Run command"
run: |
uvx -p ${{ matrix.python-version }} --with tox-uv tox -e ${{ matrix.tox-command }}
# Inspired by https://github.com/astral-sh/uv/blob/98523e2014e9a5c69706623344026d76296e178f/.github/workflows/ci.yml#L67C1-L70C61
- name: "Prettier"
run: |
npx prettier --prose-wrap always --check "**/*.md"
docs:
name: Documentation
runs-on: ubuntu-latest
strategy:
matrix:
# We only test documentation on the latest version
# sphinx 8.0 / sphinx-rtd-theme 3.0 discontinued Python 3.9 support
# a year early, which prompted re-thinking about this.
python-version: ["3.14"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Install uv"
uses: "astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57" # v8.0.0
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install dependencies
run: |
sudo apt-get install graphviz
- name: Check RST conformity with doc8
run: uvx -p ${{ matrix.python-version }} --with tox-uv tox -e doc8
- name: Check docstring coverage
run: uvx -p ${{ matrix.python-version }} --with tox-uv tox -e docstr-coverage
- name: Check documentation build with Sphinx
run: uvx -p ${{ matrix.python-version }} --with tox-uv tox -e docs-test
tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.14", "3.10"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Install uv"
uses: "astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57" # v8.0.0
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
if: matrix.os == 'ubuntu-latest'
- name: Start blazegraph and virtuoso triplestores with docker
if: matrix.os == 'ubuntu-latest'
run: |
docker compose up -d
sleep 20
docker compose exec virtuoso isql -U dba -P dba exec='GRANT "SPARQL_SELECT_FED" TO "SPARQL";'
- name: Test with pytest and generate coverage file
run: uvx -p ${{ matrix.python-version }} --with tox-uv tox -e py
env:
BIOPORTAL_API_KEY: ${{ secrets.BIOPORTAL_API_KEY }}
ECOPORTAL_API_KEY: ${{ secrets.ECOPORTAL_API_KEY }}
AGROPORTAL_API_KEY: ${{ secrets.AGROPORTAL_API_KEY }}
BIODIVPORTAL_API_KEY: ${{ secrets.BIODIVPORTAL_API_KEY }}
- name: Run doctests
run: uvx -p ${{ matrix.python-version }} --with tox-uv tox -e doctests
env:
BIOPORTAL_API_KEY: ${{ secrets.BIOPORTAL_API_KEY }}
ECOPORTAL_API_KEY: ${{ secrets.ECOPORTAL_API_KEY }}
AGROPORTAL_API_KEY: ${{ secrets.AGROPORTAL_API_KEY }}
BIODIVPORTAL_API_KEY: ${{ secrets.BIODIVPORTAL_API_KEY }}
- name: Upload coverage report to codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
if: success()
with:
file: coverage.xml