From dc7dad5de835df401a8e21d131e32599753abf5b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 11 Jul 2022 10:23:27 +0200 Subject: ci: Add actionlint --- .github/workflows/ci.yml | 10 +++++++++- .github/workflows/recompile-requirements.yml | 9 ++++----- scripts/dev/ci/problemmatchers.py | 16 ++++++++++++++++ tox.ini | 9 ++++++++- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 315bf450d..4f27c4236 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: - testenv: shellcheck args: "-f gcc" # For problem matchers - testenv: yamllint + - testenv: actionlint steps: - uses: actions/checkout@v3 with: @@ -61,6 +62,13 @@ jobs: 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 -qO 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 }}" @@ -100,7 +108,7 @@ jobs: tests: if: "!contains(github.event.head_commit.message, '[ci skip]')" timeout-minutes: 45 - continue-on-error: "${{ matrix.experimental == true }}" + # continue-on-error: "${{ matrix.experimental == true }}" strategy: fail-fast: false matrix: diff --git a/.github/workflows/recompile-requirements.yml b/.github/workflows/recompile-requirements.yml index 0e523fc3f..c6ca53a02 100644 --- a/.github/workflows/recompile-requirements.yml +++ b/.github/workflows/recompile-requirements.yml @@ -7,8 +7,8 @@ on: - cron: '05 04 * * 1' workflow_dispatch: inputs: - environment: - descriptions: 'Test environments to update' + environments: + description: 'Test environments to update' required: false default: '' @@ -30,7 +30,7 @@ jobs: with: python-version: '3.8' - name: Recompile requirements - run: "python3 scripts/dev/recompile_requirements.py ${{ github.events.input.environments }}" + run: "python3 scripts/dev/recompile_requirements.py ${{ github.event.input.environments }}" id: requirements - name: Install apt dependencies run: | @@ -88,5 +88,4 @@ jobs: 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 }}" + message: "[${{ github.workflow }}] \u00034FAIL:\u0003 ${{ github.ref }} https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} (@${{ github.actor }})" diff --git a/scripts/dev/ci/problemmatchers.py b/scripts/dev/ci/problemmatchers.py index d479b3efb..c59eabeb0 100644 --- a/scripts/dev/ci/problemmatchers.py +++ b/scripts/dev/ci/problemmatchers.py @@ -69,6 +69,22 @@ MATCHERS = { }, ], + # https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json + "actionlint": [ + { + "pattern": [ + { + "regexp": r"^(?:\x1b\[\d+m)?(.+?)(?:\x1b\[\d+m)*:(?:\x1b\[\d+m)*(\d+)(?:\x1b\[\d+m)*:(?:\x1b\[\d+m)*(\d+)(?:\x1b\[\d+m)*: (?:\x1b\[\d+m)*(.+?)(?:\x1b\[\d+m)* \[(.+?)\]$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5, + }, + ], + }, + ], + # filename.py:313: unused function 'i_am_never_used' (60% confidence) "vulture": [ { diff --git a/tox.ini b/tox.ini index 19975a8a3..8d33750f3 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py38-pyqt515-cov,mypy,misc,vulture,flake8,pylint,pyroma,check-manifest,eslint,yamllint +envlist = py38-pyqt515-cov,mypy,misc,vulture,flake8,pylint,pyroma,check-manifest,eslint,yamllint,actionlint distshare = {toxworkdir} skipsdist = true minversion = 3.15 @@ -193,6 +193,13 @@ deps = -r{toxinidir}/misc/requirements/requirements-yamllint.txt commands = {envpython} -m yamllint -f colored --strict . {posargs} +[testenv:actionlint] +basepython = python3 +deps = +whitelist_externals = actionlint +commands = + actionlint + [testenv:mypy-diff] basepython = {env:PYTHON:python3} passenv = {[testenv:mypy]passenv} -- cgit v1.2.3-54-g00ecf