Skip to content

Test

Test #248

Workflow file for this run

name: Test
on:
workflow_dispatch:
jobs:
main:
strategy:
matrix:
_:
- python: 3.13-dev
docker: docker
- python: 3.8.12 # Test https://docs.python.org/3/library/tarfile.html#supporting-older-python-versions
docker: podman
suite:
- tests/test_mirror.py tests/test_docker.py tests/test_project.py tests/test_desktopfile.py tests/test_docs.py
- tests/test_alpine.py tests/test_completion.py
- tests/test_arch.py tests/test_configuration.py
- tests/test_manjaro.py
- tests/test_fedora.py
- tests/test_void.py
- tests/test_debian.py
- tests/test_ubuntu.py
fail-fast: false
runs-on: ubuntu-latest
env:
FORCE_COLOR: 1
POLYCOTYLUS_VERBOSITY: 1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix._.python }}
- name: Install recent podman
if: matrix._.docker == 'podman'
# Even the latest version of podman available on the latest version of
# Ubuntu is hopelessly out of date. Install from the semi-official
# PPA. https://podman.io/docs/installation#ubuntu
run: |
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
sudo apt-get update
sudo apt-get -y install podman
- run: |
if grep -E 'alpine|manjaro|ubuntu' <<< '${{ matrix.suite }}' ; then
sudo apt-get update
sudo apt-get install -y qemu-user-static
fi
- run: sudo apt-get update && sudo apt-get install -y fish
- run: python -m pip install -U pip setuptools wheel
- run: pip install -e .[test]
- run: polycotylus --configure docker=${{ matrix._.docker }}
- run: pytest --cov-fail-under=0 -sv ${{ matrix.suite }}
- run: mv .coverage .coverage-$(uuidgen)
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ strategy.job-index }}
path: .coverage-*
include-hidden-files: true
if-no-files-found: error
coverage:
runs-on: ubuntu-latest
needs: main
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12 # must match latest version tested against
- run: pip install coverage
- uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- run: coverage combine .coverage-*
- run: coverage report