|
1 | | - # This workflow will install Python dependencies, run tests and lint with a single version of Python |
2 | | - # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
3 | | - |
4 | 1 | name: Test the library |
5 | 2 |
|
6 | 3 | on: |
7 | | - workflow_dispatch |
8 | | -# push: |
9 | | -# branches: [main] |
10 | | -# pull_request: |
11 | | -# branches: [main] |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master # for legacy repos |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - master # for legacy repos |
| 11 | + - main |
| 12 | + workflow_dispatch: |
| 13 | + schedule: |
| 14 | + - cron: "0 0 1,16 * *" |
| 15 | + |
| 16 | +permissions: |
| 17 | + contents: read |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: >- |
| 21 | + ${{ github.workflow }}-${{ github.ref_type }}- |
| 22 | + ${{ github.event.pull_request.number || github.sha }} |
| 23 | + cancel-in-progress: true |
12 | 24 |
|
13 | 25 | jobs: |
14 | | - build: |
15 | | - runs-on: ubuntu-latest |
| 26 | + test: |
16 | 27 | strategy: |
17 | 28 | matrix: |
18 | | - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] |
| 29 | + python: ["3.10", "3.11", "3.12", "3.13"] #, "3.14" |
| 30 | + zarr: ["2.*", "3.*"] |
| 31 | + platform: |
| 32 | + - ubuntu-latest |
| 33 | + # - macos-latest |
| 34 | + # - windows-latest |
| 35 | + |
| 36 | + runs-on: ${{ matrix.platform }} |
| 37 | + name: Python ${{ matrix.python }}, Zarr ${{ matrix.zarr }}, ${{ matrix.platform }} |
19 | 38 |
|
20 | | - name: Python ${{ matrix.python-version }} |
21 | 39 | steps: |
22 | | - - uses: actions/checkout@v2 |
23 | | - - name: Setup Python |
24 | | - uses: actions/setup-python@v4 |
| 40 | + - uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - uses: actions/setup-python@v5 |
| 43 | + id: setup-python |
25 | 44 | with: |
26 | | - python-version: ${{ matrix.python-version }} |
27 | | - cache: "pip" |
| 45 | + python-version: ${{ matrix.python }} |
| 46 | + |
28 | 47 | - name: Install dependencies |
29 | 48 | run: | |
30 | 49 | python -m pip install --upgrade pip |
31 | | - pip install flake8 pytest tox |
| 50 | + pip install "zarr==${{ matrix.zarr }}" |
| 51 | + pip install tox coverage |
32 | 52 |
|
33 | | - # - name: Lint with flake8 |
34 | | - # run: | |
35 | | - # # stop the build if there are Python syntax errors or undefined names |
36 | | - # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
37 | | - # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
38 | | - # # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
39 | | - |
40 | | - - name: Test with tox |
41 | | - run: | |
| 53 | + - name: Run tests |
| 54 | + run: >- |
| 55 | + pipx run --python '${{ steps.setup-python.outputs.python-path }}' |
42 | 56 | tox |
| 57 | + -- -rFEx --durations 10 --color yes --cov --cov-branch --cov-report=xml |
0 commit comments