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: investigate auto-triggering a test run on release of a new Composer/PHPCS version #197

Open
jrfnl opened this issue Jan 2, 2023 · 4 comments

Comments

@jrfnl
Copy link
Member

jrfnl commented Jan 2, 2023

For Composer releases, I've been manually triggering a test build on each release. Would be nice if we could automate this.

For PHPCS releases, tests/PHPCSVersions.php class needs to be updated on a new release. Again, would be nice if we could automate this.

I'm not sure how to trigger a workflow on the release of another package, but if there is no predefined way to do so, we could possibly do this by:

  1. Having a dev file committed in the repo with the version nr of the "last seen release" of each package.
  2. Running a workflow via a daily cron job which would compare the "last release" from the packages against the stored "last seen release" and would trigger the test/test update workflows if the versions are not the same.
@Potherca
Copy link
Member

Potherca commented Jan 5, 2023

I'm not sure how to trigger a workflow on the release of another package

As far as I'm aware there is no such feature, unless you are the owner of both repos.
The most sane approach would seem to be periodically checking for new releases by using on.schedule.cron

@jrfnl
Copy link
Member Author

jrfnl commented Jan 5, 2023

Sounds like we're on the same track ;-)

@Potherca
Copy link
Member

Potherca commented May 6, 2024

Since opening this issue, both PHP_CodeSniffer and this project live under the same organization, so it should now be possible to trigger a build of the one from the other.

I'd have to look back into my bag of tricks, but from the top of my head, I think it was the repository_dispatch trigger that could be used.

See also community:discussions/26323#6749966

@jrfnl
Copy link
Member Author

jrfnl commented May 6, 2024

Since opening this issue, both PHP_CodeSniffer and this project live under the same organization, so it should now be possible to trigger a build of the one from the other.

I'd have to look back into my bag of tricks, but from the top of my head, I think it was the repository_dispatch trigger that could be used.

See also community:discussions/26323#6749966

... that reminds me... - see #222 ;-)

In one of the other projects, I currently run with a cron job to update the PHPCS version in a test file and automatically open an PR for the update. That's a workflow from before PHPCS itself moved into this organisation though, so I might be able to update it to use the trigger you mentioned.

Having said that, I can imagine that workflow could serve as inspiration for what we need here for the PHPCS side of things (step-wise).

Still wouldn't solve the issue of re-running the tests on new Composer releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants