Skip to content

feat: note the socket path in Pebble tracing spans #2934

feat: note the socket path in Pebble tracing spans

feat: note the socket path in Pebble tracing spans #2934

name: Example Charm Tests
on:
push:
branches:
- main
pull_request:
workflow_call:
workflow_dispatch:
permissions: {}
jobs:
charm-checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12", "3.14"]
dir:
- examples/httpbin-demo
- examples/machine-tinyproxy
- examples/k8s-1-minimal
- examples/k8s-2-configurable
- examples/k8s-3-postgresql
- examples/k8s-4-action
- examples/k8s-5-observe
steps:
- uses: actions/checkout@v6.0.2
with:
persist-credentials: false
- name: Set up Python 3
uses: actions/setup-python@v6
with:
python-version: '${{ matrix.python-version }}'
- name: Set up uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Set up tox and tox-uv
run: uv tool install tox --with tox-uv
- name: Install Charmcraft
run: sudo snap install charmcraft --classic
- name: Fetch any charmlibs
run: |
cd ${{ matrix.dir }}
if grep -Eq "^charm-libs:" charmcraft.yaml; then
charmcraft fetch-libs
fi
- name: Run linting and static checks
run: |
cd ${{ matrix.dir }}
tox -e lint
- name: Run unit tests
run: |
cd ${{ matrix.dir }}
tox -e unit
- name: Write mypy-requirements.txt
shell: uv run --script --no-project {0}
run: |
# /// script
# dependencies = ["tomli"] # drop for tomllib when we're Python 3.11+
# ///
import tomli, pathlib
pyproject_toml = tomli.loads(pathlib.Path('pyproject.toml').read_text())
deps = '\n'.join(pyproject_toml['dependency-groups']['mypy'])
print(deps) # logging
pathlib.Path('mypy-requirements.txt').write_text(deps)
- name: Run mypy
working-directory: ${{ matrix.dir }}
env:
MYPYPATH: 'src:lib:../..'
run: |
uv run \
--with-requirements=../../mypy-requirements.txt \
--with=../.. \
--with=../../testing \
--group=lint \
--group=unit \
--group=integration \
mypy --explicit-package-bases --follow-imports=silent src tests