name: tests concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: [push, pull_request] jobs: test: runs-on: ${{ matrix.os }} strategy: matrix: os: [windows-latest, ubuntu-22.04, macos-latest] python-version: ["3.10", "3.11", "3.12", "3.13"] fail-fast: false steps: - uses: actions/checkout@v4 with: submodules: "recursive" - name: Set up Python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install packages shell: bash run: | pip install tox tox-gh-actions if [ "$RUNNER_OS" = "Linux" ]; then sudo apt update sudo apt-get install libegl1 libopengl0 sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev sudo apt-get install libxcb-xinerama0 sudo apt-get install libxkbcommon-x11-0 sudo apt-get install libxml2 libxml2-dev libxslt1-dev libxslt1.1 sudo apt-get install xorg sudo apt-get install -y xvfb fi - name: Start Xvfb if: matrix.os == 'ubuntu-22.04' run: | Xvfb :0 -screen 0 1280x720x24 > /dev/null 2>&1 & export DISPLAY=:0 touch ~/.Xauthority Xvfb :0 -screen 0 1280x720x24 > /dev/null 2>&1 & export DISPLAY=:0 # see: https://github.com/ymyzk/tox-gh-actions - name: Run tests run: tox - uses: actions/upload-artifact@v4 if: failure() # && matrix.os == 'windows-latest' # 'ubuntu-22.04' or 'windows-latest' with: path: "**/screenshots/**" name: screenshots-${{ matrix.os }}-${{ matrix.python-version }} - name: Stop Xvfb if: matrix.os == 'ubuntu-22.04' run: killall Xvfb - name: Publish Style Summary if: ${{ failure() || success() }} run: | python -c "from ci import report_style; report_style()" - name: Publish Tests Summary if: ${{ failure() || success() }} run: | pip install junitparser python -c "from ci import report_tests; report_tests(header='## Unit-tests Report:')" - name: Coveralls Parallel uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} flag-name: Unittests-${{ matrix.os }}-${{ matrix.python-version }} parallel: true format: lcov coveralls: needs: test runs-on: ubuntu-latest steps: - name: Coveralls Finished uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true