-
Notifications
You must be signed in to change notification settings - Fork 1.6k
50 lines (45 loc) · 1.61 KB
/
Copy pathrun_tests.yml
File metadata and controls
50 lines (45 loc) · 1.61 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
# This workflow will install Python dependencies and run tests in multiple versions of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: tests
on:
push:
branches: [ "master" ]
pull_request:
permissions:
contents: read
jobs:
build:
name: Python ${{ matrix.python-version }} - NumPy ${{ matrix.numpy-major }}.x
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
numpy-major: ["1", "2"]
exclude:
- python-version: "3.13" # numpy<2 is not supported on 3.13+
numpy-major: "1"
- python-version: "3.14"
numpy-major: "1"
- python-version: "3.14t"
numpy-major: "1"
steps:
- uses: actions/checkout@v3
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
uv sync --extra dev
- name: Install NumPy 1.x compatibility dependencies
if: matrix.numpy-major == '1'
run: uv pip install "numpy>=1.25,<2" "scipy<1.18" # scipy>=1.18 is not supported on numpy<2
- name: Install NumPy 2.x compatibility dependencies
if: matrix.numpy-major == '2'
run: uv pip install "numpy>=2"
- name: Run pytest
run: uv run --no-sync pytest --cov-report xml --cov=bayes_opt/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}