Skip to content

ci: use uv-venv-lock-runner in tracing tox, align deps #7436

ci: use uv-venv-lock-runner in tracing tox, align deps

ci: use uv-venv-lock-runner in tracing tox, align deps #7436

name: ops Tests
on:
push:
branches:
- main
pull_request:
workflow_call:
workflow_dispatch:
permissions: {}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- run: uv tool install tox --with tox-uv
- name: Run linting and static checks
run: tox -e lint
- name: Run tracing linter and static checks
run: cd tracing && tox -e lint
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.12", "3.14"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- run: uv tool install tox --with tox-uv
- run: uv python install ${{ matrix.python-version }}
- name: Run unit tests
run: tox -e py${{ matrix.python-version }}-unit
- name: Run tracing unit tests
run: cd tracing && tox -e py${{ matrix.python-version }}-unit
test-real-pebble:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.12", "3.14"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- run: uv tool install tox --with tox-uv
- run: uv python install ${{ matrix.python-version }}
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.22"
# To suppress the "Restore cache failed" error, since there is no go.sum file here.
cache: false
- name: Install Pebble
env:
GOTOOLCHAIN: auto # setup-go defaults this to 'local', set back to 'auto' (Go default)
run: |
go install github.com/canonical/pebble/cmd/pebble@master
echo "$HOME/go/bin" >> "$GITHUB_PATH"
- name: Run Real pebble tests
run: tox -e py${{ matrix.python-version }}-pebble
pip-install:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- name: Set up Python 3
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: ${{ matrix.python-version }}
- run: uv build
# Test that a pip install of the source dist .tar.gz will work
- name: Test 'pip install'
# Shouldn't happen, but pip install will fail if ls returns multiple lines
run: pip install $(ls dist/ops*.gz)