-
-
Notifications
You must be signed in to change notification settings - Fork 2
114 lines (111 loc) · 3.27 KB
/
test.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
name: Tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
DO_NOT_TRACK: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
UV_SYSTEM_PYTHON: 1
jobs:
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests (Rust)
run: cargo test --verbose
python:
runs-on: ubuntu-latest
needs: rust
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.venv/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-python-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v4
- name: Set up Maturin
run: |
uv venv
uv pip install maturin
maturin develop --uv --extras dev,docs,gradio
- if: matrix.python-version != '3.8'
name: Lint with Mypy
run: mypy .
- name: Lint with Ruff
run: ruff check
- name: Run tests
run: pytest --cov
- if: matrix.python-version == '3.13'
name: Upload to Codecov
uses: codecov/codecov-action@v5.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run Module
run: |
python3 -m evalica.gradio --version
python3 -m evalica --input=food.csv counting
- name: Run CLI
run: evalica --input=food.csv counting
- name: Lint Jupyter with Mypy
run: nbqa mypy *.ipynb
- name: Lint with abi3audit
run: python3 -c "import evalica;print(evalica.evalica.__file__)" | xargs abi3audit --assume-minimum-abi3=3.8 --verbose
- name: Run Jupyter
run: |
mkdir jupyter
jupyter nbconvert --to html --output jupyter/index.html --execute Tutorial.ipynb
cp Evalica.svg jupyter/
- if: matrix.python-version == '3.13' && github.ref == 'refs/heads/master'
name: Upload Jupyter
uses: actions/upload-pages-artifact@v3
with:
path: "./jupyter"
- name: Run MkDocs
run: |
python3 -c "import evalica;print(evalica.evalica.__file__)" | xargs rm -fv
mkdocs build --strict
- if: matrix.python-version == '3.13'
name: Make a release build
run: maturin develop --uv --release --extras dev,docs
- if: matrix.python-version == '3.13'
name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
token: ${{ secrets.CODSPEED_TOKEN }}
run: pytest --codspeed
pages:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
actions: read
id-token: write
pages: write
runs-on: ubuntu-latest
needs: python
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4