CI #509
This file contains hidden or 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-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| wayland-version: ["1.24.0"] | |
| wayland-protocols-version: ["1.45"] | |
| 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 setup 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 setup 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@v4 | |
| 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-24.04 | |
| needs: build-wayland | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| - "3.14" | |
| - "pypy-3.11" | |
| wayland-version: ["1.24.0"] | |
| wayland-protocols-version: ["1.45"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download wayland libraries | |
| uses: actions/download-artifact@v4 | |
| 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@v5 | |
| 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 .[ci] | |
| python pywayland/ffi_build.py | |
| python -m pywayland.scanner --with-protocols | |
| - name: Run unit tests | |
| run: | | |
| pip install .[test] | |
| 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-24.04 | |
| 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-24.04 | |
| needs: build-wayland | |
| env: | |
| python-version: "3.14" | |
| wayland-version: "1.24.0" | |
| wayland-protocols-version: "1.45" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download wayland libraries | |
| uses: actions/download-artifact@v4 | |
| 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@v5 | |
| 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 .[ci] | |
| python pywayland/ffi_build.py | |
| python -m pywayland.scanner --with-protocols | |
| - name: Build docs | |
| run: | | |
| pip install .[docs] | |
| sphinx-build -W -b html doc doc/_build/html | |
| pre-commit-test: | |
| name: pre-commit test | |
| runs-on: ubuntu-24.04 | |
| needs: build-wayland | |
| env: | |
| python-version: "3.14" | |
| wayland-version: "1.24.0" | |
| wayland-protocols-version: "1.45" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download wayland libraries | |
| uses: actions/download-artifact@v4 | |
| 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@v5 | |
| 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 .[ci] | |
| python pywayland/ffi_build.py | |
| python -m pywayland.scanner --with-protocols | |
| - name: Run pre-commit test | |
| uses: pre-commit/action@v3.0.1 | |
| packaging-test: | |
| name: packaging test | |
| runs-on: ubuntu-24.04 | |
| needs: build-wayland | |
| env: | |
| python-version: "3.14" | |
| wayland-version: "1.24.0" | |
| wayland-protocols-version: "1.45" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download wayland libraries | |
| uses: actions/download-artifact@v4 | |
| 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@v5 | |
| 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 .[ci] | |
| python pywayland/ffi_build.py | |
| python -m pywayland.scanner --with-protocols | |
| - name: Run packaging test | |
| run: | | |
| pip install .[packaging] | |
| check-manifest | |
| python setup.py check -m -s | |
| python -m build --sdist | |
| twine check dist/* |