From 9368c0e75e0810524c1be2f3be6ef97bae7d9030 Mon Sep 17 00:00:00 2001 From: Yao You Date: Wed, 16 Oct 2024 09:26:27 -0500 Subject: [PATCH] chore: update ci to test more python version --- .github/workflows/ci.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e623b68..c25520e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,11 +6,11 @@ on: pull_request: branches: [ main ] -env: - PYTHON_VERSION: 3.9 - jobs: setup: + strategy: + matrix: + python-version: ["3.9","3.10","3.11", "3.12"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -19,12 +19,12 @@ jobs: with: path: | .venv - key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/*.txt') }} + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }} lookup-only: true - - name: Set up Python ${{ env.PYTHON_VERSION }} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: ${{ env.PYTHON_VERSION }} + python-version: ${{ matrix.python-version }} - name: Install Poppler run: | sudo apt-get update @@ -32,11 +32,14 @@ jobs: - name: Setup virtual environment (no cache hit) if: steps.virtualenv-cache.outputs.cache-hit != 'true' run: | - python${{ env.PYTHON_VERSION }} -m venv .venv + python${{ matrix.python-version }} -m venv .venv source .venv/bin/activate make install-ci lint: + strategy: + matrix: + python-version: ["3.9","3.10","3.11", "3.12"] runs-on: ubuntu-latest needs: setup steps: @@ -45,13 +48,13 @@ jobs: id: virtualenv-cache with: path: .venv - key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/*.txt') }} + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }} # NOTE(robinson) - This is a fallback in case the lint job does not find the cache. # We can take this out when we implement the fix in CORE-99 - name: Setup virtual environment (no cache hit) if: steps.virtualenv-cache.outputs.cache-hit != 'true' run: | - python${{ env.PYTHON_VERSION }} -m venv .venv + python${{ matrix.python-version }} -m venv .venv - name: Lint run: | source .venv/bin/activate @@ -66,6 +69,9 @@ jobs: uses: ludeeus/action-shellcheck@master test: + strategy: + matrix: + python-version: ["3.9","3.10","3.11", "3.12"] runs-on: ubuntu-latest needs: [setup, lint] steps: @@ -75,13 +81,13 @@ jobs: with: path: | .venv - key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/*.txt') }} + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }} # NOTE(robinson) - This is a fallback in case the lint job does not find the cache. # We can take this out when we implement the fix in CORE-99 - name: Setup virtual environment (no cache hit) if: steps.virtualenv-cache.outputs.cache-hit != 'true' run: | - python${{ env.PYTHON_VERSION }} -m venv .venv + python${{ matrix.python-version }} -m venv .venv - name: Install Poppler run: | sudo apt-get update