-
Notifications
You must be signed in to change notification settings - Fork 66
53 lines (43 loc) · 1.33 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
name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
workflow_call:
jobs:
tests:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-14, windows-latest]
version:
- { python: "3.10", resolution: highest }
- { python: "3.12", resolution: lowest-direct }
runs-on: ${{ matrix.os }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install uv
run: pip install uv
- name: Install dependencies
run: |
uv pip install cython setuptools --system
python setup.py build_ext --inplace
uv pip install -e .[test] --system --resolution=${{ matrix.version.resolution }}
- name: Run Tests
run: pytest --capture=no --cov --cov-report=xml
env:
CHGNET_DEVICE: cpu
- name: Codacy coverage reporter
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'push' }}
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml