konveyor / tackle2-ui

Tackle (2nd generation) UI component.
Apache License 2.0
8 stars 43 forks source link

:seedling: Test image build when build related files change #1907

Closed sjd78 closed 6 months ago

sjd78 commented 6 months ago

If the workflow is run from a PR, and the PR includes a change to the Dockerfile or package-lock.json, then run image builds for all of our target platforms.

The images are built but not pushed to any repository.

We want to be reasonably sure that any major build file changes will not cause the image-build-and-push on PR merge workflow to break. Doing the image build here should reveal most problems much earlier. For example, a npm version update in the build container could break github action nofiles or network access capabilities for the npm install.

See #1742, #1746, and #1781 for some other examples of when this check could have caught issues before a PR merge.

Supports: #1883

sjd78 commented 6 months ago

Note: This PR should be backported to release-0.3 and release-0.4 to help protect the active release branches.

Example of the action run against test PRs in my fork:

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 41.22%. Comparing base (b654645) to head (655deda). Report is 138 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1907 +/- ## ========================================== + Coverage 39.20% 41.22% +2.02% ========================================== Files 146 158 +12 Lines 4857 5189 +332 Branches 1164 1323 +159 ========================================== + Hits 1904 2139 +235 + Misses 2939 2931 -8 - Partials 14 119 +105 ``` | [Flag](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1907/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | Coverage Δ | | |---|---|---| | [client](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1907/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `41.22% <ø> (+2.02%)` | :arrow_up: | | [server](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1907/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

djzager commented 6 months ago

In the future it would be nice to include this capability into konveyor/release-tools/.github/workflows/build-push-images.yaml@main.

If you could document what you mean in an issue against the repo (because it isn't immediately obvious how I could put this into the reusable workflow in a way that benefits everyone) that would be supremely helpful to me.