Skip to content

Commit bd97c8a

Browse files
committed
Use runtime (including machine and python version) matrix to run tests.
1 parent 4522913 commit bd97c8a

File tree

7 files changed

+41
-35
lines changed

7 files changed

+41
-35
lines changed

.github/workflows/main.yml

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,54 @@ jobs:
99
build:
1010
strategy:
1111
matrix:
12-
python-version:
13-
- "3.7"
14-
- "3.8"
15-
- "3.9"
16-
- "3.10"
17-
- "3.11"
12+
runtime:
13+
- machine: ubuntu-latest
14+
python-version: "3.7"
15+
- machine: ubuntu-latest
16+
python-version: "3.8"
17+
- machine: ubuntu-latest
18+
python-version: "3.9"
19+
- machine: ubuntu-latest
20+
python-version: "3.10"
21+
- machine: ubuntu-latest
22+
python-version: "3.11"
1823
component:
19-
- arangodb
20-
- azurite
21-
- clickhouse
22-
- compose
23-
- core
24-
- elasticsearch
25-
- google
26-
- kafka
27-
- keycloak
28-
- localstack
29-
- meta
30-
- minio
31-
- mongodb
32-
- mssql
33-
- mysql
34-
- neo4j
35-
- nginx
36-
- opensearch
37-
- oracle
38-
- postgres
39-
- rabbitmq
40-
- redis
41-
- selenium
42-
runs-on: ubuntu-latest
24+
- arangodb
25+
- azurite
26+
- clickhouse
27+
- compose
28+
- core
29+
- elasticsearch
30+
- google
31+
- kafka
32+
- keycloak
33+
- localstack
34+
- meta
35+
- minio
36+
- mongodb
37+
- mssql
38+
- mysql
39+
- neo4j
40+
- nginx
41+
- opensearch
42+
- oracle
43+
- postgres
44+
- rabbitmq
45+
- redis
46+
- selenium
47+
runs-on: ${{ matrix.runtime.machine }}
4348
steps:
4449
- uses: actions/checkout@v3
45-
- name: Setup python ${{ matrix.python-version }}
50+
- name: Setup python ${{ matrix.runtime.python-version }}
4651
uses: actions/setup-python@v4
4752
with:
48-
python-version: ${{ matrix.python-version }}
53+
python-version: ${{ matrix.runtime.python-version }}
4954
cache: pip
5055
cache-dependency-path: ${{ format('requirements/{0}.txt', matrix.python-version) }}
5156
- name: Install Python dependencies
5257
run: |
5358
pip install --upgrade pip
54-
pip install -r requirements/${{ matrix.python-version }}.txt
59+
pip install -r requirements/${{ matrix.runtime.machine }}-${{ matrix.runtime.python-version }}.txt
5560
- name: Run docker diagnostics
5661
if: matrix.component == 'core'
5762
run: |
@@ -78,7 +83,8 @@ jobs:
7883
github.event_name == 'push'
7984
&& github.ref == 'refs/heads/main'
8085
&& github.repository_owner == 'testcontainers'
81-
&& matrix.python-version == '3.10'
86+
&& matrix.runtime.python-version == '3.10'
87+
&& matrix.runtime.machine == 'ubuntu-latest'
8288
env:
8389
TWINE_USERNAME: __token__
8490
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PYTHON_VERSIONS = 3.7 3.8 3.9 3.10 3.11
22
PYTHON_VERSION ?= 3.10
33
IMAGE = testcontainers-python:${PYTHON_VERSION}
4-
REQUIREMENTS = $(addprefix requirements/,${PYTHON_VERSIONS:=.txt})
4+
REQUIREMENTS = $(addprefix requirements/ubuntu-latest-,${PYTHON_VERSIONS:=.txt})
55
RUN = docker run --rm -it
66
# Get all directories that contain a setup.py and get the directory name.
77
PACKAGES = $(subst /,,$(dir $(wildcard */setup.py)))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)