diff --git a/.github/workflows/pypi-test.yaml b/.github/workflows/pypi-test.yaml index 09f0c41..8587d06 100644 --- a/.github/workflows/pypi-test.yaml +++ b/.github/workflows/pypi-test.yaml @@ -1,42 +1,57 @@ - # This workflow will install Python dependencies, run tests and lint with a single version of Python - # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: Test the library on: - workflow_dispatch -# push: -# branches: [main] -# pull_request: -# branches: [main] + push: + branches: + - master # for legacy repos + - main + pull_request: + branches: + - master # for legacy repos + - main + workflow_dispatch: + schedule: + - cron: "0 0 1,16 * *" + +permissions: + contents: read + +concurrency: + group: >- + ${{ github.workflow }}-${{ github.ref_type }}- + ${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true jobs: - build: - runs-on: ubuntu-latest + test: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python: ["3.10", "3.11", "3.12", "3.13"] #, "3.14" + zarr: ["2.*", "3.*"] + platform: + - ubuntu-latest + # - macos-latest + # - windows-latest + + runs-on: ${{ matrix.platform }} + name: Python ${{ matrix.python }}, Zarr ${{ matrix.zarr }}, ${{ matrix.platform }} - name: Python ${{ matrix.python-version }} steps: - - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + id: setup-python with: - python-version: ${{ matrix.python-version }} - cache: "pip" + python-version: ${{ matrix.python }} + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest tox + pip install "zarr==${{ matrix.zarr }}" + pip install tox coverage - # - name: Lint with flake8 - # run: | - # # stop the build if there are Python syntax errors or undefined names - # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - # # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Test with tox - run: | + - name: Run tests + run: >- + pipx run --python '${{ steps.setup-python.outputs.python-path }}' tox + -- -rFEx --durations 10 --color yes --cov --cov-branch --cov-report=xml