Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 30, 2025

Updates GitHub Actions workflows to use ubuntu-22.04 runners with Python 3.5.10 installed via pyenv, since actions/setup-python no longer supports Python 3.5.x on ubuntu-22.04.

Changes

Both workflows (.github/workflows/build-test.yml and .github/workflows/github-pages.yml):

  • Runner: ubuntu-20.04ubuntu-22.04
  • Python setup: Replaced actions/setup-python@v6 with:
    • Build dependencies installation using awalsh128/cache-apt-pkgs-action@latest for caching (libssl-dev, zlib1g-dev, etc.)
    • pyenv installation via pyenv.run
    • Python 3.5.10 compilation and global activation
  • Cache: Added actions/cache@v4 for $HOME/.pyenv/versions (key: ${{ runner.os }}-pyenv-3.5.10)

github-pages.yml deploy job:

  • Runner: ubuntu-20.04ubuntu-22.04

Both pyenv Python cache and apt packages cache significantly reduce build times on subsequent runs.

Original prompt

Update two GitHub Actions workflow files to run on ubuntu-22.04, install Python 3.5.10 using pyenv, and cache the pyenv-built Python at $HOME/.pyenv/versions.

Files to update (exact new contents to be written):

.github/workflows/build-test.yml:

name: Build Test

on:
push:
branches:
- '*'
- '!pelican'

permissions:
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout do repositório
uses: actions/checkout@v5
with:
submodules: recursive

  - name: Instala dependências de compilação
    run: |
      sudo apt-get update
      sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
        libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
        xz-utils tk-dev libffi-dev liblzma-dev

  - name: Cache pyenv versions
    uses: actions/cache@v4
    with:
      path: $HOME/.pyenv/versions
      key: ${{ runner.os }}-pyenv-3.5.10
      restore-keys: |
        ${{ runner.os }}-pyenv-

  - name: Instala pyenv e Python 3.5.10
    run: |
      curl https://pyenv.run | bash
      export PYENV_ROOT="$HOME/.pyenv"
      export PATH="$PYENV_ROOT/bin:$PATH"
      eval "$(pyenv init -)"
      pyenv install -s 3.5.10
      pyenv global 3.5.10
      python --version
      python -m pip install --upgrade pip setuptools wheel
  
  - name: Instala dependências
    run: pip install -r requirements.txt

  - name: Build do site
    run: make publish

.github/workflows/github-pages.yml:

name: GitHub Pages

on:
push:
branches:
- pelican

permissions:
contents: read

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout do repositório
uses: actions/checkout@v5
with:
submodules: recursive

  - name: Instala dependências de compilação
    run: |
      sudo apt-get update
      sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
        libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
        xz-utils tk-dev libffi-dev liblzma-dev

  - name: Cache pyenv versions
    uses: actions/cache@v4
    with:
      path: $HOME/.pyenv/versions
      key: ${{ runner.os }}-pyenv-3.5.10
      restore-keys: |
        ${{ runner.os }}-pyenv-

  - name: Instala pyenv e Python 3.5.10
    run: |
      curl https://pyenv.run | bash
      export PYENV_ROOT="$HOME/.pyenv"
      export PATH="$PYENV_ROOT/bin:$PATH"
      eval "$(pyenv init -)"
      pyenv install -s 3.5.10
      pyenv global 3.5.10
      python --version
      python -m pip install --upgrade pip setuptools wheel
  
  - name: Instala dependências
    run: pip install -r requirements.txt

  - name: Build do site
    run: make publish

  - name: Upload do site
    uses: actions/upload-pages-artifact@v4
    with:
      path: output/

deploy:
name: Deploy
needs: build
permissions:
pages: write
id-token: write
runs-on: ubuntu-22.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy no GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

Task instructions:

  • Create branch: update/workflows-python3.5-pyenv-ubuntu22.04
  • Commit message: "Use ubuntu-22.04 and install Python 3.5.10 via pyenv in GH Actions workflows (cache pyenv versions)"
  • Only modify the two files above; do not change anything else.
  • Push the branch and open a pull request against the repository default branch.
  • PR title: "Use ubuntu-22.04 and install Python 3.5.10 via pyenv in GitHub Actions workflows"
  • PR description: "This updates the two GitHub Actions workflows to run on ubuntu-22.04, to install Python 3.5.10 using pyenv, and to cache the built Python under $HOME/.pyenv/versions to speed up subsequent runs. The remaining steps are unchanged."

Do NOT modify other files. Provide the PR URL in the response after creating it.

This pull request was created as a result of the following prompt from Copilot chat.

Update two GitHub Actions workflow files to run on ubuntu-22.04, install Python 3.5.10 using pyenv, and cache the pyenv-built Python at $HOME/.pyenv/versions.

Files to update (exact new contents to be written):

