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

Add GitHub workflow for checking API compatibility #2182

Merged

Conversation

Marcono1234
Copy link
Collaborator

@Marcono1234 Marcono1234 commented Aug 22, 2022

Resolves #2171

This currently only runs as GitHub workflow but not as part of a regular Maven build. It first checks out the pull request base, builds the project and installs the artifacts into the local Maven repository. Then it checks out the pull request head builds it and compares the artifacts with the previous ones.

The API differences report is uploaded as GitHub artifact, an example can be seen here: https://github.com/google/gson/actions/runs/2905297668
Note that the artifact is produced even when there are non-breaking changes, or no changes. Though in these cases the workflow won't fail.

This is mainly a proof-of-concept, I don't know how well this approach will work for real pull requests.

This uses https://github.com/siom79/japicmp. I don't know whether it covers all cases, so it would be good to not rely on it exclusively.

@Marcono1234 Marcono1234 force-pushed the marcono1234/api-compatibility-workflow branch 2 times, most recently from 2663593 to db82555 Compare August 22, 2022 14:35
@Marcono1234 Marcono1234 force-pushed the marcono1234/api-compatibility-workflow branch 2 times, most recently from 6fb2717 to f3a6e3f Compare August 22, 2022 15:57
@Marcono1234 Marcono1234 marked this pull request as ready for review August 22, 2022 16:04
@eamonnmcmanus
Copy link
Member

Thanks! This may well protect us from future missteps.

@eamonnmcmanus eamonnmcmanus merged commit c2d0ced into google:master Aug 28, 2022
@Marcono1234 Marcono1234 deleted the marcono1234/api-compatibility-workflow branch August 28, 2022 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for binary compatibility during Maven (or CI) build
2 participants