gradle / actions

A collection of GitHub Actions to accelerate your Gradle Builds on GitHub
https://github.com/marketplace/actions/build-with-gradle
MIT License
129 stars 28 forks source link

Links to build scans not fetched and reported to summary or PR comments #275

Open warting opened 5 days ago

warting commented 5 days ago

Build scans is published but setup gradle does not retreive the url.

Versions used:

image image

bigdaz commented 3 days ago

Thanks for the report. We have test coverage for this combination of versions, so there must be something about your project that is causing this to fail.

The Job Summary functionality works via Gradle init scripts, which are automatically injected into Gradle User Home. These init-scripts write a results file to $RUNNER_TEMP/.build-results.

Can you please check the following:

  1. Do you see "gradle action failed to write build-results file" in your Gradle output?
  2. Add a step following the Gradle invocation to list the results of the $RUNNER_TEMP/.build-results directory?
  3. In the same step, cat all of the .json files in .build-results to check contents. These JSON files should contain the Build Scan link but I assume in your case they do not.

The added step would look something like this:

    - name: Print build results
      working-directory: ${{ env.RUNNER_TEMP }}
      shell: bash
      run: |
        echo "RUNNER_TEMP = $RUNNER_TEMP"
        ls -la $RUNNER_TEMP
        ls -la $RUNNER_TEMP/.build-results
        find $RUNNER_TEMP/.build-results -name *.json -type f -exec cat {} \;
        echo ""

Once I have a better feel for where this might be failing, I can publish a release with some additional logging to help dig deeper.