CI #735
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: CI | |
on: | |
pull_request: | |
push: | |
schedule: | |
# Run at 17:29 every Saturday | |
- cron: '29 17 * * 6' | |
jobs: | |
build-wayland: | |
name: Build Wayland libraries | |
runs-on: ubuntu-22.04 | |
env: | |
libdrm-version: "2.4.114" | |
seatd-version: "0.6.4" | |
pixman-version: "0.42.0" | |
hwdata-version: "0.364" | |
wayland-version: "1.22.0" | |
wayland-protocols-version: "1.31" | |
strategy: | |
fail-fast: false | |
matrix: | |
wlroots-version: ["0.16.2", master] | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt-get install -y --no-install-recommends \ | |
libegl1-mesa-dev \ | |
libgbm-dev \ | |
libgles2-mesa-dev \ | |
libinput-dev \ | |
libpciaccess-dev \ | |
libxcb-composite0-dev \ | |
libxcb-dri3-dev \ | |
libxcb-icccm4-dev \ | |
libxcb-image0-dev \ | |
libxcb-present-dev \ | |
libxcb-render0-dev \ | |
libxcb-res0-dev \ | |
libxcb-xfixes0-dev \ | |
libxcb-xinput-dev \ | |
libxcb1-dev \ | |
libxkbcommon-dev \ | |
ninja-build \ | |
xwayland | |
sudo pip install meson | |
- name: Set environment variables | |
run: | | |
echo "CPATH=${HOME}/wayland/usr/include" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=${HOME}/wayland/usr/lib" >> $GITHUB_ENV | |
echo "LIBRARY_PATH=${HOME}/wayland/usr/lib" >> $GITHUB_ENV | |
echo "PKG_CONFIG_PATH=${HOME}/wayland/usr/share/pkgconfig:${HOME}/wayland/usr/lib/pkgconfig" >> $GITHUB_ENV | |
- name: Download and unpack Wayland source | |
run: | | |
wget $WAYLAND_URL | |
wget $WAYLAND_PROTOCOLS_URL | |
wget $LIBDRM_URL | |
wget -O seatd.tar.gz $SEATD_URL | |
wget $PIXMAN_URL | |
wget -O hwdata.tar.gz $HWDATA_URL | |
wget -O wlroots.tar.gz $WLROOTS_URL | |
tar -xJf wayland-${{ env.wayland-version }}.tar.xz | |
tar -xJf wayland-protocols-${{ env.wayland-protocols-version }}.tar.xz | |
tar -xzf drm-libdrm-${{ env.libdrm-version }}.tar.gz | |
tar -xzf seatd.tar.gz | |
tar -xjf pixman-pixman-${{ env.pixman-version }}.tar.bz2 | |
tar -xzf hwdata.tar.gz | |
tar -xzf wlroots.tar.gz | |
env: | |
WAYLAND_URL: https://gitlab.freedesktop.org/wayland/wayland/-/releases/${{ env.wayland-version }}/downloads/wayland-${{ env.wayland-version }}.tar.xz | |
WAYLAND_PROTOCOLS_URL: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/${{ env.wayland-protocols-version }}/downloads/wayland-protocols-${{ env.wayland-protocols-version }}.tar.xz | |
LIBDRM_URL: https://gitlab.freedesktop.org/mesa/drm/-/archive/libdrm-${{ env.libdrm-version }}/drm-libdrm-${{ env.libdrm-version }}.tar.gz | |
SEATD_URL: https://git.sr.ht/~kennylevinsen/seatd/archive/${{ env.seatd-version }}.tar.gz | |
PIXMAN_URL: https://gitlab.freedesktop.org/pixman/pixman/-/archive/pixman-${{ env.pixman-version }}/pixman-pixman-${{ env.pixman-version }}.tar.bz2 | |
HWDATA_URL: https://github.com/vcrhonek/hwdata/archive/refs/tags/v${{ env.hwdata-version }}.tar.gz | |
WLROOTS_URL: https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/${{ matrix.wlroots-version }}/wlroots-${{ matrix.wlroots-version }}.tar.gz | |
- name: Build wayland | |
working-directory: wayland-${{ env.wayland-version }} | |
run: | | |
meson build --prefix=/usr -Ddocumentation=false | |
ninja -C build | |
DESTDIR=~/wayland ninja -C build install | |
sudo ninja -C build install | |
- name: Build wayland-protocols | |
working-directory: wayland-protocols-${{ env.wayland-protocols-version }} | |
run: | | |
meson build --prefix=/usr | |
ninja -C build | |
DESTDIR=~/wayland ninja -C build install | |
sudo ninja -C build install | |
- name: Build libdrm | |
working-directory: drm-libdrm-${{ env.libdrm-version }} | |
run: | | |
meson build --prefix=/usr | |
ninja -C build | |
DESTDIR=~/wayland ninja -C build install | |
sudo ninja -C build install | |
- name: Build seatd | |
working-directory: seatd-${{ env.seatd-version }} | |
run: | | |
meson build --prefix=/usr | |
ninja -C build | |
DESTDIR=~/wayland ninja -C build install | |
sudo ninja -C build install | |
- name: Build pixman | |
working-directory: pixman-pixman-${{ env.pixman-version }} | |
run: | | |
meson build --prefix=/usr | |
ninja -C build | |
DESTDIR=~/wayland ninja -C build install | |
sudo ninja -C build install | |
- name: Build hwdata | |
working-directory: hwdata-${{ env.hwdata-version }} | |
run: | | |
./configure --prefix=/usr --libdir=/lib --datadir=/usr/share | |
make | |
sudo make install | |
- name: Build wlroots | |
working-directory: wlroots-${{ matrix.wlroots-version }} | |
continue-on-error: ${{ matrix.wlroots-version == 'master' }} | |
run: | | |
meson build --prefix=/usr -Dxwayland=enabled | |
ninja -C build | |
DESTDIR=~/wayland ninja -C build install | |
- name: Create artifact | |
run: tar czf ~/wayland.tar.gz -C ${HOME}/wayland/ . | |
- name: Upload built libraries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wlroots-${{ matrix.wlroots-version }} | |
path: ~/wayland.tar.gz | |
if-no-files-found: error | |
unit-test: | |
name: Python ${{ matrix.python-version}} unit tests (${{ matrix.wlroots-version }}) | |
runs-on: ubuntu-22.04 | |
needs: build-wayland | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "pypy-3.8" | |
- "pypy-3.9" | |
- "pypy-3.10" | |
wlroots-version: ["0.16.2"] | |
include: | |
- python-version: "3.11" | |
wlroots-version: master | |
steps: | |
- name: Download wayland libraries | |
uses: actions/download-artifact@v3 | |
with: | |
name: wlroots-${{ matrix.wlroots-version }} | |
- name: Unpack wayland artifact | |
run: sudo tar xf wayland.tar.gz -C / | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt-get install -y --no-install-recommends \ | |
libegl1-mesa-dev \ | |
libgbm-dev \ | |
libgles2-mesa-dev \ | |
libinput-dev \ | |
libpciaccess-dev \ | |
libxcb-composite0-dev \ | |
libxcb-dri3-dev \ | |
libxcb-icccm4-dev \ | |
libxcb-image0-dev \ | |
libxcb-render0-dev \ | |
libxcb-res0-dev \ | |
libxcb-xfixes0-dev \ | |
libxcb-xinput-dev \ | |
libxcb1-dev \ | |
libxkbcommon-dev | |
- name: Set environment variables | |
run: | | |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV | |
- name: Install Python dependencies | |
continue-on-error: ${{ matrix.wlroots-version == 'master' }} | |
run: | | |
pip install -e .[test] | |
- name: Run unit tests | |
continue-on-error: ${{ matrix.wlroots-version == 'master' }} | |
run: pytest -Wall | |
env: | |
WLR_HEADLESS_OUTPUTS: '1' | |
WLR_LIBINPUT_NO_DEVICES: '1' | |
WLR_RENDERER: pixman | |
WLR_RENDERER_ALLOW_SOFTWARE: '1' | |
ruff-test: | |
name: Ruff tests | |
runs-on: ubuntu-22.04 | |
env: | |
python-version: "3.10" | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Run ruff check | |
uses: chartboost/ruff-action@v1 | |
mypy-test: | |
name: mypy tests | |
runs-on: ubuntu-22.04 | |
env: | |
python-version: "3.11" | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt-get install -y --no-install-recommends \ | |
libxkbcommon-dev \ | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Install Python dependencies | |
run: | | |
pip install wheel | |
pip install -r requirements.txt | |
pip install mypy types-cffi types-dataclasses | |
- name: Run mypy test | |
run: | | |
mypy -p wlroots | |
mypy -p tiny | |
mypy check_headers.py | |
black-test: | |
name: black tests | |
runs-on: ubuntu-22.04 | |
env: | |
python-version: "3.11" | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Install Python dependencies | |
run: | | |
pip install black | |
- name: Run black test | |
run: black --check wlroots tiny check_headers.py | |
packaging-test: | |
name: packaging tests | |
runs-on: ubuntu-22.04 | |
needs: build-wayland | |
env: | |
python-version: "3.11" | |
wlroots-version: "0.16.2" | |
steps: | |
- name: Download wayland libraries | |
uses: actions/download-artifact@v3 | |
with: | |
name: wlroots-${{ env.wlroots-version }} | |
- name: Unpack wayland artifact | |
run: sudo tar xf wayland.tar.gz -C / | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt-get install -y --no-install-recommends \ | |
libxkbcommon-dev \ | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Install Python dependencies | |
run: | | |
pip install wheel | |
pip install -r requirements.txt | |
pip install check-manifest twine | |
- name: Run packaging test | |
run: | | |
check-manifest | |
python setup.py check -m -s | |
python setup.py sdist | |
twine check dist/* | |
protocol-headers-test: | |
name: protocol headers test | |
runs-on: ubuntu-22.04 | |
needs: build-wayland | |
env: | |
python-version: "3.11" | |
wlroots-version: "0.16.2" | |
steps: | |
- name: Download wayland libraries | |
uses: actions/download-artifact@v3 | |
with: | |
name: wlroots-${{ env.wlroots-version }} | |
- name: Unpack wayland artifact | |
run: sudo tar xf wayland.tar.gz -C / | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Download and unpack Wlroots source | |
run: | | |
wget -O wlroots.tar.gz $WLROOTS_URL | |
tar -xzf wlroots.tar.gz | |
env: | |
WLROOTS_URL: https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/${{ env.wlroots-version }}/wlroots-${{ env.wlroots-version }}.tar.gz | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt-get install -y --no-install-recommends pkgconf | |
- name: Run protocol test | |
run: python check_headers.py --wlroots-dir wlroots-${{ env.wlroots-version }} |