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

ci: Make badges consistent, run markdownlint all .md files #42

Merged
merged 5 commits into from
Aug 24, 2023

Conversation

spetrosi
Copy link
Contributor

  • Consistently generate badges for GH workflows in roles RHELPLAN-146921
  • Run markdownlint on all .md files
  • Rename woke action to Woke for a pretty badge

firstmatch: true
line: "\n \
{%- if 'python_roles' in group_names -%}\
![CodeQL](https://github.com/linux-system-roles/{{ inventory_hostname }}/workflows/CodeQL/badge.svg) \
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be cool if we could somehow associate each badge with an action so that we didn't have this hardcoded list here.
The journald role has all of the badges in the title line - see https://github.com/linux-system-roles/journald/blob/main/README.md

Copy link
Contributor Author

@spetrosi spetrosi Aug 22, 2023

Choose a reason for hiding this comment

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

Not sure what you meant under "associate each badge with an action", but I found a way to automatically generate these badges from existing workflow, excluding some of them that do not require a badge. And also added present_badges in roles' host_vars to define role-specific badges. Tested it with network in linux-system-roles/network#631 so far. Please take a look.

playbooks/update_files.yml Outdated Show resolved Hide resolved
- Consistently generate badges for GH workflows in roles RHELPLAN-146921
- Run markdownlint on all .md files
- Rename woke action to Woke for a pretty badge
playbooks/update_files.yml Outdated Show resolved Hide resolved
playbooks/update_files.yml Outdated Show resolved Hide resolved
* Only update the badges line with lineinfile
* Use linux-system-roles/lsr-woke-action
* For metrics, ignore vendor directory with markdownlint
present_badges:
- "[![Coverage Status](https://coveralls.io/repos/github/linux-system-roles/network/badge.svg)](https://coveralls.io/github/linux-system-roles/network)"
- "[![Code Style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)"
- "[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/linux-system-roles/network.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/linux-system-roles/network/context:python)"
Copy link
Contributor

Choose a reason for hiding this comment

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

ok - but note that lgtm.com is deprecated and will be removed at some point https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just used what's in the network role already. We can revisit it later.

regex: \[\!.*
firstmatch: true
line: "{%-for file in find.files -%}\
[![{{ file.path | basename }}]\
Copy link
Contributor

Choose a reason for hiding this comment

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

This means the badge will have the filename instead of a "user friendly" name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, GitHub renders this fine to the name of the workflow, and it's easier to get the filename than to read it's name from a file.

@spetrosi spetrosi merged commit eb327e9 into linux-system-roles:main Aug 24, 2023
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