Skip to content

Create cleaners/Makefile #57

Create cleaners/Makefile

Create cleaners/Makefile #57

Workflow file for this run

name: Run tests on Linux
on:
push:
branches:
- '**'
paths-ignore:
- 'bleachbit.spec'
- 'debian/**'
- 'doc/**'
- 'po/**'
- 'README.md'
- 'windows/**'
pull_request: # Run on all pull requests
paths-ignore:
- 'bleachbit.spec'
- 'debian/**'
- 'doc/**'
- 'po/**'
- 'README.md'
- 'windows/**'
# 2025-05-01: ubuntu-latest is currently 24.04, and its native
# python version is 3.12.
# native python for 22.04 is 3.10.
jobs:
test:
timeout-minutes: 25
strategy:
matrix:
python-version: ['3.9', '3.13', '3.14']
include:
- python-version: '3.9'
ubuntu-version: ubuntu-22.04
python-extra-dep: ''
pygobject-version: '<3.51.0'
test_timeout_minutes: 20
- python-version: '3.13'
ubuntu-version: ubuntu-latest
python-extra-dep: 'libgirepository-2.0-dev'
pygobject-version: ''
test_timeout_minutes: 6
- python-version: '3.14'
ubuntu-version: ubuntu-latest
python-extra-dep: 'libgirepository-2.0-dev'
pygobject-version: ''
test_timeout_minutes: 6
runs-on: ${{ matrix.ubuntu-version }}
env:
COVERAGE: "coverage run --include='bleachbit/*'"
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
appstream \
dbus \
dbus-x11 \
gettext \
gir1.2-gtk-3.0 \
gir1.2-notify-0.7 \
gnome-keyring \
libcairo2-dev \
libgirepository1.0-dev \
libnotify-bin \
libxml2-utils \
notification-daemon \
xvfb \
${{ matrix.python-extra-dep }}
# for tests.TestLanguage
sudo locale-gen es_ES.UTF-8
sudo locale-gen pl_PL.UTF-8
sudo locale-gen en_AU.UTF-8
sudo update-locale
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update Python packages
run: |
pip list
python -m pip install --upgrade pip
- name: Install Python dependencies
run: |
pip install coverage coveralls appveyor-artifacts -r requirements.txt
if [ "${{ matrix.pygobject-version }}" != "" ]; then
pip install "PyGObject${{ matrix.pygobject-version }}"
fi
if [ "${{ matrix.python-version }}" == "3.14" ]; then
pip install pytest pytest-xdist
fi
- name: Generate Revision.py
run: |
echo "revision = \"`git rev-parse --short HEAD`\"" > bleachbit/Revision.py
echo "build_number = \"${{ github.run_number }}\"" >> bleachbit/Revision.py
- name: Generate translations
run: make -C po local bleachbit.pot
- name: Run tests (regular and sudo)
timeout-minutes: ${{ matrix.test_timeout_minutes }}
run: |
export DISPLAY=":1.0"
export $(dbus-launch)
sudo Xvfb :1 -screen 0 800x600x24 &
sleep 5
if [ "${{ matrix.python-version }}" == "3.14" ]; then
dbus-run-session -- bash -c '/usr/lib/notification-daemon/notification-daemon & sleep 2 && xvfb-run -a bash -c "PYTHONPATH=. pytest -n auto"'
else
dbus-run-session -- bash -c '/usr/lib/notification-daemon/notification-daemon & sleep 2 && xvfb-run -a bash -c "make tests && make tests-with-sudo"'
fi
# appveyor-artifacts does not work with Python 3.13, and running once
# is enough.
- name: Combine Linux and Windows coverage, upload to Coveralls
if: matrix.python-version == '3.9'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Linux-only coverage before combine:"
coverage report
mv .coverage .coverage.ubuntu
appveyor-artifacts -o az0 -n bleachbit -m -c ${{ github.sha }} download
mv .coverage .coverage.windows
echo "Combined coverage:"
coverage combine
coverage report
coveralls