-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (52 loc) · 1.78 KB
/
tests.yml
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
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 deps
run: |
pip install -e ".[test,dask,dev]"
- 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
echo ">>>>>>> pwd: $(pwd)"
echo ">>>>>>> ls -la: $(ls -la)"
ruff_version=$(grep -E -A1 'astral-sh/ruff-pre-commit' .pre-commit-config.yaml | sed -nre "s/^\s+rev:.+'v([0-9\.]+)'/\1/p")
[ -n "$ruff_version" ] || echo "error parsing ruff version" && exit 1
pip install "ruff==$ruff_version"
- 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