lukka / run-cmake

GitHub Action to build C++ applications with CMake (CMakePresets.json), Ninja and vcpkg on GitHub.
MIT License
171 stars 19 forks source link

Upload vcpkg install failure logs as artifact #120

Open quyykk opened 10 months ago

quyykk commented 10 months ago

It would be nice for this action to upload the failure logs if a vcpkg port fails to build. The output always looks like this for example:

      See logs for more information:
        /home/runner/work/user/project/vcpkg/buildtrees/gtk3/config-x64-linux-dynamic-dbg-meson-log.txt.log
        /home/runner/work/user/project/vcpkg/buildtrees/gtk3/config-x64-linux-dynamic-dbg-out.log

It should be possible to parse those paths and upload the files as an artifact to facilitate debugging.

Thoughts? Thanks!

lukka commented 10 months ago

@quyykk yes, there is already such functionality which dumps on the action's log the whole content of the files which match the regex provided by logCollectionRegExps input, see in action.yml:

 logCollectionRegExps:
    default: "\\s*\"(.+CMakeOutput\\.log)\"\\.\\s*;\\s*\"(.+CMakeError\\.log)\"\\.\\s*;\\s*(.+out\\.log)\\s*;\\s+(.+err\\.log)\\s*;\\s*(.+vcpkg.+\\.log)\\s*"
    required: false
    description: "Specifies a semicolon separated list of regular expressions that are used to identify log file paths in the workflow output. A regular expression must have a single capturing group, that is a single pair of parenthesis such as 'See also (.+.log)'. When a match occurs, the content of the file is written into the workflow output for disclosing its content to the user. The default regular expressions are for CMake's and vcpkg's log files."

That regex looks like not matching those files, do you have a link to the run? Also, if you find how to augment the regexp to make it working in your case, I think I'd be super happy to merge the changes in and set them as default