Skip to content

Commit

Permalink
Run tests with multiple Python versions
Browse files Browse the repository at this point in the history
Run the CI tests with both the earliest supported Python version and
the latest stable release.

The intent is to quickly notice when new features require adjusting
the oldest supported Python version and also detect when the latest
stable version breaks old code (as when 3.12 removed `imp` and we
switched to `importlib` in #311).
  • Loading branch information
frej committed Dec 26, 2023
1 parent c8fa290 commit 0cc0db4
Showing 1 changed file with 52 additions and 5 deletions.
57 changes: 52 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,58 @@ on:
branches: [master]

jobs:
test:
name: Run test suite
test-earliest:
name: Run test suite on the earliest supported Python version
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
name: Checkout repository
with:
fetch-depth: 1
submodules: 'recursive'
- uses: actions/setup-python@v5
id: earliest
with:
python-version: '3.5.x'
check-latest: true

- name: Report selected version
run: echo '${{ steps.earliest.outputs.python-version }}'

- name: Look for hg
run: hg --version

- name: Run tests on earliest supported Python version
run: make -C t

test-latest:
name: Run test suite on the latest supported python version
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
name: Checkout repository
with:
fetch-depth: 1
submodules: 'recursive'
- uses: actions/setup-python@v5
id: latest
with:
python-version: '3.x'
check-latest: true

- name: Report selected version
run: echo '${{ steps.latest.outputs.python-version }}'

- name: Look for hg
run: hg --version

- name: Run tests on 3.x
run: make -C t

code-quality:
name: Run code quality checks
runs-on: ubuntu-latest

steps:
Expand All @@ -19,9 +69,6 @@ jobs:
fetch-depth: 1
submodules: 'recursive'

- name: Run tests
run: make -C t

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand Down

0 comments on commit 0cc0db4

Please sign in to comment.