-
Notifications
You must be signed in to change notification settings - Fork 96
60 lines (60 loc) · 1.88 KB
/
Copy pathtest.yml
File metadata and controls
60 lines (60 loc) · 1.88 KB
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
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
jobs:
pre-commit:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out (Dependabot)
if: github.actor == 'dependabot[bot]'
uses: actions/checkout@v7
with:
ref: ${{ github.head_ref }}
- name: Check out (Normal)
if: github.actor != 'dependabot[bot]'
uses: actions/checkout@v7
- uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{hashFiles('.pre-commit-config.yaml')}}
- name: Set up the environment
uses: ./.github/actions/setup-python-env
- name: Run pre-commit
id: pre-commit
run: uv run pre-commit run -a --show-diff-on-failure
continue-on-error: true
- name: Auto-commit changes (Dependabot)
if: always() && github.actor == 'dependabot[bot]' && steps.pre-commit.outcome == 'failure'
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: "chore(deps): auto-update requirements files"
- name: Fail if pre-commit failed
if: steps.pre-commit.outcome == 'failure' && github.actor != 'dependabot[bot]'
run: exit 1
- name: Check lock file consistency
run: uv sync --locked
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v7
- name: Set up the environment
uses: ./.github/actions/setup-python-env
with:
python-version: ${{matrix.python-version}}
- name: Run tests
run: uv run python -m pytest kloppy/tests