| 1 |
name: Smoke Tests |
| 2 |
|
| 3 |
on: |
| 4 |
workflow_call: |
| 5 |
inputs: |
| 6 |
module_name: |
| 7 |
description: 'Name of the test module to run (e.g., test_broker_failover.py)' |
| 8 |
required: true |
| 9 |
type: string |
| 10 |
python_versions: |
| 11 |
description: 'JSON array of Python versions to test' |
| 12 |
required: false |
| 13 |
type: string |
| 14 |
default: '["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]' |
| 15 |
|
| 16 |
permissions: |
| 17 |
contents: read |
| 18 |
|
| 19 |
jobs: |
| 20 |
testing-with: |
| 21 |
runs-on: blacksmith-4vcpu-ubuntu-2404 |
| 22 |
strategy: |
| 23 |
fail-fast: false |
| 24 |
matrix: |
| 25 |
python-version: ${{ fromJson(inputs.python_versions) }} |
| 26 |
|
| 27 |
steps: |
| 28 |
- name: Fetch Docker Images |
| 29 |
run: | |
| 30 |
docker pull redis:latest |
| 31 |
docker pull rabbitmq:latest |
| 32 |
|
| 33 |
- name: Install apt packages |
| 34 |
run: | |
| 35 |
sudo apt update |
| 36 |
sudo apt-get install -y procps # Install procps to enable sysctl |
| 37 |
sudo sysctl -w vm.overcommit_memory=1 |
| 38 |
|
| 39 |
- uses: actions/checkout@v6 |
| 40 |
- name: Setup Docker Builder |
| 41 |
uses: useblacksmith/setup-docker-builder@v1 |
| 42 |
- name: Set up Python ${{ matrix.python-version }} |
| 43 |
uses: useblacksmith/setup-python@v6 |
| 44 |
with: |
| 45 |
python-version: ${{ matrix.python-version }} |
| 46 |
allow-prereleases: true |
| 47 |
cache: 'pip' |
| 48 |
cache-dependency-path: '**/setup.py' |
| 49 |
|
| 50 |
- name: Install tox |
| 51 |
run: python -m pip install --upgrade pip tox tox-gh-actions |
| 52 |
|
| 53 |
- name: Run tox for "${{ matrix.python-version }}-smoke-${{ inputs.module_name }}" |
| 54 |
uses: nick-fields/retry@v4 |
| 55 |
with: |
| 56 |
timeout_minutes: 20 |
| 57 |
max_attempts: 5 |
| 58 |
retry_wait_seconds: 60 |
| 59 |
command: | |
| 60 |
tox --verbose --verbose -e "${{ matrix.python-version }}-smoke" -- -k ${{ inputs.module_name }} -n auto |