Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: run library generation jobs conditionally (#2698)
In this PR: - Add a job to get changed directories in pull request. - Run library generation tests only if the changed directories contains `library_generation`. Verified in - [Run tests](https://github.com/googleapis/sdk-platform-java/actions/runs/8887270660/job/24402267953) - [Don't run tests](https://github.com/googleapis/sdk-platform-java/actions/runs/8887279933/job/24402294618) The goal is to make library generation tests as a required check. Moreover, we don't want these tests run against every pull requests because only pull requests change library_generation directory should be tested. Currently, the workflow can only run if the files changed are within `paths`. Therefore, we can't set this workflow as required because it will get stuck and prevent merging for pull requests that don't change files within paths. Using this approach, this workflow runs on every pull request and only run actual tests when the condition is met (determined by the first job). Official docs: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks We can make the workflow required after merging this PR and the tests in the workflow will only run if the changed directories contains `library_generation`.
- Loading branch information