-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 1.49 KB
/
ci.yaml
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
64
name: CI
on:
pull_request:
push:
branches: [main]
tags: ['v*']
env:
BOOKSHELF_DOWNLOAD_CACHE_LOCATION: /tmp/pooch
jobs:
linting:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
env:
MYPYPATH: stubs
PRE_COMMIT_HOME: /tmp/.cache/pre-commit
UV_PRERELEASE: allow
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: /tmp/.cache/pre-commit
key: ${{ runner.os }}-pre-commit
- name: mypy
run: |
uvx pre-commit run --all-files
uv run mypy src
tests:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ]
python-version:
- "3.11"
runs-on: "${{ matrix.os }}"
defaults:
run:
shell: bash
env:
UV_PRERELEASE: allow
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Cache pooch
uses: actions/cache@v4
with:
path: /tmp/pooch
key: ${{ runner.os }}-${{ matrix.python-version }}-pooch
- name: Check build
run: |
make run
- name: Run tests
run: |
[[ ! -d "tests" ]] && exit 0
uv run pytest tests -r a -v