From 20eafaac89efa5748694171b2c7d441d93c9f81c Mon Sep 17 00:00:00 2001 From: Igor Sudak Date: Tue, 23 Apr 2024 09:47:46 +0200 Subject: [PATCH] Several improvements (#57) - The preflight-summary GH workflow: don't post linter reports if they don't fit into the comment size limit - Dockerfile: remove pip's cache in ~/.cache/pip - Use `line length = 80 chars` for Pylint and Black --- .github/workflows/preflight-summary.yml | 10 ++++++---- Dockerfile | 6 +++--- pyproject.toml | 4 ++-- requirements-tests.txt | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/preflight-summary.yml b/.github/workflows/preflight-summary.yml index e020513..d92742b 100644 --- a/.github/workflows/preflight-summary.yml +++ b/.github/workflows/preflight-summary.yml @@ -57,11 +57,13 @@ jobs: cat {pylint,black,isort,bandit}-report.md > linter-reports.md 2>/dev/null || true if [[ -s linter-reports.md ]]; then printf "### Linter reports\n" - # Max size of comments on GitHub is 64KB. If the reports > 54KB, don't post them - if [[ $(stat --format=%s linter-reports.md) -gt 55296 ]]; then - printf "The reports are too big to be posted here.\n" - else + # Max size of comments on GitHub is 64KB. Don't post reports if they don't fit. + if awk '{sum += $1} END {exit sum > (62*1024)}' \ + <<< $(stat --format=%s test-summary.md code-coverage-results.md linter-reports.md) + then cat linter-reports.md + else + printf "The reports are too big to be posted here.\n" fi fi diff --git a/Dockerfile b/Dockerfile index bda2c4b..6972931 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM almalinux:9 as cacher +FROM almalinux/9-base:latest as cacher RUN <