Merge branch 'feature-postfix-fields' #141
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tests: | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.10", "3.11", "3.12"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: pysetup | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: install ruff | |
run: | | |
# Install the ruff version from .pre-commit-config.yaml here. Using | |
# https://pre-commit.ci/ because of [1] is not fun since dependabot | |
# and pre-commit.ci don't update at the same time, so ruff versions | |
# are always out of sync. | |
# | |
# [1] https://github.com/dependabot/dependabot-core/issues/1524 | |
ruff_version=$(grep -E -A1 'astral-sh/ruff-pre-commit' \ | |
.pre-commit-config.yaml | sed -nre "s/^\s+rev:.+'v([0-9\.]+)'/\1/p") | |
if [ -z "$ruff_version" ]; then | |
echo "error parsing ruff version, no match" | |
exit 1 | |
fi | |
pip install "ruff==$ruff_version" | |
- name: install deps | |
run: | | |
pip install -e ".[test,dask,dev]" | |
- name: lint | |
run: | | |
# Check for lint rules. | |
ruff check . | |
# Check if files need to be formatted. Exit non-zero if the case. | |
ruff format --check . | |
- name: run tests | |
run: | | |
# CI runners have no configured git. Need that for git support tests. | |
git config --global user.name "Gaylord Focker" | |
git config --global user.email "[email protected]" | |
# Run parallel tests (-n flag). Detect all $(pwd)/tests/test_*.py | |
pytest -n4 |