From 4e7f55c76aea821bb5fe8242a1ac2161aca106cf Mon Sep 17 00:00:00 2001 From: Sietze van Buuren Date: Tue, 26 Nov 2024 19:15:55 +0100 Subject: [PATCH] ci: switch to docker container for testing and linting Signed-off-by: Sietze van Buuren --- .github/workflows/test-and-lint.yaml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-and-lint.yaml b/.github/workflows/test-and-lint.yaml index cf87425..5284b92 100644 --- a/.github/workflows/test-and-lint.yaml +++ b/.github/workflows/test-and-lint.yaml @@ -10,20 +10,24 @@ jobs: lint-and-test: name: Lint and test runs-on: ubuntu-latest + env: + DISPLAY: ':99.0' + container: + image: ghcr.io/swvanbuuren/qt-python-docker:master + options: > + --env DISPLAY=$DISPLAY + --volume /tmp/.X11-unix:/tmp/.X11-unix strategy: fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10", "3.11"] - env: - DISPLAY: ':99.0' - QT_SELECT: "qt6" steps: + - name: Start Xvfb + run: Xvfb :99 -screen 0 1920x1080x24 & + - name: Checkout repository uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v3 - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -38,13 +42,6 @@ jobs: # run: | # uv run ruff check ${{ github.event.repository.name }} - - name: Install test dependencies - run: | - sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libxcb-shape0 libglib2.0-0 libgl1-mesa-dev - sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev - # start xvfb in the background - sudo /usr/bin/Xvfb $DISPLAY -screen 0 1920x1080x24 & - - name: Test with pytest run: | uv run pytest -v -s