Skip to content

Fix Django CI workflow: Python versions, missing checkout, duplicate setup-python#8

Merged
erokemwa merged 2 commits intomainfrom
copilot/fix-django-ci-workflow-errors
Mar 9, 2026
Merged

Fix Django CI workflow: Python versions, missing checkout, duplicate setup-python#8
erokemwa merged 2 commits intomainfrom
copilot/fix-django-ci-workflow-errors

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

The Django CI workflow was broken on ubuntu-latest (Ubuntu 24.04) due to three compounding issues: EOL Python versions in the matrix, a missing checkout step, and two conflicting setup-python steps where the matrix version was never actually applied.

Changes

  • Matrix: Replaced ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] with ["3.9", "3.10", "3.11", "3.12"] — 3.7/3.8 are EOL and absent from the Ubuntu 24.04 tool cache
  • Checkout: Added actions/checkout@v4 as the first step — previously missing entirely
  • Setup Python: Replaced two conflicting steps (one hardcoded 3.10 via @v4, one matrix-driven via @v3) with a single actions/setup-python@v5 using ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
  uses: actions/setup-python@v5
  with:
    python-version: ${{ matrix.python-version }}
Original prompt

Problem

The Django CI GitHub Actions workflow at .github/workflows/django.yml is failing with the following error:

The version '3.1' with architecture 'x64' was not found for Ubuntu 24.04.

There are multiple issues in the current workflow:

Issue 1: Python 3.7 and 3.8 are unsupported on ubuntu-latest

ubuntu-latest now maps to Ubuntu 24.04, which does not support Python 3.7 or 3.8. Those versions are end-of-life and have been removed from the GitHub-hosted runner tool cache.

Issue 2: Duplicate and conflicting setup-python steps

There are two setup-python steps — the first one hardcodes python-version: 3.10 using @v4, and the second uses @v3 with ${{ matrix.python-version }}. The matrix version is never properly applied.

Issue 3: Missing actions/checkout step

There is no actions/checkout step, so the code is never checked out before running pip install -r requirements.txt or python manage.py test.


Fix

Update .github/workflows/django.yml with the following corrected content:

name: Django CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12"]

    steps:
    - uses: actions/checkout@v4

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install Dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt

    - name: Run Tests
      run: |
        python manage.py test

Summary of changes:

Issue Fix
Python 3.7 and 3.8 not available on Ubuntu 24.04 Removed them; matrix now uses 3.9, 3.10, 3.11, 3.12
Duplicate setup-python steps Merged into a single step using ${{ matrix.python-version }}
Outdated action versions (@v3, @v4) Updated to actions/setup-python@v5
Missing checkout step Added actions/checkout@v4 as the first step

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…up-python

Co-authored-by: erokemwa <111133254+erokemwa@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Django CI GitHub Actions workflow errors Fix Django CI workflow: Python versions, missing checkout, duplicate setup-python Mar 9, 2026
@erokemwa erokemwa marked this pull request as ready for review March 9, 2026 12:28
@erokemwa erokemwa merged commit 67fc6bd into main Mar 9, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants