Skip to content

Commit

Permalink
Update Python versions for build and testing.
Browse files Browse the repository at this point in the history
* All builds are Python 3.11
* macOS and Windows testing updated to Python 3.11
* Linux testing updated to 3.9, 3.10, and 3.12
* File tests updated to 3.9-3.12
* SSH debugging option added to all workflow dispatches
  • Loading branch information
mrclary committed Dec 14, 2024
1 parent 80f6954 commit 1398a54
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 12 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build-subrepos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ on:
type: string

workflow_dispatch:
inputs:
ssh:
description: 'Enable ssh debugging'
required: false
default: false
type: boolean

concurrency:
group: build-subrepos-${{ inputs.branch || github.ref_name }}
Expand All @@ -30,15 +36,14 @@ jobs:
matrix:
os: [ubuntu-latest]
pkg: [python-lsp-server, qtconsole, spyder-kernels]
python-version: ['3.11']
include:
- python-version: '3.11'
- cache-arch: noarch
- os: ubuntu-latest
pkg: spyder-kernels
cache-arch: unix
- os: windows-latest
pkg: spyder-kernels
python-version: '3.11'
cache-arch: win-64
defaults:
run:
Expand All @@ -48,6 +53,13 @@ jobs:
pkg: ${{ matrix.pkg }}

steps:
- name: Setup Remote SSH Connection
if: env.ENABLE_SSH == 'true'
uses: mxschmitt/action-tmate@v3
timeout: 60
with:
detached: true

- name: Checkout Code
uses: actions/checkout@v4
with:
Expand Down
30 changes: 25 additions & 5 deletions .github/workflows/test-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ on:
workflow_call:

workflow_dispatch:
inputs:
ssh:
# github_cli: gh workflow run test-files.yml --ref <branch> -f ssh=true
description: 'Enable ssh debugging'
required: false
default: false
type: boolean

concurrency:
group: test-files-${{ github.ref }}
Expand All @@ -61,25 +68,37 @@ jobs:
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.9', '3.10']
PYTHON_VERSION: ['3.9', '3.10', '3.11', '3.12']
timeout-minutes: 30

steps:
- name: Setup Remote SSH Connection
if: env.ENABLE_SSH == 'true'
uses: mxschmitt/action-tmate@v3
timeout: 60
with:
detached: true

- name: Checkout Pull Requests
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Checkout Push
if: github.event_name != 'pull_request'
uses: actions/checkout@v4

- name: Fetch branches
if: github.event_name == 'pull_request'
run: git fetch --prune --unshallow

- name: Install dependencies
shell: bash
run: |
sudo apt-get update --fix-missing
sudo apt-get install -qq pyqt5-dev-tools libxcb-xinerama0 xterm --fix-missing
- name: Cache conda
uses: actions/cache@v4
env:
Expand All @@ -88,11 +107,13 @@ jobs:
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-cacheconda-installconda-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.yml') }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-cachepip-installconda-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.py') }}

- name: Create conda test environment
uses: mamba-org/setup-micromamba@v1
with:
Expand All @@ -101,18 +122,17 @@ jobs:
environment-name: test
cache-downloads: true
create-args: python=${{ matrix.PYTHON_VERSION }}

- name: Install additional dependencies
shell: bash -l {0}
run: bash -l .github/scripts/install.sh

- name: Show test environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Run file tests
shell: bash -l {0}
run: xvfb-run --auto-servernum .github/scripts/modules_test.sh || xvfb-run --auto-servernum .github/scripts/modules_test.sh
# Uncomment this to debug the CI job
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
22 changes: 17 additions & 5 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,35 +76,37 @@ jobs:
fail-fast: false
matrix:
INSTALL_TYPE: ['pip', 'conda']
PYTHON_VERSION: ['3.8', '3.10']
PYTHON_VERSION: ['3.9', '3.10', '3.12']
TEST_TYPE: ['fast', 'slow']
exclude:
# Only test Python 3.8 with pip because Conda-forge will drop it soon
- INSTALL_TYPE: 'conda'
PYTHON_VERSION: '3.8'
timeout-minutes: 90

