Repository navigation
75 lines (74 loc) · 3.13 KB
/
Copy pathtests.yml
File metadata and controls
75 lines (74 loc) · 3.13 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
name: Tests
on:
push:
branches: [main]
paths-ignore: ['*.md', '.gitignore']
pull_request:
types: [opened, synchronize, labeled]
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
if: github.event_name == 'push' ||
((github.event.action == 'opened' || github.event.action == 'synchronize') && contains(github.event.pull_request.labels.*.name, 'READY TO TEST')) ||
(github.event.action == 'labeled' && github.event.label.name == 'READY TO TEST')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: '0.13.6'
enable-cache: true
- name: Install locked dependencies
run: uv sync --locked --python '${{ matrix.python-version }}'
- name: Test with pytest and python version
run: uv run --locked python -m pytest --cov=streamdeck --cov-report=xml --cov-report=html --cov-report=term --junit-xml=reports/xunit-results.xml
- name: Upload test coverage reports to artifacts
uses: actions/upload-artifact@v4
with:
name: test-coverage-reports-${{ matrix.python-version }}
path: reports/
if: ${{ always() }}
packaging:
name: Build and check distributions
runs-on: ubuntu-latest
if: github.event_name == 'push' ||
((github.event.action == 'opened' || github.event.action == 'synchronize') && contains(github.event.pull_request.labels.*.name, 'READY TO TEST')) ||
(github.event.action == 'labeled' && github.event.label.name == 'READY TO TEST')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.15'
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: '0.13.6'
enable-cache: true
- name: Build source and wheel distributions
run: uv build --no-sources
- name: Check distribution metadata and README rendering
run: uv run --locked --only-group packaging python -m twine check --strict dist/*
- name: Install wheel in a clean environment
run: |
uv venv --python 3.15 "$RUNNER_TEMP/wheel-smoke"
uv pip install --python "$RUNNER_TEMP/wheel-smoke/bin/python" dist/*.whl
- name: Check installed imports and CLI outside the checkout
working-directory: ${{ runner.temp }}
run: |
"$RUNNER_TEMP/wheel-smoke/bin/python" -I -c 'import streamdeck; import streamdeck.manager; import streamdeck.utils.helper_actions'
"$RUNNER_TEMP/wheel-smoke/bin/python" -I -m streamdeck --help
"$RUNNER_TEMP/wheel-smoke/bin/streamdeck" --help
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: package-distributions
path: dist/
if-no-files-found: error