Fix pywayland-scanner entrypoint #344
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: | |
workflow_dispatch: | |
schedule: | |
# Run at 17:29 every Saturday | |
- cron: '29 17 * * 6' | |
jobs: | |
build-wayland: | |
name: Build Wayland libraries | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
wayland-version: ["1.22.0"] | |
wayland-protocols-version: ["1.32"] | |
steps: | |
- name: Setup environment | |
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: Install meson | |
run: | | |
sudo apt-get install -y --no-install-recommends \ | |
ninja-build | |
sudo pip install meson | |
- name: Download and unpack Wayland source | |
run: | | |
wget --no-check-certificate $WAYLAND_URL | |
wget --no-check-certificate $WAYLAND_PROTOCOLS_URL | |
tar -xJf wayland-${{ matrix.wayland-version }}.tar.xz | |
tar -xJf wayland-protocols-${{ matrix.wayland-protocols-version }}.tar.xz | |
env: | |
WAYLAND_URL: https://gitlab.freedesktop.org/wayland/wayland/-/releases/${{ matrix.wayland-version }}/downloads/wayland-${{ matrix.wayland-version }}.tar.xz | |
WAYLAND_PROTOCOLS_URL: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/${{ matrix.wayland-protocols-version }}/downloads/wayland-protocols-${{ matrix.wayland-protocols-version }}.tar.xz | |
- name: Build wayland | |
working-directory: wayland-${{ matrix.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-${{ matrix.wayland-protocols-version }} | |
run: | | |
meson build --prefix=/usr | |
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: wayland-${{ matrix.wayland-version }}_${{ matrix.wayland-protocols-version }} | |
path: ~/wayland.tar.gz | |
if-no-files-found: error | |
unit-test: | |
name: Python ${{ matrix.python-version}} unit tests | |
runs-on: ubuntu-latest | |
needs: build-wayland | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "pypy-3.8" | |
- "pypy-3.9" | |
- "pypy-3.10" | |
wayland-version: ["1.22.0"] | |
wayland-protocols-version: ["1.32"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download wayland libraries | |
uses: actions/download-artifact@v3 | |
with: | |
name: wayland-${{ matrix.wayland-version }}_${{ matrix.wayland-protocols-version }} | |
- name: Unpack wayland artifact | |
run: sudo tar xf wayland.tar.gz -C / | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set environment variables | |
run: | | |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV | |
- name: Install Python dependencies | |
run: | | |
pip install setuptools | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
python pywayland/ffi_build.py | |
python -m pywayland.scanner --with-protocols | |
- name: Run unit tests | |
run: pytest --cov pywayland --cov-report term-missing | |
- name: Push coverage | |
run: coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | |
COVERALLS_PARALLEL: true | |
coverage: | |
name: Finalize Coverage | |
needs: unit-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true | |
docs-test: | |
name: Docs check | |
runs-on: ubuntu-latest | |
needs: build-wayland | |
env: | |
python-version: "3.12" | |
wayland-version: "1.22.0" | |
wayland-protocols-version: "1.32" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download wayland libraries | |
uses: actions/download-artifact@v3 | |
with: | |
name: wayland-${{ env.wayland-version }}_${{ env.wayland-protocols-version }} | |
- name: Unpack wayland artifact | |
run: sudo tar xf wayland.tar.gz -C / | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Set environment variables | |
run: | | |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV | |
- name: Install Python dependencies | |
run: | | |
pip install setuptools | |
pip install -r requirements.txt | |
pip install -r doc/requirements.txt | |
python pywayland/ffi_build.py | |
python -m pywayland.scanner --with-protocols | |
- name: Build docs | |
run: sphinx-build -W -b html doc doc/_build/html | |
ruff-test: | |
name: ruff test | |
runs-on: ubuntu-latest | |
needs: build-wayland | |
env: | |
python-version: "3.12" | |
wayland-version: "1.22.0" | |
wayland-protocols-version: "1.32" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download wayland libraries | |
uses: actions/download-artifact@v3 | |
with: | |
name: wayland-${{ env.wayland-version }}_${{ env.wayland-protocols-version }} | |
- name: Unpack wayland artifact | |
run: sudo tar xf wayland.tar.gz -C / | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Set environment variables | |
run: | | |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV | |
- name: Install Python dependencies | |
run: | | |
pip install setuptools | |
pip install -r requirements.txt | |
pip install ruff | |
python pywayland/ffi_build.py | |
python -m pywayland.scanner --with-protocols | |
- name: Run ruff check | |
uses: chartboost/ruff-action@v1 | |
with: | |
src: pywayland | |
mypy-test: | |
name: mypy test | |
runs-on: ubuntu-latest | |
needs: build-wayland | |
env: | |
python-version: "3.12" | |
wayland-version: "1.22.0" | |
wayland-protocols-version: "1.32" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download wayland libraries | |
uses: actions/download-artifact@v3 | |
with: | |
name: wayland-${{ env.wayland-version }}_${{ env.wayland-protocols-version }} | |
- name: Unpack wayland artifact | |
run: sudo tar xf wayland.tar.gz -C / | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Set environment variables | |
run: | | |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV | |
- name: Install Python dependencies | |
run: | | |
pip install setuptools | |
pip install -r requirements.txt | |
pip install -r requirements-types.txt | |
python pywayland/ffi_build.py | |
python -m pywayland.scanner --with-protocols | |
- name: Run mypy test | |
run: mypy -p pywayland | |
packaging-test: | |
name: Packaging test | |
runs-on: ubuntu-latest | |
needs: build-wayland | |
env: | |
python-version: "3.12" | |
wayland-version: "1.22.0" | |
wayland-protocols-version: "1.32" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download wayland libraries | |
uses: actions/download-artifact@v3 | |
with: | |
name: wayland-${{ env.wayland-version }}_${{ env.wayland-protocols-version }} | |
- name: Unpack wayland artifact | |
run: sudo tar xf wayland.tar.gz -C / | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Set environment variables | |
run: | | |
echo "XDG_RUNTIME_DIR=/tmp" >> $GITHUB_ENV | |
- name: Install Python dependencies | |
run: | | |
pip install setuptools | |
pip install -r requirements.txt | |
pip install build check-manifest twine | |
python pywayland/ffi_build.py | |
- name: Run packaging test | |
run: | | |
check-manifest | |
python setup.py check -m -s | |
python -m build --sdist | |
twine check dist/* | |
black-test: | |
name: black test | |
runs-on: ubuntu-latest | |
env: | |
python-version: "3.12" | |
steps: | |
- 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 pywayland |