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

Create CI workflow that checks README.docify.md's are in sync with README.mds #6331

Closed
iulianbarbu opened this issue Nov 1, 2024 · 2 comments · Fixed by #6359
Closed

Create CI workflow that checks README.docify.md's are in sync with README.mds #6331

iulianbarbu opened this issue Nov 1, 2024 · 2 comments · Fixed by #6359
Assignees
Labels
C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK.

Comments

@iulianbarbu
Copy link
Contributor

iulianbarbu commented Nov 1, 2024

#5954 will introduce a README.md generated from a README.docify.md. We used docify::compile_markdown! inside the lib.rs of the staging-chain-spec-builder crate.

We must search for README.docify.md in the repo, and run cargo build --features generate-readme in the dir of the file (assuming it is related to a crate). If the git diff shows some output for the README.md, then the file update wasn't pushed on the branch, and the workflow should fail.

@iulianbarbu iulianbarbu added the C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. label Nov 1, 2024
@virajbhartiya
Copy link
Contributor

Can I work on this?

@iulianbarbu
Copy link
Contributor Author

Hey @virajbhartiya ! Thanks for the interest and sure, you can look into it. Will assign this to you in the meantime.

github-merge-queue bot pushed a commit that referenced this issue Nov 14, 2024
# Description

Created a workflow to search for README.docify.md in the repo, and run
cargo build --features generate-readme in the dir of the file (assuming
it is related to a crate). If the git diff shows some output for the
README.md, then the file update wasn't pushed on the branch, and the
workflow fails.
Closes #6331

## Integration

Downstream projects that want to adopt this README checking workflow
should:

1. Copy the `.github/workflows/readme-check.yml` file to their
repository
2. Ensure any `README.docify.md` files in their project follow the
expected format
3. Implement the `generate-readme` feature flag in their Cargo.toml if
not already present

## Review Notes

This PR adds a GitHub Actions workflow that automatically verifies
README.md files are up-to-date with their corresponding README.docify.md
sources. Key implementation details:

- The workflow runs on both PRs and pushes to main
- It finds all `README.docify.md` files recursively in the repository
- For each file found:
- Builds the project with `--features generate-readme` in that directory
  - Checks if the README.md has any uncommitted changes
  - Fails if any README.md is out of sync

---------

Co-authored-by: Alexander Samusev <[email protected]>
Co-authored-by: Iulian Barbu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants