Generated graph is submitted immediately by dependency-submission action

While `setup-gradle` must wait until the end of job to submit all of the generated
graphs, the `dependency-submission` action will not save/upload the generated graph
immediately, in the same step where it is generated.
This commit is contained in:
daz
2024-04-07 12:27:51 -06:00
parent 38a821729e
commit 90bf65c87c
7 changed files with 105 additions and 69 deletions

View File

@@ -16,5 +16,9 @@ jobs:
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Submission'
uses: ./dependency-submission
with:
build-root-directory: .github/workflow-samples/groovy-dsl
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4

View File

@@ -89,51 +89,72 @@ jobs:
with:
build-root-directory: .github/workflow-samples/kotlin-dsl
# TODO - Test this scenario (and make it work)
# multiple-builds:
# strategy:
# matrix:
# os: ${{fromJSON(inputs.runner-os)}}
# runs-on: ${{ matrix.os }}
# steps:
# - name: Checkout sources
# uses: actions/checkout@v4
# - name: Initialize integ-test
# uses: ./.github/actions/init-integ-test
multiple-builds:
strategy:
matrix:
os: ${{fromJSON(inputs.runner-os)}}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Initialize integ-test
uses: ./.github/actions/init-integ-test
- id: kotlin-dsl
uses: ./dependency-submission
with:
build-root-directory: .github/workflow-samples/kotlin-dsl
- id: groovy-dsl
uses: ./dependency-submission
with:
build-root-directory: .github/workflow-samples/groovy-dsl
- id: groovy-dsl-again
uses: ./dependency-submission
with:
build-root-directory: .github/workflow-samples/groovy-dsl
additional-arguments: --no-build-cache
- name: Check generated dependency graphs
shell: bash
run: |
echo "kotlin-dsl report file: ${{ steps.kotlin-dsl.outputs.dependency-graph-file }}"
echo "groovy-dsl report file: ${{ steps.groovy-dsl.outputs.dependency-graph-file }}"
echo "groovy-dsl-again report file: ${{ steps.groovy-dsl-again.outputs.dependency-graph-file }}"
ls -l dependency-graph-reports
if [ ! -e "${{ steps.kotlin-dsl.outputs.dependency-graph-file }}" ]; then
echo "Did not find kotlin-dsl dependency graph file"
exit 1
fi
if [ ! -e "${{ steps.groovy-dsl.outputs.dependency-graph-file }}" ]; then
echo "Did not find groovy-dsl dependency graph file"
exit 1
fi
if [ ! -e "${{ steps.groovy-dsl-again.outputs.dependency-graph-file }}" ]; then
echo "Did not find groovy-dsl-again dependency graph file"
exit 1
fi
multiple-builds-upload:
strategy:
matrix:
os: ${{fromJSON(inputs.runner-os)}}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Initialize integ-test
uses: ./.github/actions/init-integ-test
- id: kotlin-dsl
uses: ./dependency-submission
with:
dependency-graph: generate-and-upload
build-root-directory: .github/workflow-samples/kotlin-dsl
- id: groovy-dsl
uses: ./dependency-submission
with:
dependency-graph: generate-and-upload
build-root-directory: .github/workflow-samples/groovy-dsl
# - name: Setup Gradle for dependency-graph generate
# uses: ./setup-gradle
# with:
# dependency-graph: generate-and-submit
# - id: gradle-assemble
# run: ./gradlew assemble
# working-directory: .github/workflow-samples/groovy-dsl
# - id: gradle-build
# run: ./gradlew build
# working-directory: .github/workflow-samples/groovy-dsl
# - id: gradle-build-again
# run: ./gradlew build
# working-directory: .github/workflow-samples/groovy-dsl
# - name: Check generated dependency graphs
# shell: bash
# run: |
# echo "gradle-assemble report file: ${{ steps.gradle-assemble.outputs.dependency-graph-file }}"
# echo "gradle-build report file: ${{ steps.gradle-build.outputs.dependency-graph-file }}"
# echo "gradle-build-again report file: ${{ steps.gradle-build-again.outputs.dependency-graph-file }}"
# ls -l dependency-graph-reports
# if [ ! -e "${{ steps.gradle-assemble.outputs.dependency-graph-file }}" ]; then
# echo "Did not find gradle-assemble dependency graph file"
# exit 1
# fi
# if [ ! -e "${{ steps.gradle-build.outputs.dependency-graph-file }}" ]; then
# echo "Did not find gradle-build dependency graph files"
# exit 1
# fi
# if [ ! -e "${{ steps.gradle-build-again.outputs.dependency-graph-file }}" ]; then
# echo "Did not find gradle-build-again dependency graph files"
# exit 1
# fi
config-cache:
runs-on: ubuntu-latest
steps:
@@ -154,7 +175,7 @@ jobs:
echo "Did not find config-cache-store dependency graph files"
exit 1
fi
rm ${{ steps.config-cache-store.outputs.dependency-graph-file }}
rm ${{ steps.config-cache-store.outputs.dependency-graph-file }}*
- id: config-cache-reuse
uses: ./dependency-submission
with: