-
Notifications
You must be signed in to change notification settings - Fork 23
96 lines (92 loc) · 2.69 KB
/
python-package.yml
File metadata and controls
96 lines (92 loc) · 2.69 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
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-24.04 # ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: |
uv sync --locked --all-extras
./setup-test-env.sh
- name: Lint with ruff
run: |
source .venv/bin/activate
ruff check src tests e2e-tests
ruff format --check src tests e2e-tests
- name: Typecheck with mypy
run: |
source .venv/bin/activate
mypy src/ tests/
- name: Test with pytest
env:
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
source .venv/bin/activate
coverage run --source=lightkube -m pytest tests/
coveralls
- name: Package (wheel)
run: |
uv build --wheel
- name: Package (sdist)
run: |
uv build --sdist
- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.python-version }}
path: |
dist
coveralls:
name: Indicate completion to coveralls.io
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Install coveralls
run: pip3 install --upgrade coveralls
- name: Finished
run: coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
e2e-test:
strategy:
fail-fast: false
matrix:
k8s: [ '1.29', '1.34' ]
name: E2E test in K8s ${{ matrix.k8s }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: |
uv sync --locked --all-extras --no-install-project
uv pip install . "lightkube-models==${{ matrix.k8s }}.*"
- uses: nolar/setup-k3d-k3s@v1
with:
version: v${{ matrix.k8s }}
- run: kubectl version
- run: |
source .venv/bin/activate
pytest e2e-tests/