.github/workflows/build-test.yml:

name: Build Test

on:
push:
branches:
- '*'
- '!pelican'

permissions:
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout do repositório
uses: actions/checkout@v5
with:
submodules: recursive

  - name: Instala dependências de compilação
    run: |
      sudo apt-get update
      sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
        libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
        xz-utils tk-dev libffi-dev liblzma-dev

  - name: Cache pyenv versions
    uses: actions/cache@v4
    with:
      path: $HOME/.pyenv/versions
      key: ${{ runner.os }}-pyenv-3.5.10
      restore-keys: |
        ${{ runner.os }}-pyenv-

  - name: Instala pyenv e Python 3.5.10
    run: |
      curl https://pyenv.run | bash
      export PYENV_ROOT="$HOME/.pyenv"
      export PATH="$PYENV_ROOT/bin:$PATH"
      eval "$(pyenv init -)"
      pyenv install -s 3.5.10
      pyenv global 3.5.10
      python --version
      python -m pip install --upgrade pip setuptools wheel
  
  - name: Instala dependências
    run: pip install -r requirements.txt

  - name: Build do site
    run: make publish

.github/workflows/github-pages.yml:

name: GitHub Pages

on:
push:
branches:
- pelican

permissions:
contents: read

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout do repositório
uses: actions/checkout@v5
with:
submodules: recursive

  - name: Instala dependências de compilação
    run: |
      sudo apt-get update
      sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
        libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
        xz-utils tk-dev libffi-dev liblzma-dev

  - name: Cache pyenv versions
    uses: actions/cache@v4
    with:
      path: $HOME/.pyenv/versions
      key: ${{ runner.os }}-pyenv-3.5.10
      restore-keys: |
        ${{ runner.os }}-pyenv-

  - name: Instala pyenv e Python 3.5.10
    run: |
      curl https://pyenv.run | bash
      export PYENV_ROOT="$HOME/.pyenv"
      export PATH="$PYENV_ROOT/bin:$PATH"
      eval "$(pyenv init -)"
      pyenv install -s 3.5.10
      pyenv global 3.5.10
      python --version
      python -m pip install --upgrade pip setuptools wheel
  
  - name: Instala dependências
    run: pip install -r requirements.txt

  - name: Build do site
    run: make publish

  - name: Upload do site
    uses: actions/upload-pages-artifact@v4
    with:
      path: output/

deploy:
name: Deploy
needs: build
permissions:
pages: write
id-token: write
runs-on: ubuntu-22.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy no GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

Task instructions:

  • Create branch: update/workflows-python3.5-pyenv-ubuntu22.04
  • Commit message: "Use ubuntu-22.04 and install Python 3.5.10 via pyenv in GH Actions workflows (cache pyenv versions)"
  • Only modify the two files above; do not change anything else.
  • Push the branch and open a pull request against the repository default branch.
  • PR title: "Use ubuntu-22.04 and install Python 3.5.10 via pyenv in GitHub Actions workflows"
  • PR description: "This updates the two GitHub Actions workflows to run on ubuntu-22.04, to install Python 3.5.10 using pyenv, and to cache the built Python under $HOME/.pyenv/versions to speed up subsequent runs. The remaining steps are unchanged."

Do NOT modify other files. Provide the PR URL in the response after creating it.


💡 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.

…rkflows (cache pyenv versions)

Co-authored-by: luzfcb <807599+luzfcb@users.noreply.github.com>
Copilot AI changed the title [WIP] Update GitHub Actions to use Ubuntu 22.04 and Python 3.5.10 Use ubuntu-22.04 and install Python 3.5.10 via pyenv in GitHub Actions workflows Oct 30, 2025
Copilot AI requested a review from luzfcb October 30, 2025 22:27
Copilot finished work on behalf of luzfcb October 30, 2025 22:27
@luzfcb
Copy link
Member

luzfcb commented Oct 30, 2025

@copilot also use awalsh128/cache-apt-pkgs-action instead of apt-get to install the apt packages

      - uses: awalsh128/cache-apt-pkgs-action@latest
        with:
          packages: <package1> <package2>
          version: 1.0

Co-authored-by: luzfcb <807599+luzfcb@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 30, 2025

@copilot also use awalsh128/cache-apt-pkgs-action instead of apt-get to install the apt packages

...

Updated both workflows to use awalsh128/cache-apt-pkgs-action@latest for caching build dependencies. This will speed up subsequent runs by caching the apt packages. (328abcc)

Copilot finished work on behalf of luzfcb October 30, 2025 22:34
@luzfcb luzfcb marked this pull request as ready for review October 30, 2025 22:35
@luzfcb luzfcb merged commit 621fcc4 into pelican Oct 30, 2025
@luzfcb luzfcb deleted the copilot/update-github-actions-workflow branch October 30, 2025 22:36
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