steps:
- name: Setup Remote SSH Connection
if: env.ENABLE_SSH == 'true'
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
with:
detached: true

- name: Checkout Pull Requests
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Checkout Push
if: github.event_name != 'pull_request'
uses: actions/checkout@v4

- name: Fetch branches
run: git fetch --prune --unshallow

- name: Install dependencies
shell: bash
run: |
sudo apt-get update --fix-missing
sudo apt-get install -qq pyqt5-dev-tools libxcb-xinerama0 xterm --fix-missing
- name: Cache conda
uses: actions/cache@v4
env:
Expand All @@ -113,11 +115,13 @@ jobs:
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.yml') }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.py') }}

- name: Create conda test environment
if: env.USE_CONDA == 'true'
uses: mamba-org/setup-micromamba@v1
Expand All @@ -127,6 +131,7 @@ jobs:
environment-name: test
cache-downloads: true
create-args: python=${{ matrix.PYTHON_VERSION }}

- name: Create pip test environment
if: env.USE_CONDA != 'true'
uses: mamba-org/setup-micromamba@v1
Expand All @@ -138,31 +143,37 @@ jobs:
condarc: |
channels:
- conda-forge
- name: Install additional dependencies
shell: bash -l {0}
run: bash -l .github/scripts/install.sh

- name: Show conda test environment
if: env.USE_CONDA == 'true'
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Show pip test environment
if: env.USE_CONDA != 'true'
shell: bash -l {0}
run: |
micromamba info
micromamba list
pip list
- name: Run manifest checks
shell: bash -l {0}
run: check-manifest

- name: Run tests with gdb
if: env.USE_GDB == 'true'
shell: bash -l {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: xvfb-run --auto-servernum gdb -return-child-result -batch -ex r -ex py-bt --args python runtests.py -s

- name: Run tests
shell: bash -l {0}
env:
Expand All @@ -173,6 +184,7 @@ jobs:
.github/scripts/run_tests.sh || \
.github/scripts/run_tests.sh || \
.github/scripts/run_tests.sh
- name: Coverage
uses: codecov/codecov-action@v4
with:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/test-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,28 @@ jobs:
PYTHON_VERSION: ['3.11']
TEST_TYPE: ['fast', 'slow']
timeout-minutes: 90

steps:
- name: Setup Remote SSH Connection
if: env.ENABLE_SSH == 'true'
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
with:
detached: true

- name: Checkout Pull Requests
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Checkout Push
if: github.event_name != 'pull_request'
uses: actions/checkout@v4

- name: Fetch branches
run: git fetch --prune --unshallow

- name: Cache conda
uses: actions/cache@v4
env:
Expand All @@ -103,16 +108,19 @@ jobs:
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.yml') }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.py') }}

- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: false
python-version: ${{ matrix.PYTHON_VERSION }}

- name: Create conda test environment
uses: mamba-org/setup-micromamba@v1
with:
Expand All @@ -121,17 +129,21 @@ jobs:
environment-name: test
cache-downloads: true
create-args: python=${{ matrix.PYTHON_VERSION }}

- name: Install additional dependencies
shell: bash -l {0}
run: bash -l .github/scripts/install.sh

- name: Show test environment
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Run manifest checks
shell: bash -l {0}
run: check-manifest

- name: Run tests
shell: bash -l {0}
env:
Expand All @@ -142,6 +154,7 @@ jobs:
.github/scripts/run_tests.sh || \
.github/scripts/run_tests.sh || \
.github/scripts/run_tests.sh
- name: Coverage
uses: codecov/codecov-action@v4
with:
Expand Down
Loading

0 comments on commit 1398a54

Please sign in to comment.