Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] ci: improve linter output in github actions #4422

Closed
wants to merge 4 commits into from

Conversation

mr-cal
Copy link
Collaborator

@mr-cal mr-cal commented Oct 25, 2023

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run make lint?
  • Have you successfully run pytest tests/unit?

Improve output of linters in CI with:

  • collapsible sections
  • colorized output
  • hidden list of dependencies

See the output here:
https://github.com/snapcore/snapcraft/actions/runs/6645154367/job/18055825986?pr=4422#step:5:1

@mr-cal mr-cal force-pushed the collapse-linters branch 2 times, most recently from 9756412 to bd3e408 Compare October 25, 2023 18:30
Signed-off-by: Callahan Kovacs <[email protected]>
Signed-off-by: Callahan Kovacs <[email protected]>
Signed-off-by: Callahan Kovacs <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2023

Codecov Report

Merging #4422 (4c4fd98) into main (4b1cff5) will decrease coverage by 0.02%.
The diff coverage is n/a.

❗ Current head 4c4fd98 differs from pull request most recent head 4faf267. Consider uploading reports for the commit 4faf267 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             main    #4422      +/-   ##
==========================================
- Coverage   89.18%   89.16%   -0.02%     
==========================================
  Files         322      321       -1     
  Lines       21659    21610      -49     
==========================================
- Hits        19316    19269      -47     
+ Misses       2343     2341       -2     

see 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mr-cal mr-cal changed the title [DRAFT] ci: collapse linters in github actions [DRAFT] ci: improve linter output in github actions Oct 25, 2023
commands_pre =
bash -c "[ -n \"$CI\" ] && echo \"::group::$TOX_ENV_NAME\" || exit 0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have liked to add commands_pre and commands_post once to the [lint] section on line 79, but they don't execute if commands_pre or commands_post are defined in the "child" sections (like this one).

@@ -46,7 +46,7 @@ jobs:
snap watch --last=install
echo "::endgroup::"
- name: Run Linters
run: tox run --skip-pkg-install -m lint
run: tox run --no-list-dependencies --skip-pkg-install --colored=yes -m lint
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--no-list-dependencies isn't automatically being used by default in github actions

@mr-cal mr-cal requested a review from lengau October 25, 2023 19:38
@mr-cal mr-cal changed the title [DRAFT] ci: improve linter output in github actions ci: improve linter output in github actions Oct 25, 2023
@mr-cal mr-cal changed the title ci: improve linter output in github actions [DRAFT] ci: improve linter output in github actions Oct 25, 2023
@mr-cal mr-cal marked this pull request as draft October 25, 2023 20:53
@mr-cal
Copy link
Collaborator Author

mr-cal commented Oct 25, 2023

I need to do some more research. For some reason, craft-providers is automatically making collapsible sections while snapcraft is not:

https://github.com/canonical/craft-providers/actions/runs/6645888307/job/18058153606?pr=436

@mr-cal mr-cal removed the request for review from lengau October 25, 2023 20:54
@mr-cal
Copy link
Collaborator Author

mr-cal commented Nov 2, 2023

Closing in favor of #4435

@mr-cal mr-cal closed this Nov 2, 2023
@mr-cal mr-cal deleted the collapse-linters branch November 2, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants