Run tests with multiple Python versions

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
witched to `importlib` in #311).
This commit is contained in:
Frej Drejhammar
2023-12-27 13:12:12 +01:00
parent d4298a0906
commit 2476d08517
3 changed files with 67 additions and 5 deletions

1
.github/requirements-earliest.txt vendored Normal file
View File

@@ -0,0 +1 @@
mercurial==5.2

2
.github/requirements-latest.txt vendored Normal file
View File

@@ -0,0 +1,2 @@
mercurial

View File

@@ -8,8 +8,70 @@ 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.7.x'
check-latest: true
cache: 'pip'
cache-dependency-path: '**/requirements-earliest.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .github/requirements-earliest.txt
- name: Report selected versions
run: |
echo Selected '${{ steps.earliest.outputs.python-version }}'
./hg-fast-export.sh --debug
- 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
cache: 'pip'
cache-dependency-path: '**/requirements-latest.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .github/requirements-latest.txt
- name: Report selected version
run: |
echo Selected '${{ steps.latest.outputs.python-version }}'
./hg-fast-export.sh --debug
- name: Run tests on 3.x
run: make -C t
code-quality:
name: Run code quality checks
runs-on: ubuntu-latest
steps:
@@ -19,9 +81,6 @@ jobs:
fetch-depth: 1
submodules: 'recursive'
- name: Run tests
run: make -C t
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with: