-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (83 loc) · 2.54 KB
/
Copy pathtest.yml
File metadata and controls
98 lines (83 loc) · 2.54 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
name: Tests
on:
push:
branches: ["master", "main"]
pull_request:
branches: ["master", "main"]
permissions:
contents: read
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
numpy-version: ["1.26.4", "2.2.6", "2.3.5"]
exclude:
- python-version: "3.11"
numpy-version: "2.2.6"
- python-version: "3.11"
numpy-version: "2.3.5"
- python-version: "3.12"
numpy-version: "2.2.6"
- python-version: "3.12"
numpy-version: "2.3.5"
- python-version: "3.13"
numpy-version: "1.26.4"
- python-version: "3.14"
numpy-version: "1.26.4"
- python-version: '3.13'
jax-version: "0.4.20"
- python-version: '3.14'
jax-version: "0.4.20"
- os: windows-latest
python-version: '3.14'
- jax-version: "0.4.20"
numpy-version: "2.2.6"
- jax-version: "0.4.20"
numpy-version: "2.3.5"
jax-version:
- 0.4.20
- latest
steps:
- 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: |
python -m pip install --upgrade pip
pip install "numpy==${{ matrix.numpy-version }}"
if [ "${{ matrix.jax-version }}" != "latest" ]; then
pip install "jax==${{ matrix.jax-version }}" "jaxlib==${{ matrix.jax-version }}"
fi
pip install -e ".[dev]"
shell: bash
- name: Ensure Hugging Face cache directory exists
run: mkdir -p ~/.cache/huggingface
shell: bash
- name: Cache Hugging Face models
uses: actions/cache@v4
with:
path: ~/.cache/huggingface
key: ${{ runner.os }}-huggingface-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-huggingface-
- name: Lint with ruff
run: ruff check .
- name: Check formatting (Black)
run: black --check .
- name: Static type check (Mypy)
run: mypy . --explicit-package-bases
- name: Run tests
run: |
pytest tests/
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}