-
Notifications
You must be signed in to change notification settings - Fork 16
74 lines (62 loc) · 2.1 KB
/
Copy pathpytest.yml
File metadata and controls
74 lines (62 loc) · 2.1 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
name: Test
on:
push:
branches: [main]
pull_request:
branches: ["*"]
workflow_dispatch: # allows you to trigger manually
# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: pytest-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
test:
name: ${{ matrix.os }} Python ${{ matrix.python-version }} NumPy ${{ matrix.numpy-version}}
runs-on: ${{ matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11", "3.14"]
numpy-version: ["2.3.0", latest]
include:
# Test oldest supported Python and NumPy versions
- os: ubuntu-latest
python-version: "3.8"
numpy-version: "1.18.0"
# Test vs. NumPy nightly wheels
- os: ubuntu-latest
python-version: "3.14"
numpy-version: "nightly"
# Test issues re. preinstalled SSL certificates on different OSes
- os: windows-latest
python-version: "3.14"
numpy-version: latest
- os: macos-latest
python-version: "3.14"
numpy-version: latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pinned NumPy
if: matrix.numpy-version != 'latest' && matrix.numpy-version != 'nightly'
run: python -m pip install numpy==${{ matrix.numpy-version }}
- name: Install nightly NumPy wheels
if: matrix.numpy-version == 'nightly'
run: pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ numpy
- name: Install package
run: pip install .
- name: Smoke test
run: python -c "import ml_datasets"
- name: Install test dependencies
run: pip install pytest
- name: Run tests
run: pytest