Skip to content

Fix: Better performances when using buffer API #766

Fix: Better performances when using buffer API

Fix: Better performances when using buffer API #766

Workflow file for this run

name: Test
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- '!**.pyi'
- 'tox.ini'
- 'pyproject.toml'
- 'pdm.lock'
- '.github/codecov.yml'
- '.github/actions/setup-tox/**'
- '.github/workflows/test.yml'
push:
branches:
- main
tags-ignore:
- '*'
paths:
- 'src/**'
- 'tests/**'
- '!**.pyi'
- 'tox.ini'
- 'pyproject.toml'
- 'pdm.lock'
- '.github/codecov.yml'
- '.github/actions/setup-tox/**'
- '.github/workflows/test.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
tests:
if: |
(github.event_name != 'push' || !startsWith(github.event.head_commit.message, 'Bump version:'))
&& (github.event_name != 'pull_request' || (github.event.pull_request.draft != true && !contains(github.event.pull_request.labels.*.name, 'pr-skip-test')))
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022, macos-12]
python_version: ['3.11', '3.12']
test_type: [unit, functional]
include:
- python_version: '3.11'
tox_py: py311
- python_version: '3.12'
tox_py: py312
- test_type: unit
codecov_flags: >-
test-unit
- test_type: functional
codecov_flags: >-
test-functional
name: ${{ matrix.test_type }} tests (${{ matrix.os }}, ${{ matrix.python_version }})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup tox (python ${{ matrix.python_version }})
uses: ./.github/actions/setup-tox
with:
python-version: ${{ matrix.python_version }}
- name: Launch tests
timeout-minutes: 20 # Even if 10 minutes is already too big
run: tox run -f ${{ matrix.tox_py }}-${{ matrix.test_type }} -- -v
- name: Generate coverage report
if: hashFiles('.coverage.*') != '' # Rudimentary `file.exists()`
run: |
tox run -e coverage
tox exec -e coverage -- coverage xml
- name: Upload coverage to codecov
if: hashFiles('coverage.xml') != '' # Rudimentary `file.exists()`
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: >- # Mark which lines are covered by which envs
${{ matrix.codecov_flags }},
OS-${{ runner.os }},
Py-${{ matrix.python_version }}
other-tests:
if: |
(github.event_name != 'push' || !startsWith(github.event.head_commit.message, 'Bump version:'))
&& (github.event_name != 'pull_request' || github.event.pull_request.draft != true)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup tox
uses: ./.github/actions/setup-tox
with:
python-version: '3.11'
- name: Launch tests
run: tox run -f py311-other -- -v