From 7e1e43a04a3c37050231ba500ae60ce345a550f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=89=E9=BB=98=E3=81=AE=E9=87=91?= <110812055+chenmozhijin@users.noreply.github.com> Date: Mon, 9 Dec 2024 02:03:43 +0800 Subject: [PATCH] refactor(test.yml): Optimize Linux test setup and add conditional xvfb-run --- .github/workflows/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9280f0..db0ee8e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,15 +52,15 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y \ - libegl1-mesa \ - libxcb-xinerama0 \ - xauth \ - xvfb \ - libgl1-mesa-glx + sudo apt-get install -y sudo apt-get install -y qtbase5-dev libqt5gui5 libqt5widgets5 xvfb + - name: Run tests run: | - pytest --cov=lddc --cov-report=xml --cov-report=html --disable-warnings + if [ "${{ runner.os }}" == "Linux" ]; then + xvfb-run pytest --cov=lddc --cov-report=xml --cov-report=html --disable-warnings + else + pytest --cov=lddc --cov-report=xml --cov-report=html --disable-warnings + fi - name: Save test artifacts if: always() @@ -73,5 +73,5 @@ jobs: uses: actions/upload-artifact@v3 if: always() with: - name: artifacts + name: artifacts-${{ matrix.os }} path: tests/artifacts \ No newline at end of file