Skip to content

[python] Create and run nightly Python CI #3

[python] Create and run nightly Python CI

[python] Create and run nightly Python CI #3

name: 'Nightly: Python CI'
# Run builds daily at 2am UTC (10p EST) on weekdays for now, or manually
on:
# to help develop this CI suite, temporary --- start ---
push:
branches:
- main
paths:
- '.github/workflows/positron-python-ci.yml'
- '.github/workflows/positron-python-nightly-ci.yml'
- 'extensions/positron-python/**'
pull_request:
branches:
- main
paths:
- '.github/workflows/positron-python-ci.yml'
- '.github/workflows/positron-python-nightly-ci.yml'
- 'extensions/positron-python/**'
# to help develop this CI suite, temporary --- end ---
schedule:
- cron: "0 2 * * 1-5"
defaults:
run:
working-directory: 'extensions/positron-python'
env:
NODE_VERSION: '18.17.1'
PYTHON_VERSION: '3.10'
PROJECT_DIR: 'extensions/positron-python'
PYTHON_SRC_DIR: 'extensions/positron-python/python_files'
# Force a path with spaces and to test extension works in these scenarios
# Unicode characters are causing 2.7 failures so skip that for now.
special-working-directory: './path with spaces'
special-working-directory-relative: 'path with spaces'
jobs:
# Run full suite of upstream tests
vscode-python-tests:
name: Upstream 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 }}/${{ env.PROJECT_DIR}}
strategy:
fail-fast: false
matrix:
include:
# Python 3.8 and 3.12 are run per-PR, omitting those
- os: 'macos-latest'
python: '3.9'
- os: 'windows-latest'
python: '3.10'
- os: 'ubuntu-latest'
python: '3.11'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.special-working-directory-relative }}
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install specific pytest version
run: |
python -m pip install pytest
- name: Install specific pytest version
run: python -m pytest --version
- name: Install base Python requirements
run: 'python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --no-cache-dir --implementation py -r requirements.txt'
- name: Install test requirements
run: python -m pip install -r build/test-requirements.txt
- name: Run Python unit tests
run: python python_files/tests/run_all.py
# Install the latest releases of test dependencies
positron-ipykernel-tests-latest:
name: Test latest Positron IPyKernel
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: 'ubuntu-latest'
python: '3.8'
- os: 'macos-latest'
python: '3.9'
- os: 'windows-latest'
python: '3.10'
- os: 'ubuntu-latest'
python: '3.11'
- os: 'ubuntu-latest'
python: '3.12'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Install Positron IPyKernel requirements
run: python scripts/vendor.py
- name: Install latest versions Positron IPyKernel test requirements
run: python -m pip install --prefer-binary --upgrade -r python_files/positron/test-requirements.txt
- name: Run Positron IPyKernel unit tests
run: pytest python_files/positron