File: ci.yml

package info (click to toggle)
python-sparse 0.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,816 kB
  • sloc: python: 11,223; sh: 54; javascript: 10; makefile: 8
file content (137 lines) | stat: -rw-r--r-- 3,647 bytes parent folder | download
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
defaults:
  run:
    shell: bash -leo pipefail {0}

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  test:
    strategy:
      matrix:
        os: ['ubuntu-latest']
        python: ['3.10', '3.11', '3.12']
        pip_opts: ['']
        numba_boundscheck: [0]
        include:
          - os: macos-latest
            python: '3.10'
          - os: windows-latest
            python: '3.10'
          - os: ubuntu-latest
            python: '3.10'
            numba_boundscheck: 1
          - os: ubuntu-latest
            python: '3.10'
            pip_opts: 'numpy<2'
      fail-fast: false
    runs-on: ${{ matrix.os }}
    env:
      PYTHON_VERSION: ${{ matrix.python }}
      NUMBA_BOUNDSCHECK: ${{ matrix.numba_boundscheck }}
    steps:
      - name: Checkout Repo
        uses: actions/checkout@v4
      - uses: mamba-org/setup-micromamba@v2
        with:
          environment-file: ci/environment.yml
          init-shell: >-
            bash
          cache-environment: true
          cache-downloads: true
          post-cleanup: 'all'
          create-args: >-
            python=${{ matrix.python }}
            ${{ matrix.pip_opts }}
      - name: Install package
        run: |
          pip install -e '.[tests]'
      - name: Run tests
        run: ci/test_backends.sh
      - uses: codecov/codecov-action@v5
        if: always()
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./**/coverage*.xml

  examples:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Repo
      uses: actions/checkout@v4
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.11'
        cache: 'pip'
    - name: Build and install Sparse
      run: |
        pip install -U setuptools wheel
        pip install '.[finch]' scipy dask networkx graphblas-algorithms
    - name: Run examples
      run: ci/test_examples.sh

  notebooks:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Repo
      uses: actions/checkout@v4
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.11'
        cache: 'pip'
    - name: Build and install Sparse
      run: |
        pip install -U setuptools wheel
        pip install '.[notebooks]'
    - name: Run notebooks
      run: ci/test_notebooks.sh

  array_api_tests:
    strategy:
      matrix:
        backend: ['Numba', 'Finch']
      fail-fast: false
    env:
      ARRAY_API_TESTS_DIR: ${{ github.workspace }}/array-api-tests
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Repo
      uses: actions/checkout@v4
    - name: Checkout array-api-tests
      run: ci/clone_array_api_tests.sh
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.11'
        cache: 'pip'
    - name: Install build and test dependencies from PyPI
      run: |
        pip install pytest-xdist -r "$ARRAY_API_TESTS_DIR/requirements.txt"
    - name: Build and install Sparse
      run: |
        pip install -U setuptools wheel
        pip install '.[finch]'
    - name: Run the test suite
      env:
        SPARSE_BACKEND: ${{ matrix.backend }}
      run: ci/test_array_api.sh

on:
  # Trigger the workflow on push or pull request,
  # but only for the main branch
  push:
    branches:
      - main
      - vnext
  pull_request:
    branches:
      - main
      - vnext
  # Also trigger on page_build, as well as release created events
  page_build:
  release:
    types: # This configuration does not affect the page_build event above
      - created