Skip to content

feat(ci): only markdown action to skip some CI workflows #13118

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

Merged
merged 7 commits into from
Jun 6, 2025

Conversation

kamuik16
Copy link
Contributor

Related Issues

Closes #13069

Proposed Changes

  • Add a new composite action Only Markdown Changed to detect when a PR modifies only .md files.
  • Introduce a planner job in each workflow that runs this action and outputs only_docs.
  • Update build, test, check, and docer jobs to run only if only_docs != 'true'.
  • Skip all heavy CI steps automatically on docs-only PRs, cutting CI runtime and costs.

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

@github-project-automation github-project-automation bot moved this to 📌 Triage in FilOz May 10, 2025
@rvagg
Copy link
Member

rvagg commented May 11, 2025

@kamuik16 you've got an outdated filecoin-ffi here - I think you branched just at the wrong moment and now have the wrong ffi; rebase on to master and make the ffi change go away and 🤞 your tests should pass

@kamuik16
Copy link
Contributor Author

@kamuik16 you've got an outdated filecoin-ffi here - I think you branched just at the wrong moment and now have the wrong ffi; rebase on to master and make the ffi change go away and 🤞 your tests should pass

Thanks @rvagg, merged master into this one.

@kamuik16 kamuik16 force-pushed the kamui/only-markdown-lint branch from e232ee3 to 3c50c54 Compare May 11, 2025 16:15
@rvagg rvagg requested a review from Copilot May 13, 2025 17:20
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a composite GitHub Action to detect when a PR includes only Markdown file changes and integrates a planner job in several workflows to skip heavy CI steps for docs-only PRs.

  • Added a new composite action for detecting Markdown-only changes.
  • Integrated a planner job into the stale, docker, check, and build workflows to conditionally skip jobs.
  • Updated workflow dependencies to run jobs only when non-doc changes are present.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/stale.yml Added a planner job and conditional trigger in the stale workflow.
.github/workflows/docker.yml Added a planner job and corresponding if condition in the docker workflow.
.github/workflows/check.yml Added a planner job and updated job dependencies in the check workflow.
.github/workflows/build.yml Added a planner job and conditional step to skip build when docs-only.
.github/actions/only-markdown/action.yml Added a composite action to determine if only Markdown files changed.
Comments suppressed due to low confidence (1)

.github/workflows/stale.yml:15

  • [nitpick] Consider aligning the output variable name between the planner job (currently 'only_docs') and the composite action output ('only_markdown_changes') to improve clarity and consistency.
only_docs: ${{ steps.check.outputs.only_markdown_changes }}

Copy link
Member

@BigLep BigLep left a comment

Choose a reason for hiding this comment

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

I'll leave to others to give approval. I wish we didn't need to make checks in every job of of a workflow, but per #13069 I didn't see any way to accomplish this, so your approach seems right.

@kamuik16
Copy link
Contributor Author

Hey @BigLep, @rvagg, I've addressed the initial comments, looking forward for your further opinions here.

Copy link
Member

@BigLep BigLep left a comment

Choose a reason for hiding this comment

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

Thanks @kamuik16.

I wish we could reduce the boiler plate a bit more, but this seems like the best that can be done under the constraints.

Do you have an example PR that tests this to demonstrate that it works?

It seems good to me, but will leave to @rvagg to give the approval/merge.

@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting Review in FilOz May 20, 2025
@kamuik16
Copy link
Contributor Author

Thanks @kamuik16.

I wish we could reduce the boiler plate a bit more, but this seems like the best that can be done under the constraints.

Do you have an example PR that tests this to demonstrate that it works?

It seems good to me, but will leave to @rvagg to give the approval/merge.

Yeah, this is the best way to achieve this under the constraints.

Do you have an example PR that tests this to demonstrate that it works?

For this, this PR itself can be an example (where non .md files changes and build/tests were ran), but I need to think some other way to test only for .md changes.

@BigLep
Copy link
Member

BigLep commented May 27, 2025

but I need to think some other way to test only for .md changes.

If this isn't easy, I wouldn't worry about this. In the worst case, it's not working as desired for markdown only changes and we need to do followups.

@BigLep BigLep requested a review from rvagg May 27, 2025 05:55
@kamuik16
Copy link
Contributor Author

but I need to think some other way to test only for .md changes.

If this isn't easy, I wouldn't worry about this. In the worst case, it's not working as desired for markdown only changes and we need to do followups.

I have tested the commands locally, and it works perfectly fine, and as you said, worst case, the build and test runs, if that happens, which I'm pretty sure won't, I'll fix it.

@kamuik16
Copy link
Contributor Author

kamuik16 commented Jun 3, 2025

Hey @rvagg @BigLep, friendly bump to get review on this :)

Copy link
Member

@BigLep BigLep left a comment

Choose a reason for hiding this comment

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

Approving so this doesn't go more stale and because I think the potential harm here is low.

@github-project-automation github-project-automation bot moved this from 🔎 Awaiting Review to ✔️ Approved by reviewer in FilOz Jun 4, 2025
@BigLep
Copy link
Member

BigLep commented Jun 6, 2025

I'm going to merge this PR since there are fixes that were already in place to fix the failing tests. Given this PR is coming from a fork, I can't directly update that fork with the fixes. Rather than have more back and forth, I think this is safe to just merge.

@BigLep BigLep merged commit e53768c into filecoin-project:master Jun 6, 2025
168 of 174 checks passed
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Jun 6, 2025
@kamuik16 kamuik16 deleted the kamui/only-markdown-lint branch June 7, 2025 05:17
BigLep added a commit that referenced this pull request Jun 9, 2025
galargh added a commit that referenced this pull request Jun 9, 2025
BigLep added a commit that referenced this pull request Jun 9, 2025
…3164)

Revert "feat(ci): only markdown action to skip some CI workflows (#13118)"

This reverts commit e53768c.
BigLep pushed a commit that referenced this pull request Jun 16, 2025
* Revert "feat(ci): only markdown action to skip some CI workflows (#13118)"

This reverts commit e53768c.

* ci: execute some workflows conditionally

* ci: fix markdown filters in check

* ci: update the workflow ignore conditions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🎉 Done
Development

Successfully merging this pull request may close these issues.

Pure markdown documentation updates skip CI workflows like tests
3 participants