diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml new file mode 100644 index 00000000000..e5172a1e1bd --- /dev/null +++ b/.github/workflows/benchmarks.yml @@ -0,0 +1,49 @@ +name: Benchmarks + +on: + # Run on pushes to the main branch + push: + branches: + - "master" # or "main" + # Run on pull requests + pull_request: + # `workflow_dispatch` allows CodSpeed to trigger backtest + # performance analysis in order to generate initial data. + workflow_dispatch: + +jobs: + benchmarks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v4 + with: + path: | + .mypy_cache + .tox + ~/.cache/pip + key: "py312-pyqt66-${{ matrix.os }}-3.12-${{ hashFiles('misc/requirements/requirements-*.txt') }}-${{ hashFiles('requirements.txt') }}" + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Set up problem matchers + run: "python scripts/dev/ci/problemmatchers.py py312-pyqt66 ${{ 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 + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U \ + -r misc/requirements/requirements-tox.txt \ + -r misc/requirements/requirements-dev.txt \ + -r misc/requirements/requirements-tests.txt \ + -r misc/requirements/requirements-pyqt-6.6.txt + python -m pip install -e . + + - name: Run benchmarks + uses: CodSpeedHQ/action@v2 + with: + run: dbus-run-session pytest . --codspeed diff --git a/.github/workflows/bleeding.yml b/.github/workflows/bleeding.yml deleted file mode 100644 index 2587d832bb9..00000000000 --- a/.github/workflows/bleeding.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Bleeding-edge CI - -on: - workflow_dispatch: - schedule: - # Every day at 03:05 UTC - # https://crontab.guru/#05_03_*_*_* - - cron: '05 03 * * *' - -jobs: - tests: - if: "github.repository == 'qutebrowser/qutebrowser'" - runs-on: ubuntu-20.04 - timeout-minutes: 45 - strategy: - fail-fast: false - matrix: - include: - - testenv: bleeding - image: "archlinux-webengine-unstable-qt6" - - testenv: bleeding-qt5 - image: "archlinux-webengine-unstable" - container: - image: "qutebrowser/ci:${{ matrix.image }}" - env: - FORCE_COLOR: "1" - PY_COLORS: "1" - DOCKER: "${{ matrix.image }}" - CI: true - volumes: - # Hardcoded because we can't use ${{ runner.temp }} here apparently. - - /home/runner/work/_temp/:/home/runner/work/_temp/ - options: --privileged --tty - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Set up problem matchers - run: "python scripts/dev/ci/problemmatchers.py py3 ${{ runner.temp }}" - - name: Run tox - run: dbus-run-session tox -e ${{ matrix.testenv }} - irc: - timeout-minutes: 2 - continue-on-error: true - runs-on: ubuntu-20.04 - needs: [tests] - if: "always() && github.repository == 'qutebrowser/qutebrowser'" - steps: - - name: Send success IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.tests.result == 'success'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00033Success:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" - - name: Send non-success IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.tests.result != 'success'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00034FAIL:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})\n - tests: ${{ needs.tests.result }}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 599ba3b1b3a..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,283 +0,0 @@ -name: CI -on: - push: - branches-ignore: - - 'update-dependencies' - - 'dependabot/*' - pull_request: -env: - FORCE_COLOR: "1" - PY_COLORS: "1" - MYPY_FORCE_TERMINAL_WIDTH: "180" - -jobs: - linters: - if: "!contains(github.event.head_commit.message, '[ci skip]')" - timeout-minutes: 10 - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - include: - - testenv: pylint - - testenv: flake8 - - testenv: mypy-pyqt6 - - testenv: mypy-pyqt5 - - testenv: docs - - testenv: vulture - - testenv: misc - - testenv: pyroma - - testenv: check-manifest - - testenv: eslint - - testenv: shellcheck - args: "-f gcc" # For problem matchers - - testenv: yamllint - - testenv: actionlint - - testenv: package - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - uses: actions/cache@v4 - with: - path: | - .mypy_cache - .tox - ~/.cache/pip - key: "${{ matrix.testenv }}-${{ hashFiles('misc/requirements/requirements-*.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('scripts/dev/pylint_checkers/qute_pylint/*.py') }}" - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - uses: actions/setup-node@v4 - with: - node-version: '16.x' - if: "matrix.testenv == 'eslint'" - - name: Set up problem matchers - run: "python scripts/dev/ci/problemmatchers.py ${{ matrix.testenv }} ${{ runner.temp }}" - - name: Install dependencies - run: | - [[ ${{ matrix.testenv }} == eslint ]] && npm install -g 'eslint@<9.0.0' - [[ ${{ matrix.testenv }} == docs ]] && sudo apt-get update && sudo apt-get install --no-install-recommends asciidoc libegl1-mesa - [[ ${{ matrix.testenv }} == vulture || ${{ matrix.testenv }} == pylint ]] && sudo apt-get update && sudo apt-get install --no-install-recommends libegl1-mesa - if [[ ${{ matrix.testenv }} == shellcheck ]]; then - scversion="stable" - bindir="$HOME/.local/bin" - mkdir -p "$bindir" - wget -qO- "https://github.com/koalaman/shellcheck/releases/download/$scversion/shellcheck-$scversion.linux.x86_64.tar.xz" | tar -xJv --strip-components 1 -C "$bindir" shellcheck-$scversion/shellcheck - echo "$bindir" >> "$GITHUB_PATH" - fi - if [[ ${{ matrix.testenv }} == actionlint ]]; then - bindir="$HOME/.local/bin" - mkdir -p "$bindir" - wget -q https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash - bash download-actionlint.bash latest "$bindir" - echo "$bindir" >> "$GITHUB_PATH" - fi - python -m pip install -U pip - python -m pip install -U -r misc/requirements/requirements-tox.txt - - name: "Run ${{ matrix.testenv }}" - run: | - if [[ -z "${{ matrix.args }}" ]]; then - dbus-run-session -- tox -e ${{ matrix.testenv }} - else - dbus-run-session -- tox -e ${{ matrix.testenv }} -- ${{ matrix.args }} - fi - - tests-docker: - if: "!contains(github.event.head_commit.message, '[ci skip]')" - timeout-minutes: 45 - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - include: - - testenv: py-qt5 - image: archlinux-webkit - - testenv: py-qt5 - image: archlinux-webengine - - testenv: py-qt5 - image: archlinux-webengine-unstable - - testenv: py - image: archlinux-webengine-qt6 - - testenv: py - image: archlinux-webengine-unstable-qt6 - container: - image: "qutebrowser/ci:${{ matrix.image }}" - env: - DOCKER: "${{ matrix.image }}" - CI: true - PYTEST_ADDOPTS: "--color=yes" - volumes: - # Hardcoded because we can't use ${{ runner.temp }} here apparently. - - /home/runner/work/_temp/:/home/runner/work/_temp/ - options: --privileged --tty - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Set up problem matchers - run: "python scripts/dev/ci/problemmatchers.py tests ${{ runner.temp }}" - - name: Run tox - run: "dbus-run-session -- tox -e ${{ matrix.testenv }}" - - 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 5.15.2 (Python 3.8) - - testenv: py37-pyqt5152 - os: ubuntu-20.04 - python: "3.8" - ### PyQt 5.15 (Python 3.10, with coverage) - # FIXME:qt6 - # - testenv: py310-pyqt515-cov - # os: ubuntu-22.04 - # python: "3.10" - ### PyQt 5.15 (Python 3.11) - - testenv: py311-pyqt515 - os: ubuntu-20.04 - python: "3.11" - ### PyQt 6.2 (Python 3.8) - - testenv: py37-pyqt62 - os: ubuntu-20.04 - python: "3.8" - ### PyQt 6.3 (Python 3.8) - - testenv: py38-pyqt63 - os: ubuntu-20.04 - python: "3.8" - ## PyQt 6.4 (Python 3.9) - - testenv: py39-pyqt64 - os: ubuntu-20.04 - python: "3.9" - ### PyQt 6.5 (Python 3.10) - - testenv: py310-pyqt65 - os: ubuntu-22.04 - python: "3.10" - ### PyQt 6.6 (Python 3.11) - - testenv: py311-pyqt66 - os: ubuntu-22.04 - python: "3.11" - ### PyQt 6.6 (Python 3.12) - - testenv: py312-pyqt66 - os: ubuntu-22.04 - python: "3.12" - ### macOS Big Sur - - testenv: py312-pyqt66 - os: macos-11 - python: "3.12" - args: "tests/unit" # Only run unit tests on macOS - ### macOS Monterey - - testenv: py312-pyqt66 - os: macos-12 - python: "3.12" - args: "tests/unit" # Only run unit tests on macOS - ### Windows - - testenv: py312-pyqt66 - os: windows-2019 - python: "3.12" - 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-20.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 - - irc: - timeout-minutes: 2 - continue-on-error: true - runs-on: ubuntu-20.04 - needs: [linters, tests, tests-docker, codeql] - if: "always() && github.repository_owner == 'qutebrowser'" - steps: - - name: Send success IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.linters.result == 'success' && needs.tests.result == 'success' && needs.tests-docker.result == 'success' && needs.codeql.result == 'success'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00033Success:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" - - name: Send failure IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.linters.result == 'failure' || needs.tests.result == 'failure' || needs.tests-docker.result == 'failure' || needs.codeql.result == 'failure'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00034FAIL:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})\n - linters: ${{ needs.linters.result }}, tests: ${{ needs.tests.result }}, tests-docker: ${{ needs.tests-docker.result }}, codeql: ${{ needs.codeql.result }}" - - name: Send skipped IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.linters.result == 'skipped' || needs.tests.result == 'skipped' || needs.tests-docker.result == 'skipped' || needs.codeql.result == 'skipped'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00038Skipped:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" - - name: Send cancelled IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.linters.result == 'cancelled' || needs.tests.result == 'cancelled' || needs.tests-docker.result == 'cancelled' || needs.codeql.result == 'cancelled'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u000314Cancelled:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})\n - linters: ${{ needs.linters.result }}, tests: ${{ needs.tests.result }}, tests-docker: ${{ needs.tests-docker.result }}, codeql: ${{ needs.codeql.result }}" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 9dc925e29e0..00000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Rebuild Docker CI images - -on: - workflow_dispatch: - schedule: - - cron: "23 5 * * *" # daily at 5:23 - -jobs: - docker: - if: "github.repository == 'qutebrowser/qutebrowser'" - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - image: - - archlinux-webkit - - archlinux-webengine - - archlinux-webengine-unstable - - archlinux-webengine-unstable-qt6 - - archlinux-webengine-qt6 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - run: pip install jinja2 - - name: Generate Dockerfile - run: python3 generate.py ${{ matrix.image }} - working-directory: scripts/dev/ci/docker/ - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v3 - with: - username: qutebrowser - password: ${{ secrets.DOCKER_TOKEN }} - - uses: docker/build-push-action@v5 - with: - file: scripts/dev/ci/docker/Dockerfile - context: . - tags: "qutebrowser/ci:${{ matrix.image }}" - push: ${{ github.ref == 'refs/heads/main' }} - - irc: - timeout-minutes: 2 - continue-on-error: true - runs-on: ubuntu-20.04 - needs: [docker] - if: "always() && github.repository == 'qutebrowser/qutebrowser'" - steps: - - name: Send success IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.docker.result == 'success'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00033Success:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" - - name: Send non-success IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.docker.result != 'success'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00034FAIL:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index b326c2ad633..00000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: Nightly builds - -on: - workflow_dispatch: - schedule: - # Every day at 04:05 UTC - # https://crontab.guru/#05_04_*_*_* - - cron: '05 04 * * *' - -jobs: - pyinstaller: - if: "github.repository == 'qutebrowser/qutebrowser'" - strategy: - fail-fast: false - matrix: - include: - - os: macos-11 - toxenv: build-release-qt5 - name: qt5-macos - - os: windows-2019 - toxenv: build-release-qt5 - name: qt5-windows - - os: macos-11 - args: --debug - toxenv: build-release-qt5 - name: qt5-macos-debug - - os: windows-2019 - args: --debug - toxenv: build-release-qt5 - name: qt5-windows-debug - - os: macos-11 - toxenv: build-release - name: macos - - os: windows-2019 - toxenv: build-release - name: windows - - os: macos-11 - args: --debug - toxenv: build-release - name: macos-debug - - os: windows-2019 - args: --debug - toxenv: build-release - name: windows-debug - runs-on: "${{ matrix.os }}" - timeout-minutes: 45 - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -U -r misc/requirements/requirements-tox.txt - - name: Patch qutebrowser for debugging - if: "contains(matrix.args, '--debug')" - run: | - sed '/.-d., .--debug.,/s/$/ default=True,/' qutebrowser/qutebrowser.py > qutebrowser/qutebrowser.py.tmp - cp qutebrowser/qutebrowser.py.tmp qutebrowser/qutebrowser.py - rm qutebrowser/qutebrowser.py.tmp - - name: Run tox - run: "tox -e ${{ matrix.toxenv }} -- --gh-token ${{ secrets.GITHUB_TOKEN }} ${{ matrix.args }}" - - name: Gather info - id: info - run: | - echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" - echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" - shell: bash - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: "qutebrowser-nightly-${{ steps.info.outputs.date }}-${{ steps.info.outputs.sha_short }}-${{ matrix.name }}" - path: | - dist/qutebrowser-*.dmg - dist/qutebrowser-*-windows-standalone-*.zip - dist/qutebrowser-*-*.exe - if-no-files-found: error - - irc: - timeout-minutes: 2 - continue-on-error: true - runs-on: ubuntu-20.04 - needs: [pyinstaller] - if: "always() && github.repository == 'qutebrowser/qutebrowser'" - steps: - - name: Send success IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.pyinstaller.result == 'success'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00033Success:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" - - name: Send non-success IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.pyinstaller.result != 'success'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00034FAIL:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})\n - pyinstaller: ${{ needs.pyinstaller.result }}" diff --git a/.github/workflows/recompile-requirements.yml b/.github/workflows/recompile-requirements.yml deleted file mode 100644 index 6d42c3137b6..00000000000 --- a/.github/workflows/recompile-requirements.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Update dependencies - -on: - schedule: - # Every Monday at 04:05 UTC - # https://crontab.guru/#05_04_*_*_1 - - cron: '05 04 * * 1' - workflow_dispatch: - inputs: - environments: - description: 'Test environments to update' - required: false - default: '' - -jobs: - update: - if: "github.repository == 'qutebrowser/qutebrowser'" - timeout-minutes: 20 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - persist-credentials: false - - name: Set up Python 3.8 - uses: actions/setup-python@v5 - with: - python-version: '3.8' - - name: Recompile requirements - run: "python3 scripts/dev/recompile_requirements.py ${{ github.event.input.environments }}" - id: requirements - - 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 asciidoc python3-venv xvfb - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -U -r misc/requirements/requirements-tox.txt - - name: Run mkvenv.py - run: "xvfb-run python3 scripts/mkvenv.py --dev" - - name: Run qutebrowser smoke test - run: "xvfb-run .venv/bin/python3 -m qutebrowser --no-err-windows --nowindow --temp-basedir about:blank ':later 500 quit'" - - name: Create pull request - uses: peter-evans/create-pull-request@v6 - with: - committer: qutebrowser bot - author: qutebrowser bot - token: ${{ secrets.QUTEBROWSER_BOT_TOKEN }} - commit-message: Update dependencies - title: Update dependencies - body: | - ## Changed files - - ${{ steps.requirements.outputs.changed }} - - ## Version updates - - ${{ steps.requirements.outputs.diff }} - - --- - - I'm a bot, bleep, bloop. :robot: - - branch: update-dependencies - irc: - timeout-minutes: 2 - continue-on-error: true - runs-on: ubuntu-latest - needs: [update] - if: "always() && github.repository == 'qutebrowser/qutebrowser'" - steps: - - name: Send success IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.update.result == 'success'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00033Success:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" - - name: Send non-success IRC notification - uses: Gottox/irc-message-action@v2 - if: "needs.update.result != 'success'" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00034FAIL:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index aa8b3b2efa6..00000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,223 +0,0 @@ -name: Release - -on: - workflow_dispatch: - inputs: - release_type: - description: 'Release type' - required: true - default: 'patch' - type: choice - options: - - 'patch' - - 'minor' - - 'major' - # FIXME do we want a possibility to do prereleases here? - python_version: - description: 'Python version' - required: true - default: '3.12' - type: choice - options: - - '3.8' - - '3.9' - - '3.10' - - '3.11' - - '3.12' -jobs: - prepare: - runs-on: ubuntu-20.04 - timeout-minutes: 5 - outputs: - version: ${{ steps.bump.outputs.version }} - release_id: ${{ steps.create-release.outputs.id }} - permissions: - contents: write # To push release commit/tag - steps: - - name: Find release branch - uses: actions/github-script@v7 - id: find-branch - with: - script: | - if (context.payload.inputs.release_type != 'patch') { - return 'main'; - } - const branches = await github.paginate(github.rest.repos.listBranches, { - owner: context.repo.owner, - repo: context.repo.repo, - }); - const branch_names = branches.map(branch => branch.name); - console.log(`branches: ${branch_names}`); - const release_branches = branch_names.filter(branch => branch.match(/^v\d+\.\d+\.x$/)); - if (release_branches.length === 0) { - core.setFailed('No release branch found!'); - return ''; - } - console.log(`release_branches: ${release_branches}`); - // Get newest release branch (biggest version number) - const sorted = release_branches.sort((a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' })); - console.log(`sorted: ${sorted}`); - return sorted.at(-1); - result-encoding: string - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - # Doesn't really matter what we prepare the release with, but let's - # use the same version for consistency. - python-version: ${{ github.event.inputs.python_version }} - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -U -r misc/requirements/requirements-tox.txt - - name: Configure git - run: | - git config --global user.name "qutebrowser bot" - git config --global user.email "bot@qutebrowser.org" - - name: Switch to release branch - uses: actions/checkout@v4 - with: - ref: ${{ steps.find-branch.outputs.result }} - - name: Import GPG Key - run: | - gpg --import <<< "${{ secrets.QUTEBROWSER_BOT_GPGKEY }}" - - name: Bump version - id: bump - run: "tox -e update-version -- ${{ github.event.inputs.release_type }}" - - name: Check milestone - uses: actions/github-script@v7 - with: - script: | - const milestones = await github.paginate(github.rest.issues.listMilestones, { - owner: context.repo.owner, - repo: context.repo.repo, - }); - const names = milestones.map(milestone => milestone.title); - console.log(`milestones: ${names}`); - - const milestone = milestones.find(milestone => milestone.title === "v${{ steps.bump.outputs.version }}"); - if (milestone !== undefined) { - core.setFailed(`Found open milestone ${milestone.title} with ${milestone.open_issues} open and ${milestone.closed_issues} closed issues!`); - } - - name: Push release commit/tag - run: | - git push origin ${{ steps.find-branch.outputs.result }} - git push origin v${{ steps.bump.outputs.version }} - - name: Cherry-pick release commit - if: ${{ github.event.inputs.release_type == 'patch' }} - run: | - git checkout main - git cherry-pick -x v${{ steps.bump.outputs.version }} - git push origin main - git checkout v${{ steps.bump.outputs.version_x }} - - name: Create release branch - if: ${{ github.event.inputs.release_type != 'patch' }} - run: | - git checkout -b v${{ steps.bump.outputs.version_x }} - git push --set-upstream origin v${{ steps.bump.outputs.version_x }} - - name: Create GitHub draft release - id: create-release - uses: softprops/action-gh-release@v2 - with: - tag_name: v${{ steps.bump.outputs.version }} - draft: true - body: "*Release artifacts for this release are currently being uploaded...*" - release: - strategy: - matrix: - include: - - os: macos-11 - - os: windows-2019 - - os: ubuntu-20.04 - runs-on: "${{ matrix.os }}" - timeout-minutes: 45 - needs: [prepare] - permissions: - contents: write # To upload release artifacts - steps: - - uses: actions/checkout@v4 - with: - ref: v${{ needs.prepare.outputs.version }} - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ github.event.inputs.python_version }} - - name: Import GPG Key - if: ${{ startsWith(matrix.os, 'ubuntu-') }} - run: | - gpg --import <<< "${{ secrets.QUTEBROWSER_BOT_GPGKEY }}" - # Needed because of the following import chain: - # - scripts/dev/build_release.py - # - scripts/dev/update_3rdparty.py - # - scripts/dictcli.py - # - qutebrowser/browser/webengine/spell.py - # - utils.message -> utils.usertypes -> utils.qtutils -> qt.gui - # - PyQt6.QtGui - # Some additional packages are needed for a2x to build manpage - - name: Install apt dependencies - if: ${{ startsWith(matrix.os, 'ubuntu-') }} - run: | - sudo apt-get update - sudo apt-get install --no-install-recommends libegl1-mesa libxml2-utils docbook-xml xsltproc docbook-xsl - - name: Install dependencies - run: | - python -m pip install -U pip - python -m pip install -U -r misc/requirements/requirements-tox.txt - # FIXME consider switching to trusted publishers: - # https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ - - name: Build and upload release - run: "tox -e build-release -- --upload --no-confirm" - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.QUTEBROWSER_BOT_PYPI_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - finalize: - runs-on: ubuntu-20.04 - timeout-minutes: 5 - needs: [prepare, release] - permissions: - contents: write # To change release - steps: - - name: Publish final release - uses: actions/github-script@v7 - with: - script: | - await github.rest.repos.updateRelease({ - owner: context.repo.owner, - repo: context.repo.repo, - release_id: "${{ needs.prepare.outputs.release_id }}", - draft: false, - body: "Check the [changelog](https://github.com/qutebrowser/qutebrowser/blob/main/doc/changelog.asciidoc) for changes in this release.", - }) - irc: - timeout-minutes: 2 - continue-on-error: true - runs-on: ubuntu-20.04 - needs: [prepare, release, finalize] - if: "${{ always() }}" - steps: - - name: Send success IRC notification - uses: Gottox/irc-message-action@v2 - if: "${{ needs.finalize.result == 'success' }}" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00033Success:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" - - name: Send main channel IRC notification - uses: Gottox/irc-message-action@v2 - if: "${{ needs.finalize.result == 'success' && github.repository == 'qutebrowser/qutebrowser' }}" - with: - server: irc.libera.chat - channel: '#qutebrowser' - nickname: qutebrowser-bot - message: "qutebrowser v${{ needs.prepare.outputs.version }} has been released! https://github.com/${{ github.repository }}/releases/tag/v${{ needs.prepare.outputs.version }}" - - name: Send non-success IRC notification - uses: Gottox/irc-message-action@v2 - if: "${{ needs.finalize.result != 'success' }}" - with: - server: irc.libera.chat - channel: '#qutebrowser-bots' - nickname: qutebrowser-bot - message: "[${{ github.workflow }}] \u00034FAIL:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})\n - prepare: ${{ needs.prepare.result }}, release: ${{ needs.release.result}}, finalize: ${{ needs.finalize.result }}" diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index 5179a467d78..6c822c8b345 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -33,6 +33,7 @@ Pygments==2.17.2 pytest==8.1.1 pytest-bdd==7.1.2 pytest-benchmark==4.0.0 +pytest-codspeed==2.2.1 pytest-cov==5.0.0 pytest-instafail==0.5.0 pytest-mock==3.14.0 diff --git a/misc/requirements/requirements-tests.txt-raw b/misc/requirements/requirements-tests.txt-raw index 54e03610679..41129651eb4 100644 --- a/misc/requirements/requirements-tests.txt-raw +++ b/misc/requirements/requirements-tests.txt-raw @@ -6,6 +6,7 @@ hypothesis pytest pytest-bdd pytest-benchmark +pytest-codspeed pytest-instafail pytest-mock pytest-qt