Skip to content

feature: Action should upload the log of a failed build as an asset #80

@popey

Description

@popey

When a build fails there's no way to get at the log produced by snapcraft. This is especially frustrating when snapcraft itself doesn't produce a useful error in the summary.

Example: https://github.com/popey/twinejs-snap/actions/runs/10046772545/job/27766984335

2024-07-22T19:05:40.7885945Z Generated snap manifest
2024-07-22T19:05:40.7890511Z Reading snap metadata...
2024-07-22T19:05:40.7945791Z Running linters...
2024-07-22T19:05:40.7946938Z Running linter: classic
2024-07-22T19:05:40.7953093Z Running linter: library
2024-07-22T19:05:42.4555335Z Lint warnings:
2024-07-22T19:05:42.4559849Z - library: libXss.so.1: unused library 'usr/lib/x86_64-linux-gnu/libXss.so.1.0.0'. (https://snapcraft.io/docs/linters-library)
2024-07-22T19:05:42.4561141Z - library: libssl3.so: unused library 'usr/lib/x86_64-linux-gnu/libssl3.so'. (https://snapcraft.io/docs/linters-library)
2024-07-22T19:05:42.4662413Z Creating snap package...
2024-07-22T19:05:42.4770096Z Command '['snap', 'pack', '--filename', 'twinejs_2.9.1_amd64.snap', '--compression', 'lzo', PosixPath('/root/prime'), PosixPath('/root/project')]' returned non-zero exit status 1.
2024-07-22T19:05:47.7376191Z Failed to execute pack in instance.
2024-07-22T19:05:47.7418060Z Recommended resolution: Run the same command again with --debug to shell into the environment if you wish to introspect this failure.
2024-07-22T19:05:47.7420054Z Full execution log: '/home/runner/.local/state/snapcraft/log/snapcraft-20240722-190027.468199.log'
2024-07-22T19:05:47.8567833Z ##[error]The process '/usr/bin/sudo' failed with exit code 1
2024-07-22T19:05:47.8677012Z Post job cleanup.
2024-07-22T19:05:47.9553444Z [command]/usr/bin/git version
2024-07-22T19:05:47.9588997Z git version 2.45.2

In the above example, there's no detail about why the final step of creating the package has failed (that's a snapcraft bug, granted), but when this happens, it would be useful to have access to the full log, as I can't login to the runner to get to it manually.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions