Skip to content

Commit b53c0af

Browse files
perseoGIczoido
andauthored
Removed intermediate python versions in CI matrix (#17839)
* Removed intermediate python versions in CI matrix * Use latest version * Restore 3.13 * Use envs to define global python versions * try to launch from main * fix * wip * revert changes * wip * use 3.10 * Avoid escaping and added stage name --------- Co-authored-by: czoido <mrgalleta@gmail.com>
1 parent 8d273e1 commit b53c0af

File tree

5 files changed

+64
-13
lines changed

5 files changed

+64
-13
lines changed

.ci/docker/conan-tests

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive
77
ENV PY36=3.6.15 \
88
PY38=3.8.6 \
99
PY39=3.9.2 \
10+
PY310=3.10.16 \
1011
PY312=3.12.3 \
1112
PY313=3.13.0 \
1213
CMAKE_3_15=/usr/share/cmake-3.15.7/bin/cmake \
@@ -95,6 +96,7 @@ RUN curl https://pyenv.run | bash && \
9596
pyenv install $PY36 && \
9697
pyenv install $PY38 && \
9798
pyenv install $PY39 && \
99+
pyenv install $PY310 && \
98100
pyenv install $PY312 && \
99101
pyenv install $PY313 && \
100102
pyenv global $PY39 && \

.github/workflows/linux-tests.yml

+22-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Linux tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
python-versions:
7+
required: true
8+
type: string
59

610
jobs:
711
build_container:
@@ -49,7 +53,7 @@ jobs:
4953
options: --user conan
5054
strategy:
5155
matrix:
52-
python-version: [3.13, 3.9, 3.8, 3.6]
56+
python-version: ${{ fromJson(inputs.python-versions) }}
5357
test-type: [unittests, integration, functional]
5458
include:
5559
- test-type: unittests
@@ -92,19 +96,30 @@ jobs:
9296
linux_docker_tests:
9397
needs: build_container
9498
runs-on: ubuntu-latest
99+
container:
100+
image: ghcr.io/${{ github.repository_owner }}/conan-tests:${{ needs.build_container.outputs.image_tag }}
101+
options: --user conan
95102
strategy:
96103
matrix:
97-
python-version: [3.13, 3.9]
104+
# Use modern versions due to docker incompatibility with python <3.8
105+
python-version: ${{ github.event_name != 'pull_request' && fromJson('["3.13", "3.9"]') || fromJson('["3.10"]') }}
106+
98107
name: Docker Runner Tests (${{ matrix.python-version }})
99108
steps:
100-
- name: Set up Python ${{ matrix.python-version }}
101-
uses: actions/setup-python@v5
102-
with:
103-
python-version: ${{ matrix.python-version }}
104-
105109
- name: Checkout code
106110
uses: actions/checkout@v4
107111

112+
- name: Set up Python ${{ matrix.python-version }}
113+
run: |
114+
pyenv global ${{ matrix.python-version }}
115+
python --version
116+
117+
- name: Cache pip
118+
uses: actions/cache@v4
119+
with:
120+
path: ~/.cache/pip
121+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements*.txt') }}
122+
108123
- name: Install dependencies
109124
run: |
110125
pip install --upgrade pip

.github/workflows/main.yml

+27
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,44 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19+
set_python_versions:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
python_versions_linux_windows: ${{ steps.set_versions.outputs.python_versions_linux_windows }}
23+
python_versions_macos: ${{ steps.set_versions.outputs.python_versions_macos }}
24+
name: Determine Python versions
25+
steps:
26+
- name: Determine Python versions
27+
id: set_versions
28+
run: |
29+
if [[ "${{ github.ref }}" == "refs/heads/develop2" || "${{ github.ref }}" == refs/heads/release/* ]]; then
30+
echo "python_versions_linux_windows=['3.13', '3.6']" >> $GITHUB_OUTPUT
31+
echo "python_versions_macos=['3.13', '3.8']" >> $GITHUB_OUTPUT
32+
else
33+
echo "python_versions_linux_windows=['3.10']" >> $GITHUB_OUTPUT
34+
echo "python_versions_macos=['3.10']" >> $GITHUB_OUTPUT
35+
fi
36+
1937
linux_suite:
38+
needs: set_python_versions
2039
uses: ./.github/workflows/linux-tests.yml
2140
name: Linux test suite
41+
with:
42+
python-versions: ${{ needs.set_python_versions.outputs.python_versions_linux_windows }}
2243

2344
osx_suite:
45+
needs: set_python_versions
2446
uses: ./.github/workflows/osx-tests.yml
2547
name: OSX test suite
48+
with:
49+
python-versions: ${{ needs.set_python_versions.outputs.python_versions_macos }}
2650

2751
windows_suite:
52+
needs: set_python_versions
2853
uses: ./.github/workflows/win-tests.yml
2954
name: Windows test suite
55+
with:
56+
python-versions: ${{ needs.set_python_versions.outputs.python_versions_linux_windows }}
3057

3158
code_coverage:
3259
runs-on: ubuntu-latest

.github/workflows/osx-tests.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: OSX Tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
python-versions:
7+
required: true
8+
type: string
59

610
jobs:
711
osx_setup:
@@ -11,10 +15,10 @@ jobs:
1115
- name: Checkout code
1216
uses: actions/checkout@v4
1317

14-
- name: Set up Python 3.8
18+
- name: Set up Python
1519
uses: actions/setup-python@v5
1620
with:
17-
python-version: 3.8
21+
python-version: '3.10'
1822

1923
- name: Cache pip packages
2024
id: cache-pip
@@ -114,7 +118,7 @@ jobs:
114118
strategy:
115119
fail-fast: true
116120
matrix:
117-
python-version: [3.8, 3.12, 3.13]
121+
python-version: ${{ fromJson(inputs.python-versions) }}
118122
test-type: [unittests, integration, functional]
119123
include:
120124
- test-type: unittests

.github/workflows/win-tests.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ name: Windows Tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
python-versions:
7+
required: true
8+
type: string
59

610
jobs:
711
unit_integration_tests:
812
runs-on: windows-2022
913
strategy:
1014
matrix:
11-
python-version: [3.13, 3.8, 3.6]
15+
python-version: ${{ fromJson(inputs.python-versions) }}
1216
name: Unit & Integration Tests (${{ matrix.python-version }})
1317
steps:
1418
- name: Checkout code
@@ -59,8 +63,7 @@ jobs:
5963
runs-on: windows-2022
6064
strategy:
6165
matrix:
62-
python-version: [3.13, 3.8, 3.6]
63-
66+
python-version: ${{ fromJson(inputs.python-versions) }}
6467
name: Functional Tests (${{ matrix.python-version }})
6568
steps:
6669
- name: Checkout code

0 commit comments

Comments
 (0)