| 1 |
# Run tox tests on Ubuntu Docker images using the deadsnakes and GIFT PPAs |
| 2 |
name: test_tox |
| 3 |
on: |
| 4 |
pull_request: |
| 5 |
branches: |
| 6 |
- main |
| 7 |
push: |
| 8 |
branches: |
| 9 |
- main |
| 10 |
permissions: read-all |
| 11 |
jobs: |
| 12 |
build: |
| 13 |
runs-on: ubuntu-latest |
| 14 |
strategy: |
| 15 |
matrix: |
| 16 |
include: |
| 17 |
- python-version: '3.10' |
| 18 |
toxenv: 'py310' |
| 19 |
- python-version: '3.11' |
| 20 |
toxenv: 'py311' |
| 21 |
- python-version: '3.12' |
| 22 |
toxenv: 'py312' |
| 23 |
- python-version: '3.13' |
| 24 |
toxenv: 'py313' |
| 25 |
- python-version: '3.14' |
| 26 |
toxenv: 'py314' |
| 27 |
container: |
| 28 |
image: ubuntu:26.04 |
| 29 |
steps: |
| 30 |
- uses: actions/checkout@v6 |
| 31 |
- name: Set up container |
| 32 |
env: |
| 33 |
DEBIAN_FRONTEND: noninteractive |
| 34 |
run: | |
| 35 |
apt update -q |
| 36 |
apt install -y libterm-readline-gnu-perl locales software-properties-common |
| 37 |
locale-gen en_US.UTF-8 |
| 38 |
ln -f -s /usr/share/zoneinfo/UTC /etc/localtime |
| 39 |
- name: Install dependencies |
| 40 |
env: |
| 41 |
DEBIAN_FRONTEND: noninteractive |
| 42 |
run: | |
| 43 |
add-apt-repository -y universe |
| 44 |
add-apt-repository -y ppa:deadsnakes/ppa |
| 45 |
add-apt-repository -y ppa:gift/dev |
| 46 |
apt update -q |
| 47 |
apt install -y build-essential git pkg-config python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-pip python3-setuptools tox |
| 48 |
- name: Run tests |
| 49 |
env: |
| 50 |
LANG: en_US.UTF-8 |
| 51 |
run: | |
| 52 |
tox -e ${{ matrix.toxenv }},wheel |
| 53 |
coverage: |
| 54 |
runs-on: ubuntu-latest |
| 55 |
strategy: |
| 56 |
matrix: |
| 57 |
python-version: ['3.14'] |
| 58 |
container: |
| 59 |
image: ubuntu:26.04 |
| 60 |
steps: |
| 61 |
- uses: actions/checkout@v6 |
| 62 |
- name: Set up container |
| 63 |
env: |
| 64 |
DEBIAN_FRONTEND: noninteractive |
| 65 |
run: | |
| 66 |
apt update -q |
| 67 |
apt install -y libterm-readline-gnu-perl locales software-properties-common |
| 68 |
locale-gen en_US.UTF-8 |
| 69 |
ln -f -s /usr/share/zoneinfo/UTC /etc/localtime |
| 70 |
- name: Install dependencies |
| 71 |
env: |
| 72 |
DEBIAN_FRONTEND: noninteractive |
| 73 |
run: | |
| 74 |
add-apt-repository -y universe |
| 75 |
add-apt-repository -y ppa:deadsnakes/ppa |
| 76 |
add-apt-repository -y ppa:gift/dev |
| 77 |
apt update -q |
| 78 |
apt install -y build-essential curl git pkg-config python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-pip python3-setuptools tox |
| 79 |
- name: Run tests with coverage |
| 80 |
env: |
| 81 |
LANG: en_US.UTF-8 |
| 82 |
run: | |
| 83 |
tox -e coverage |
| 84 |
- name: Upload coverage report to Codecov |
| 85 |
uses: codecov/codecov-action@v6 |
| 86 |
with: |
| 87 |
token: ${{ secrets.CODECOV_TOKEN }} |