summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 1fa06dcb436f1db721ee2114ac9dbb5088cb24ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: CI
on:
  push:
    branches-ignore:
      - 'update-dependencies'
      - 'dependabot/*'
  pull_request:
env:
  FORCE_COLOR: "1"
  PY_COLORS: "1"
  MYPY_FORCE_TERMINAL_WIDTH: "180"

jobs:
  tests:
    if: "!contains(github.event.head_commit.message, '[ci skip]')"
    timeout-minutes: 45
    # continue-on-error: "${{ matrix.experimental == true }}"
    strategy:
      fail-fast: false
      matrix:
        include:
          ### PyQt 6.7 (Python 3.12)
          - testenv: py312-pyqt67
            os: ubuntu-22.04
            python: "3.12"
            args: "tests/end2end/features/"
          ### Windows
          - testenv: py312-pyqt67
            os: windows-2019
            python: "3.12"
            args: "tests/end2end/features/"
    runs-on: "${{ matrix.os }}"
    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false
      - uses: actions/cache@v4
        with:
          path: |
            .mypy_cache
            .tox
            ~/.cache/pip
          key: "${{ matrix.testenv }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('misc/requirements/requirements-*.txt') }}-${{ hashFiles('requirements.txt') }}"
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "${{ matrix.python }}"
      - name: Set up problem matchers
        run: "python scripts/dev/ci/problemmatchers.py ${{ matrix.testenv }} ${{ runner.temp }}"
      - name: Install apt dependencies
        run: |
            sudo apt-get update
            sudo apt-get install --no-install-recommends libyaml-dev libegl1-mesa libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-shape0 libxcb-cursor0
        if: "startsWith(matrix.os, 'ubuntu-')"
      - name: Install dependencies
        run: |
            python -m pip install -U pip
            python -m pip install -U -r misc/requirements/requirements-tox.txt
      - name: "Run ${{ matrix.testenv }}"
        run: "dbus-run-session -- tox -e ${{ matrix.testenv }} -- ${{ matrix.args }}"
        if: "startsWith(matrix.os, 'ubuntu-')"
      - name: "Run ${{ matrix.testenv }} without DBus"
        run: "tox -e ${{ matrix.testenv }} -- ${{ matrix.args }}"
        if: "!startsWith(matrix.os, 'ubuntu-')"
      - name: Analyze backtraces
        run: "bash scripts/dev/ci/backtrace.sh ${{ matrix.testenv }}"
        if: "failure()"
      - name: Upload coverage
        if: "endsWith(matrix.testenv, '-cov')"
        uses: codecov/codecov-action@v3
        with:
          name: "${{ matrix.testenv }}"

  codeql:
    if: "!contains(github.event.head_commit.message, '[ci skip]')"
    permissions:
      security-events: write
    timeout-minutes: 15
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          persist-credentials: false
      - name: Initialize CodeQL
        uses: github/codeql-action/init@v3
        with:
          languages: javascript, python
          queries: +security-extended
      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v3