amazon-ion / ion-java

Java streaming parser/serializer for Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
866 stars 110 forks source link

Upload report artifacts from CI workflows for easier diagnosis #472

Open jobarr-amzn opened 1 year ago

jobarr-amzn commented 1 year ago

In #471 we added SpotBugs analysis. During development SpotBugs detected one additional error in the GH workflow compared to local testing, this due to different versions of Java being used for the two. Diagnosis was slower because the report output was not accessible after the workflow ran.

It should be possible to use the upload-artifact action to make reports accessible after workflows are done.

Some caution might be due though, since my first inclination was to upload all report artifacts with something like:

- uses: actions/upload-artifact@v3
  with:
    name: reports
    path: build/reports/

build/reports/ weighs in over 50 MB though, with >30 MB of that due to only build/reports/tests/test/classes/com.amazon.ion.impl.bin.IonManagedBinaryWriterGoodTest.html.

In that case and for other conveniences we should probably just do something like:

- uses: actions/upload-artifact@v3
  with:
    name: spotbugs-report
    path: build/reports/spotbugs/

etc. etc. as needed.

jobarr-amzn commented 1 year ago

Here's an interesting result:

❯ tar --use-compress-program zstd -cf reports.tar.zst reports

❯ du -sh reports*
 53M    reports
2.5M    reports.tar.zst

If we zip up the reports prior to upload we can probably stop worrying about it.

jobarr-amzn commented 1 year ago

If this is done the ciWorkflow parts of spotbugsMain task should be removed: https://github.com/amazon-ion/ion-java/blob/master/build.gradle.kts#L72-L84