Prepare for 3.0.3 release #220
Workflow file for this run
This file contains 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: Testing | |
on: [push, pull_request] | |
jobs: | |
test: | |
# This runs the test suite. Since we need some system dependencies | |
# (e.g. pygobject) that cannot easily be installed inside a | |
# virtualenv using pip (that requires installing a dozen -dev | |
# packages and building parts of pygobject from source, which makes | |
# things way too complicated), this just runs with the Ubuntu system | |
# python (e.g. not using the standard setup-python action, which | |
# sets up a virtualenv). | |
name: Run test suite | |
strategy: | |
# Complete all combinations, even if one fails | |
fail-fast: false | |
matrix: | |
include: | |
# Test 3.5, which is our minimum version, on 16.04 since the | |
# latest Ubuntu does not have it. | |
- os: ubuntu-16.04 | |
python-version: 3.5 | |
# On the latest ubuntu, just test the default 3.x version. | |
- os: ubuntu-latest | |
python-version: 3 | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Prepare repo | |
uses: actions/checkout@v2 | |
- name: Install system packages | |
run: | | |
PACKAGES="" | |
# Install a specific python version as configured | |
PACKAGES="$PACKAGES python${{matrix.python-version}}" | |
# Normal dependencies | |
PACKAGES="$PACKAGES gettext intltool python3-gi python3-cairo python3-dbus python3-xdg libglib2.0-dev libglib2.0-bin gir1.2-gtk-3.0" | |
# The gtk-update-icon-cache used to live in libgtk2.0-bin, | |
# but was moved to its own package. Similar for distutils | |
# (included by default in python stdlib). | |
if [ "${{ matrix.os }}" == "ubuntu-16.04" ]; then | |
PACKAGES="$PACKAGES libgtk2.0-bin" | |
else | |
PACKAGES="$PACKAGES gtk-update-icon-cache" | |
PACKAGES="$PACKAGES python3-distutils" | |
fi | |
# For dbus-launch | |
PACKAGES="$PACKAGES dbus-x11" | |
sudo apt-get update | |
sudo apt-get install ${PACKAGES} | |
- name: Install hamster | |
# This serves two purposes: | |
# 1) Verify build and install still works and | |
# 2) install the needed stuff (e.g. gsettings schemas) to allow | |
# running the tests | |
run: | | |
./waf configure build | |
sudo ./waf install | |
- name: Run tests | |
run: | | |
dbus-launch python${{ matrix.python-version }} -m unittest | |
flake8: | |
name: Run code linting and checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prepare repo | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.5' | |
- name: Install flake8 | |
run: | | |
pip install flake8 | |
- name: Run flake8 | |
run: | | |
flake8 --count --show-source --statistics | |
flatpak: | |
# This job builds Hamster for flatpak, and runs its tests | |
# inside the sandbox. | |
name: Test the flatpak build | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Prepare repo | |
uses: actions/checkout@v2 | |
- name: Install system packages | |
# It would be good to cache the GNOME Sdk, as it | |
# is rather big to download each time. | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
PACKAGES="flatpak flatpak-builder dbus-x11" | |
sudo apt-get update | |
sudo apt-get install -yq ${PACKAGES} | |
- name: Install GNOME SDK for flatpak | |
run: | | |
flatpak remote-add --user --if-not-exists --from flathub https://flathub.org/repo/flathub.flatpakrepo | |
flatpak install --user -y flathub org.gnome.Platform//3.36 org.gnome.Sdk//3.36 | |
- name: Build application | |
run: | | |
flatpak-builder --repo=build/flatpak/repo build/flatpak/tmp org.gnome.Hamster.json | |
- name: Run tests inside sandbox | |
run: | | |
dbus-launch flatpak-builder --run build/flatpak/tmp org.gnome.Hamster.json python3 -m unittest | |
- name: Export bundle and try to install it | |
run: | | |
mkdir -p dist | |
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo build/flatpak/repo dist/Hamster.flatpak org.gnome.Hamster | |
flatpak --user -y install dist/Hamster.flatpak | |
- name: Upload built artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Flatpak application | |
path: dist/Hamster.flatpak |