-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (87 loc) · 2.81 KB
/
build.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Build Workflow
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: 📦 Nested Dict Tools CI build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
path: ~/.cache/pip
# - os: macos-latest
# path: ~/Library/Caches/pip
# - os: windows-latest
# path: ~\AppData\Local\pip\Cache
python-version: ["3.12", "3.13"] # ["3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🐍 Install uv with caching
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
version: "0.5.4"
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: 💾 Setup pip cache
uses: actions/cache@v4
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('uv.lock') }}
restore-keys: ${{ runner.os }}-pip-
- name: 📥 Install the project
run: uv sync --all-extras --dev
- name: 🧹 Lint with ruff @chartboost
uses: chartboost/ruff-action@v1
continue-on-error: true
- name: 📥 Install pytest-action dependencies
run: |
pip install pytest pytest-cov pytest-md pytest-emoji
- name: 🧪 Run pytest @pavelzw
uses: pavelzw/pytest-action@v2
with:
custom-arguments: "tests -rA --doctest-modules --cov=."
continue-on-error: true
# - name: 🧪 Run Pytest with command
# run: pytest tests -rA --doctest-modules --cov=.
# continue-on-error: true
- name: 📊 Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
# file: .coverage
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: ✅ Pylance type checking @jakebailey
uses: jakebailey/pyright-action@v2
with:
pylance-version: latest-release
stats: true
# verbose: true
continue-on-error: true
# - name: 📥 Install public interface package
# run: |
# python -m pip install .
- name: ✅ Verify public API types with Pylance @jakebailey
uses: jakebailey/pyright-action@v2
with:
pylance-version: latest-release
verify-types: nested_dict_tools
# verbose: true
continue-on-error: true
- name: 🏗️ Build
run: |
pipx install hatch
hatch build