Support multiple invocations in dependency-graph init script

If an existing dependency graph file is present for the configured job correlator,
we now generate a unique correlator value for the invocation. This allows the action
to submit dependency snapshots for a series of Gradle invocations within the same Job.

This commit updates to `github-dependency-graph-gradle-plugin@v0.0.6`, which reduces
redundancy in the mapping of resolved Gradle dependencies to the GitHub Dependency Graph.
This commit is contained in:
daz 2023-07-15 18:06:38 -06:00
parent 3c11eee5f9
commit b69de5f2a9
No known key found for this signature in database
4 changed files with 100 additions and 10 deletions

View file

@ -66,3 +66,33 @@ jobs:
uses: ./
with:
dependency-graph: download-and-submit
multiple-builds:
runs-on: "ubuntu-latest"
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Download distribution if required
uses: ./.github/actions/download-dist
- name: Setup Gradle for dependency-graph generate
uses: ./
with:
dependency-graph: generate
- name: Run assemble
run: ./gradlew assemble
working-directory: .github/workflow-samples/groovy-dsl
env:
GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR: job-correlator
- name: Run build
run: ./gradlew build
working-directory: .github/workflow-samples/groovy-dsl
env:
GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR: job-correlator
- name: Check generated dependency graphs
run: |
ls -l dependency-graph-reports
if ([ ! -e dependency-graph-reports/job-correlator.json ] || [ ! -e dependency-graph-reports/job-correlator-1.json ])
then
echo "Did not find expected dependency graph files"
exit 1
fi