tests: Change github actions workflow to test with podman 5.4.2
#1102
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ] | |
podman-version: ['4.3.1', '5.4.2'] | |
runs-on: ubuntu-latest | |
container: | |
image: "docker.io/library/python:${{ matrix.python-version }}-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@v4 | |
- name: Install podman4.3.1 | |
if: matrix.podman-version == '4.3.1' | |
run: | | |
set -e | |
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y podman | |
- name: Install dependencies for dpkg | |
if: matrix.podman-version == '5.4.2' | |
shell: bash | |
run: | | |
DEBIAN_FRONTEND=noninteractive apt update -y | |
DEBIAN_FRONTEND=noninteractive apt-get install -y conmon crun golang-github-containers-common netavark libgpgme11 libsubid4 | |
- name: Download necessary .deb files from man-compose-test-data repository | |
if: matrix.podman-version == '5.4.2' | |
shell: bash | |
run: | | |
BASE_URL="https://raw.githubusercontent.com/mokibit/podman-compose-test-data/main/deb_files/podman-5.4.2" | |
FILES=( | |
"podman_5.4.2+composetest-1_amd64.deb" | |
"podman-docker_5.4.2+composetest-1_amd64.deb" | |
"podman-remote_5.4.2+composetest-1_amd64.deb" | |
) | |
for FILE in "${FILES[@]}"; do | |
URL="${BASE_URL}/${FILE}" | |
echo "Downloading: $FILE" | |
curl -L -f -O "$URL" || { echo "Failed to download $FILE"; exit 1; } | |
done | |
- name: Install podman v5.4.2 from .deb packages | |
run: | | |
dpkg -i *.deb | |
apt-get install -f -y | |
- name: Verify podman installation | |
run: | | |
podman --version | |
podman-remote --version | |
podman-docker version || echo "podman-docker not available" | |
- name: Install other test dependencies | |
run: | | |
set -e | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r test-requirements.txt | |
- name: Run integration tests | |
run: | | |
python -m unittest discover -v tests/integration | |
env: | |
TESTS_DEBUG: 1 | |
- name: Run unit tests | |
run: | | |
coverage run --source podman_compose -m unittest discover tests/unit | |
- name: Report coverage | |
run: | | |
coverage combine | |
coverage report --format=markdown | tee -a $GITHUB_STEP_SUMMARY |