cabal icon indicating copy to clipboard operation
cabal copied to clipboard

How to use static alpine job for testing

Open mpickering opened this issue 1 year ago • 6 comments
trafficstars

I have a PR in which I wanted to download the artifact from the static alpine job for testing:

https://github.com/haskell/cabal/actions/runs/9205673028/job/25321848983?pr=9900

The job is finished but I can't work out how to download the artifact. Could someone tell me how this job is supposed to be used?

cc @TeofilC

mpickering avatar May 23 '24 12:05 mpickering

I believe it's (somewhat) documented in the readme: https://github.com/haskell/cabal/blob/master/README.md#preview-releases

Even more cutting-edge binaries built from pull requests are always available from the Validate worklow page on GitHub, at the very bottom of the page, or from the build-alpine workflow for statically linked Linux builds.

It's not super precise but it's implied, I think, that the whole Validate workflow has to finish for artifacts to become available.

ulysses4ever avatar May 23 '24 12:05 ulysses4ever

Take any recent Validate workflow page (e.g. this one): you'll find the artifacts at the very bottom of the page, just like the README says. But on the Validate workflow page for your PR they have not appeared yet.

ulysses4ever avatar May 23 '24 12:05 ulysses4ever

The Github actions UX is horrible for this IMO.

From your link (https://github.com/haskell/cabal/actions/runs/9205673028/job/25321848983?pr=9900). You would click Summary on the left sidebar, then scroll all the way down to the bottom and the artifacts are there.

You can also download artifacts via the REST API, but that requires authentication: https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#list-workflow-run-artifacts

TeofilC avatar May 23 '24 13:05 TeofilC

It's worth mentioning that you can download GH action artifact via https://nightly.link without dealing with API authentication.

TerrorJack avatar May 23 '24 14:05 TerrorJack

The gh CLI also offers a quick way to do this.

# Download all artifacts generated by a workflow run
$ gh run download <run-id>

# Download a specific artifact within a run
$ gh run download <run-id> -n <name>

# Download specific artifacts across all runs in a repository
$ gh run download -n <name1> -n <name2>

# Select artifacts to download interactively
$ gh run download

andreabedini avatar May 27 '24 02:05 andreabedini

@mpickering Do you think we need to add documentation about this? What would be the appropriate place?

andreabedini avatar May 27 '24 02:05 andreabedini