ci: GitHub Actions to validate a Maven BOM#5928
ci: GitHub Actions to validate a Maven BOM#5928gcf-merge-on-green[bot] merged 19 commits intomainfrom
Conversation
|
Warning: This pull request is touching the following templated files:
|
|
"ci / bom-content-test" fails. The check detected the invalid entries in the previous gapic-libraries-bom successfully https://github.com/googleapis/java-cloud-bom/actions/runs/4703742327/jobs/8342595777?pr=5928:
#5927 fixes the invalid entries. |
| run: | | ||
| mvn -B -V -ntp verify -Dtest="BomContentTest#testLibrariesBomReachable" | ||
| working-directory: tests |
There was a problem hiding this comment.
This new check can replace testLibrariesBomReachable
| uses: ./tests/validate-bom | ||
| with: | ||
| bom-path: libraries-bom/pom.xml |
There was a problem hiding this comment.
This is how to use the action within the repository.
Until #5927 is merged, this check fails.
| @@ -12,6 +12,7 @@ jobs: | |||
| with: | |||
| distribution: zulu | |||
| # Before this "cd", the working directory is the repository that calls | ||
| # this action. To use validate-bom classes, it needs to change directory | ||
| # to the directory that defines this action. | ||
| cd ${{ github.action_path }} |
There was a problem hiding this comment.
Is this change in directory going to persist for actions that occur after this one? Consider whether a cd - might needed.
There was a problem hiding this comment.
With 5a2b10f#diff-a99b266a2cc5b5faa4e52c7033afaa8f21940a05da21eee64411476434d97788R41 I checked debug print and confirmed this "cd" affects only within this step.
In general, "cd" in shell script invocation with "bash some-script.sh" does not affect the working directory of the caller.
| echo "Compiling CreateBomCanaryProject.java in $(pwd)" | ||
| mvn -V -ntp compile | ||
| echo "Running CreateBomCanaryProject with ${bom_absolute_path}" | ||
| mvn -V -ntp -B exec:java -DoutputPath=/tmp/bom-validation -DbomPath="${bom_absolute_path}" |
There was a problem hiding this comment.
If this action is used twice in a repo with two different BOMs, will the first invocation pollute the project setup or results of the second? (I think the answer is: this is fine. However, if GitHub were to run two BOM validations concurrently, there might be a conflict.) If we're unsure, consider making the BOM's output path calculated from the BOM-under-tests' name.
There was a problem hiding this comment.
if GitHub were to run two BOM validations concurrently
GitHub Actions do not run concurrently on one filesystem.
|
|
||
| Bom bom; | ||
| try { | ||
| bom = Bom.readBom(bomPath); |

Fixes #5922
It worked in googleapis/sdk-platform-java#1629
Todo: