Skip to content

Commit 655ea34

Browse files
authored
chore: update ci to test more python version (#394)
This PR expands the ci testing to include python 3.10, 3.11, and 3.12.
1 parent 625255a commit 655ea34

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on:
66
pull_request:
77
branches: [ main ]
88

9-
env:
10-
PYTHON_VERSION: 3.9
11-
129
jobs:
1310
setup:
11+
strategy:
12+
matrix:
13+
python-version: ["3.9","3.10","3.11", "3.12"]
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
@@ -19,24 +19,27 @@ jobs:
1919
with:
2020
path: |
2121
.venv
22-
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/*.txt') }}
22+
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
2323
lookup-only: true
24-
- name: Set up Python ${{ env.PYTHON_VERSION }}
24+
- name: Set up Python ${{ matrix.python-version }}
2525
uses: actions/setup-python@v5
2626
with:
27-
python-version: ${{ env.PYTHON_VERSION }}
27+
python-version: ${{ matrix.python-version }}
2828
- name: Install Poppler
2929
run: |
3030
sudo apt-get update
3131
sudo apt-get -y install poppler-utils
3232
- name: Setup virtual environment (no cache hit)
3333
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
3434
run: |
35-
python${{ env.PYTHON_VERSION }} -m venv .venv
35+
python${{ matrix.python-version }} -m venv .venv
3636
source .venv/bin/activate
3737
make install-ci
3838
3939
lint:
40+
strategy:
41+
matrix:
42+
python-version: ["3.9","3.10","3.11", "3.12"]
4043
runs-on: ubuntu-latest
4144
needs: setup
4245
steps:
@@ -45,13 +48,13 @@ jobs:
4548
id: virtualenv-cache
4649
with:
4750
path: .venv
48-
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/*.txt') }}
51+
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
4952
# NOTE(robinson) - This is a fallback in case the lint job does not find the cache.
5053
# We can take this out when we implement the fix in CORE-99
5154
- name: Setup virtual environment (no cache hit)
5255
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
5356
run: |
54-
python${{ env.PYTHON_VERSION }} -m venv .venv
57+
python${{ matrix.python-version }} -m venv .venv
5558
- name: Lint
5659
run: |
5760
source .venv/bin/activate
@@ -66,6 +69,9 @@ jobs:
6669
uses: ludeeus/action-shellcheck@master
6770

6871
test:
72+
strategy:
73+
matrix:
74+
python-version: ["3.9","3.10","3.11", "3.12"]
6975
runs-on: ubuntu-latest
7076
needs: [setup, lint]
7177
steps:
@@ -75,13 +81,13 @@ jobs:
7581
with:
7682
path: |
7783
.venv
78-
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/*.txt') }}
84+
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
7985
# NOTE(robinson) - This is a fallback in case the lint job does not find the cache.
8086
# We can take this out when we implement the fix in CORE-99
8187
- name: Setup virtual environment (no cache hit)
8288
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
8389
run: |
84-
python${{ env.PYTHON_VERSION }} -m venv .venv
90+
python${{ matrix.python-version }} -m venv .venv
8591
- name: Install Poppler
8692
run: |
8793
sudo apt-get update

0 commit comments

Comments
 (0)