Skip to content

Commit c8688fb

Browse files
committed
[CI] Add common tests for different RF and Python version
1 parent 20dc2da commit c8688fb

1 file changed

Lines changed: 103 additions & 0 deletions

File tree

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Common tests run with PostgreSQL on different Python and RF versions
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
DB_NAME: db
7+
DB_USER: db_user
8+
DB_PASS: pass
9+
DB_HOST: 127.0.0.1
10+
DB_PORT: 5432
11+
MODULE_MODE: standard
12+
PY_DB_MODULE: psycopg2
13+
PIP_INSTALL_DB_MODULE: psycopg2
14+
15+
jobs:
16+
tests:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- python-version: '3.8'
23+
rf-version: '5.0.1'
24+
- python-version: '3.9'
25+
rf-version: '5.0.1'
26+
- python-version: '3.10'
27+
rf-version: '6.1.1'
28+
- python-version: '3.11'
29+
rf-version: '6.1.1'
30+
- python-version: '3.12'
31+
rf-version: '7.0.1'
32+
- python-version: '3.13'
33+
rf-version: '7.2.2'
34+
- python-version: '3.14'
35+
rf-version: '7.4.2'
36+
- python-version: '3.15'
37+
rf-version: '7.5.0'
38+
39+
services:
40+
postgres:
41+
image: postgres:11
42+
env:
43+
POSTGRES_DB: ${{ env.DB_NAME }}
44+
POSTGRES_USER: ${{ env.DB_USER }}
45+
POSTGRES_PASSWORD: ${{ env.DB_PASS }}
46+
ports:
47+
- 5432:5432
48+
# needed because the postgres container does not provide a healthcheck
49+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
50+
51+
52+
steps:
53+
- name: Check out repository code
54+
uses: actions/checkout@v3
55+
56+
- uses: actions/setup-python@v4
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
60+
- name: Setup Python and dependencies
61+
run: |
62+
python -m pip install --upgrade pip
63+
pip install -r requirements.txt
64+
65+
- name: Install special RF version
66+
if: matrix.rf_version != 'default'
67+
68+
run: |
69+
pip install -U robotframework==${{matrix.rf-version}}
70+
71+
- name: Install Development/Checked out version of DatabaseLibrary
72+
run: |
73+
pip install -e ${{ github.workspace }}
74+
75+
- name: Setup Python DB module
76+
run: |
77+
pip install ${{ env.PIP_INSTALL_DB_MODULE }}
78+
79+
- name: Tests for RF ${{ matrix.rf-version }} on Python ${{ matrix.python-version }}
80+
working-directory: ./test
81+
run: >-
82+
robot
83+
-d results
84+
--xunit result.xml
85+
--loglevel DEBUG:INFO
86+
--output output_rf_${{ matrix.rf-version }}_python_${{ matrix.python-version }}.xml
87+
--log log_rf_${{ matrix.rf-version }}_python_${{ matrix.python-version }}.html
88+
--report report_rf_${{ matrix.rf-version }}_python_${{ matrix.python-version }}.html
89+
-v DB_MODULE_MODE:${{ env.MODULE_MODE }}
90+
-v DB_MODULE:${{ env.PY_DB_MODULE }}
91+
-v DB_NAME:${{ env.DB_NAME }}
92+
-v DB_USER:${{ env.DB_USER }}
93+
-v DB_PASS:${{ env.DB_PASS }}
94+
-v DB_HOST:${{ env.DB_HOST }}
95+
-v DB_PORT:${{ env.DB_PORT }}
96+
tests/common_tests
97+
98+
- name: Upload Robot Logs
99+
if: ${{ always() }}
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: log-files-rf_${{ matrix.rf-version }}_python_${{ matrix.python-version }}
103+
path: ./test/results/

0 commit comments

Comments
 (0)