-
Notifications
You must be signed in to change notification settings - Fork 372
90 lines (89 loc) · 2.97 KB
/
main.yml
File metadata and controls
90 lines (89 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: testcontainers packages
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
strategy:
matrix:
runtime:
- machine: ubuntu-latest
python-version: "3.7"
- machine: ubuntu-latest
python-version: "3.8"
- machine: ubuntu-latest
python-version: "3.9"
- machine: ubuntu-latest
python-version: "3.10"
- machine: ubuntu-latest
python-version: "3.11"
component:
- arangodb
- azurite
- clickhouse
- core
- elasticsearch
- google
- kafka
- keycloak
- localstack
- meta
- minio
- mongodb
- mssql
- mysql
- neo4j
- nginx
- opensearch
- oracle
- postgres
- rabbitmq
- redis
- selenium
runs-on: ${{ matrix.runtime.machine }}
steps:
- uses: actions/checkout@v3
- name: Setup python ${{ matrix.runtime.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.runtime.python-version }}
cache: pip
cache-dependency-path: ${{ format('requirements/{0}-{1}.txt', matrix.runtime.machine, matrix.runtime.python-version) }}
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install -r requirements/${{ matrix.runtime.machine }}-${{ matrix.runtime.python-version }}.txt
- name: Run docker diagnostics
if: matrix.component == 'core'
run: |
echo "Build minimal container for docker-in-docker diagnostics"
docker build -f Dockerfile.diagnostics -t testcontainers-python .
echo "Bare metal diagnostics"
python diagnostics.py
echo "Container diagnostics with bridge network"
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --network=bridge testcontainers-python python diagnostics.py
echo "Container diagnostics with host network"
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --network=host testcontainers-python python diagnostics.py
- name: Lint the code
run: make ${{ matrix.component }}/lint
- name: Run tests
if: matrix.component != 'meta'
run: make ${{ matrix.component }}/tests
- name: Run doctests
if: matrix.component != 'meta'
run: make ${{ matrix.component }}/doctest
- name: Build the package
run: make ${{ matrix.component }}/dist
- name: Upload the package to pypi
if: >
github.event_name == 'push'
&& github.ref == 'refs/heads/main'
&& github.repository_owner == 'testcontainers'
&& matrix.runtime.python-version == '3.10'
&& matrix.runtime.machine == 'ubuntu-latest'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: make ${{ matrix.component }}/upload