Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ci(pr): add file type filter to regulate testing jobs#1031

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@codejedi365
Copy link
Contributor

@codejedi365codejedi365 commentedSep 25, 2024
edited
Loading

Purpose

  • Limit the amount of unimportant jobs the CI does

Rationale

I was able to use a file changes detection action that would distinguish what files changed on a PR and subsequently use conditional statements to turn off the long testing jobs (windows) when it was not relevant. This is obvious when you have a bunch of documentation changes but then the CI would run the entire test suite even though no source code or test code was touched.

I determined to break up the parts of the repository into a few categories: build, ci, doc, src, & test. A less than obvious choice I made but the rationale was to includepyproject.toml in the list of source code files because this is the file in which the dependencies are defined. The dependencies might as well be a part of the source as it will be when at runtime. Furthermore this ensures that all Dependabot PRs will execute the test suite which is super important. It is unfortunate that all other project setting changes will cause tests to run as I cannot isolate just the dependency list itself.

Secondly I used the file-change results to enable the lint job upon any of the file categories but it will not run when files outside of any categories are changed. Testing jobs will execute if there is a source code change, a test code change, or CI reconfigurations. Commitlint job will always run because it is irrelevant to what files were changed but always needs to be enforced.

How did you test?

I opened up PRs on my fork with this PR already in main. I used 3 PRs which had different file changes to make sure each set of jobs executed as expected.codejedi365#2 used non-categorized changes which only ran evaluate-changes and commitlint jobs as expected.codejedi365#3 evaluated that document changes would only add the lint job to the set of jobs of the workflow but not tests.codejedi365#4 evaluated that when the source code changed all the tests executed with the rest of the jobs previously required.

How to Verify

Review the pipeline actions or manually re execute the steps described above to open PRs that fit the criteria and ensure that the workflows act as intended.

As you can also see from this PR itself is that the CI file changes were detected and ensured that the test suites were executed along with lint & commitlint.

@codejedi365codejedi365 merged commit1fa0e70 intopython-semantic-release:masterSep 26, 2024
9 checks passed
@codejedi365codejedi365 deleted the ci/filter-by-changed-files branchSeptember 26, 2024 00:28
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@codejedi365

[8]ページ先頭

©2009-2025 Movatter.jp