From 72baed636e58eb8fb6ce430928d185779aa8e147 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Fri, 8 Mar 2024 11:51:01 +0200 Subject: [PATCH] github: Run actions on python:3.11-bookworm This ensures a stable environment for tests even when ubuntu-latest changes. Also, the dependency on setup-python action has been removed. That action supports only Ubuntu and limited architectures. Signed-off-by: Povilas Kanapickas --- .github/workflows/pylint.yml | 9 +++++---- .github/workflows/pytest.yml | 13 +++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 35a62077..19b6752f 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -7,12 +7,13 @@ on: jobs: lint-ruff: runs-on: ubuntu-latest + container: + image: docker.io/library/python:3.11-bookworm + # cgroupns needed to address the following error: + # write /sys/fs/cgroup/cgroup.subtree_control: operation not supported + options: --privileged --cgroupns=host steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: "3.11" - name: Analysing the code with ruff run: | pip install -r test-requirements.txt diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index bb2498f6..a9a6f558 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -10,16 +10,17 @@ on: jobs: test: runs-on: ubuntu-latest - + container: + image: docker.io/library/python:3.11-bookworm + # cgroupns needed to address the following error: + # write /sys/fs/cgroup/cgroup.subtree_control: operation not supported + options: --privileged --cgroupns=host steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: "3.10" - name: Install dependencies run: | - sudo apt update && sudo apt install -y podman + set -e + apt update && apt install -y podman python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi