From 2d05200b54a857b8ca6a12426303c34e8087b54a Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 30 Mar 2023 19:13:58 -0400 Subject: [PATCH] Post stubtest results to GitHub checks --- .github/workflows/mypy-stubtest.yml | 34 ++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mypy-stubtest.yml b/.github/workflows/mypy-stubtest.yml index e47b08a2385c..f8897d0697fe 100644 --- a/.github/workflows/mypy-stubtest.yml +++ b/.github/workflows/mypy-stubtest.yml @@ -20,11 +20,35 @@ jobs: - name: Install mypy run: | - pip3 install -r requirements/testing/mypy.txt -r requirements/testing/all.txt - pip3 install . + pip3 install -r requirements/testing/mypy.txt \ + -r requirements/testing/all.txt + pip3 install -e . + + - name: Set up reviewdog + run: | + mkdir -p "$HOME/bin" + curl -sfL \ + https://github.com/reviewdog/reviewdog/raw/master/install.sh | \ + sh -s -- -b "$HOME/bin" + echo "$HOME/bin" >> $GITHUB_PATH - name: Run mypy stubtest + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # the ignore missing imports can be removed when typed cycler is released and used - MPLBACKEND=agg python -m mypy.stubtest matplotlib --mypy-config-file pyproject.toml \ - --allowlist ci/mypy-stubtest-allowlist.txt + set -o pipefail + MPLBACKEND=agg python -m mypy.stubtest \ + --mypy-config-file pyproject.toml \ + --allowlist ci/mypy-stubtest-allowlist.txt \ + matplotlib | \ + reviewdog \ + -efm '%Eerror: %m' \ + -efm '%CStub: in file %f:%l' \ + -efm '%CStub: in file %f' \ + -efm '%+CRuntime:%.%#' \ + -efm '%+CMISSING' \ + -efm '%+Cdef %.%#' \ + -efm '%+C<%.%#>' \ + -efm '%Z' \ + -reporter=github-check -tee -name=mypy-stubtest \ + -filter-mode=nofilter