Skip to content

Commit f205e6f

Browse files
authored
build: add Python 3.9 and Python 3.10 to the CI test job (#235)
* add python 3.9 3.10 * run on branch * run on branch * run on branch * run on branch * revert * update all jobs * update all jobs * update all jobs
1 parent 7472e1b commit f205e6f

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ on:
99
pull_request:
1010
branches: [ main ]
1111

12-
env:
13-
PYTHON_VERSION: 3.8
1412

1513
jobs:
1614
setup:
15+
strategy:
16+
matrix:
17+
python-version: ["3.8","3.9","3.10"]
1718
runs-on: ubuntu-latest
1819
env:
1920
NLTK_DATA: ${{ github.workspace }}/nltk_data
@@ -25,19 +26,22 @@ jobs:
2526
path: |
2627
.venv
2728
nltk_data
28-
key: unstructured-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/*.txt') }}
29-
- name: Set up Python ${{ env.PYTHON_VERSION }}
29+
key: unstructured-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
30+
- name: Set up Python ${{ matrix.python-version }}
3031
uses: actions/setup-python@v4
3132
with:
32-
python-version: ${{ env.PYTHON_VERSION }}
33+
python-version: ${{ matrix.python-version }}
3334
- name: Setup virtual environment (no cache hit)
3435
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
3536
run: |
36-
python${{ env.PYTHON_VERSION }} -m venv .venv
37+
python${{ matrix.python-version }} -m venv .venv
3738
source .venv/bin/activate
3839
make install-ci
3940
4041
lint:
42+
strategy:
43+
matrix:
44+
python-version: ["3.8","3.9","3.10"]
4145
runs-on: ubuntu-latest
4246
needs: setup
4347
steps:
@@ -46,17 +50,17 @@ jobs:
4650
id: virtualenv-cache
4751
with:
4852
path: .venv
49-
key: unstructured-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/*.txt') }}
53+
key: unstructured-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
5054
# NOTE(robinson) - This is a fallback in case the lint job does not find the cache.
5155
# We can take this out when we implement the fix in CORE-99
52-
- name: Set up Python ${{ env.PYTHON_VERSION }}
56+
- name: Set up Python ${{ matrix.python-version }}
5357
uses: actions/setup-python@v4
5458
with:
55-
python-version: ${{ env.PYTHON_VERSION }}
59+
python-version: ${{ matrix.python-version }}
5660
- name: Setup virtual environment (no cache hit)
5761
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
5862
run: |
59-
python${{ env.PYTHON_VERSION }} -m venv .venv
63+
python${{ matrix.python-version }} -m venv .venv
6064
source .venv/bin/activate
6165
make install-ci
6266
- name: Lint
@@ -72,6 +76,9 @@ jobs:
7276
uses: ludeeus/action-shellcheck@master
7377

7478
test:
79+
strategy:
80+
matrix:
81+
python-version: ["3.8","3.9","3.10"]
7582
runs-on: ubuntu-latest
7683
env:
7784
NLTK_DATA: ${{ github.workspace }}/nltk_data
@@ -84,13 +91,13 @@ jobs:
8491
path: |
8592
.venv
8693
nltk_data
87-
key: unstructured-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/*.txt') }}
94+
key: unstructured-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
8895
# NOTE(robinson) - This is a fallback in case the lint job does not find the cache.
8996
# We can take this out when we implement the fix in CORE-99
9097
- name: Setup virtual environment (no cache hit)
9198
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
9299
run: |
93-
python${{ env.PYTHON_VERSION }} -m venv .venv
100+
python${{ matrix.python-version}} -m venv .venv
94101
source .venv/bin/activate
95102
make install-ci
96103
- name: Test

0 commit comments

Comments
 (0)