From 23dff1aca90f90a24d0c35cb0120d74d9e0c62b0 Mon Sep 17 00:00:00 2001 From: Frej Drejhammar Date: Tue, 26 Dec 2023 15:59:44 +0100 Subject: [PATCH] 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 switched to `importlib` in #311). --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57efee7..1b4b9e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,20 +8,56 @@ on: branches: [master] jobs: - test: - name: Run test suite + test-earliest: + name: Run test suite on the earliest supported python version runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + fetch-depth: 1 + submodules: 'recursive' + uses: actions/setup-python@v5 + id: earliest + with: + python-version: '3.5' + check-latest: true + + - name: Run tests on 3.5 + run: echo '${{ steps.earliest.outputs.python-version }}' + run: make -C t + + test-latest: + name: Run test suite on the latest supported python version + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 with: fetch-depth: 1 submodules: 'recursive' + uses: actions/setup-python@v5 + id: latest + with: + python-version: '3.x' - - name: Run tests + - name: Run tests on 3.x + run: echo '${{ steps.latest.outputs.python-version }}' run: make -C t + code-quality: + name: Run code quality checks + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + submodules: 'recursive' + - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: