Skip to content

Commit

Permalink
Add python 3.8 and 3x specific runs
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig committed Sep 18, 2023
1 parent a9d4df9 commit 4cb32d0
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 16 deletions.
46 changes: 40 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,45 @@ jobs:
version: 1.1.308
working-directory: 'pythonFiles'

### Non-smoke tests
python-tests:
name: Python Tests
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ env.special-working-directory }}
strategy:
fail-fast: false
matrix:
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the Unix case.
os: [ubuntu-latest, windows-latest]
# Run the tests on the oldest and most recent versions of Python.
python: ['3.8', '3.x']

steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.special-working-directory-relative }}

- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install base Python requirements
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/python" --no-cache-dir --implementation py'

- name: Install test requirements
run: python -m pip install --upgrade -r build/test-requirements.txt

- name: Run Python unit tests
run: python pythonFiles/tests/run_all.py

tests:
name: Tests
if: github.repository == 'microsoft/vscode-python'
Expand All @@ -122,7 +160,7 @@ jobs:
# and we assume that Ubuntu is enough to cover the UNIX case.
os: [ubuntu-latest, windows-latest]
python: ['3.x']
test-suite: [ts-unit, python-unit, venv, single-workspace, multi-workspace, debugger, functional]
test-suite: [ts-unit, venv, single-workspace, multi-workspace, debugger, functional]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -268,10 +306,6 @@ jobs:
run: npm run test:unittests
if: matrix.test-suite == 'ts-unit' && startsWith(matrix.python, '3.')

- name: Run Python unit tests
run: python pythonFiles/tests/run_all.py
if: matrix.test-suite == 'python-unit'

# The virtual environment based tests use the `testSingleWorkspace` set of tests
# with the environment variable `TEST_FILES_SUFFIX` set to `testvirtualenvs`,
# which is set in the "Prepare environment for venv tests" step.
Expand Down
52 changes: 42 additions & 10 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,47 @@ jobs:
version: 1.1.308
working-directory: 'pythonFiles'

### Non-smoke tests

python-tests:
name: Python Tests
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ env.special-working-directory }}
strategy:
fail-fast: false
matrix:
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the Unix case.
os: [ubuntu-latest, windows-latest]
# Run the tests on the oldest and most recent versions of Python.
python: ['3.8', '3.x']

steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.special-working-directory-relative }}

- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Install base Python requirements
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/python" --no-cache-dir --implementation py'

- name: Install test requirements
run: python -m pip install --upgrade -r build/test-requirements.txt

- name: Run Python unit tests
run: python pythonFiles/tests/run_all.py


tests:
name: Tests
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
Expand All @@ -96,7 +136,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
# Run the tests on the oldest and most recent versions of Python.
python: ['3.x']
test-suite: [ts-unit, python-unit, venv, single-workspace, debugger, functional]
test-suite: [ts-unit, venv, single-workspace, debugger, functional]

steps:
- name: Checkout
Expand Down Expand Up @@ -139,14 +179,12 @@ jobs:
with:
requirements-file: '"${{ env.special-working-directory-relative }}/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/python" --no-cache-dir --implementation py'
if: startsWith(matrix.python, 3.)

- name: Install Jedi requirements
uses: brettcannon/pip-secure-install@v1
with:
requirements-file: '"${{ env.special-working-directory-relative }}/pythonFiles/jedilsp_requirements/requirements.txt"'
options: '-t "${{ env.special-working-directory-relative }}/pythonFiles/lib/jedilsp" --no-cache-dir --implementation py'
if: startsWith(matrix.python, 3.)

- name: Install test requirements
run: python -m pip install --upgrade -r build/test-requirements.txt
Expand Down Expand Up @@ -243,12 +281,6 @@ jobs:
run: npm run test:unittests
if: matrix.test-suite == 'ts-unit' && startsWith(matrix.python, 3.)

# Run the Python tests in our codebase.
- name: Run Python unit tests
run: |
python pythonFiles/tests/run_all.py
if: matrix.test-suite == 'python-unit'

# The virtual environment based tests use the `testSingleWorkspace` set of tests
# with the environment variable `TEST_FILES_SUFFIX` set to `testvirtualenvs`,
# which is set in the "Prepare environment for venv tests" step.
Expand Down

0 comments on commit 4cb32d0

Please sign in to comment.