-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github-action: Allow to specify files in artefacts as input argument #84
Comments
I was thinking about this for some time now. Downloading artifact for local-use might be challenging, requiring a user to supply token, possibly also installing github-cli (I am not really stoked about the idea of writing my own code to interact with GitHub API), also specifying branch, maybe commit, maybe which run (in case of CI re-runs) to use ... there is a lot of complexity here. But let's assume that we do not support interaction between GitHub CI and local runs. I think it would be rather interesting to allow GitHub limits and APIsAs far as I checked, there is not simple and straight forward way to work with GitHub artifacts or caches (upload and download), be it in golang or in Dagger. I found google/go-github (using The problem is that the So at the moment it seems that the best and simplest way is to just stick to official Simple enough projectsFor simple enough projects we can have
Then we have multiple This is a perfect candidate for simplification, to greatly reduce copy-pasting of code. I think we could expand our composite action (right now I mean the action.yml code) to automatically store/restore caches and upload artifacts. Improve composite actionGitHub does not allow repeating single step multiple times, but maybe we could leverage the power of composite actions, and simply call another workflow which would take list of artifacts as input and then matrix over them. Our current name: 'Compile open firmware solution'
description: ...
author: '9elements'
inputs:
config:
...
runs:
using: 'composite'
steps:
- name: Run executable
shell: bash
run: ./firmware-action
env:
INPUT_CONFIG: ${{ inputs.config }}
INPUT_TARGET: ${{ inputs.target }}
INPUT_RECURSIVE: ${{ inputs.recursive }} What I would propose would look something like this: name: 'Compile open firmware solution'
description: ...
author: '9elements'
inputs:
config:
...
runs:
using: 'composite'
steps:
# Get list of artifacts that need to be downloaded (do not build)
- name: Run executable
if: inputs.recursive == false
id: artifacts-to-download
shell: bash
run: ./firmware-action --list-artifacts-to-download
env:
INPUT_CONFIG: ${{ inputs.config }}
INPUT_TARGET: ${{ inputs.target }}
INPUT_RECURSIVE: false
# Call another workflow / action to iterate over the list and download all artifacts (and cache)
- name: Download artifacts
if: inputs.recursive == false
uses: ./mass-download
with:
list: ${{ steps.artifacts-to-download.outputs.list }}
# Run firmware-action and build the firmware
- name: Run executable
id: artifacts-to-upload
shell: bash
run: ./firmware-action
env:
INPUT_CONFIG: ${{ inputs.config }}
INPUT_TARGET: ${{ inputs.target }}
INPUT_RECURSIVE: ${{ inputs.recursive }}
# Upload all artifacts that were produced (as artifacts and as cache)
- name: Upload artifacts
uses: ./mass-upload
with:
list: ${{ steps.artifacts-to-upload.outputs.list }} I think this could also work OK for more complex matrix jobs, hence why the |
On Github Action files are passed between jobs using build artifacts.
Add support for directly accessing files not only in the local file system, but also in a named build artifact of a previous job, for files passed as input argument.
Files in artifacts should follow a specific syntax.
For example:
artifact://name-of-previous-build-step-artifact@/home/github/some/path/within/the/artifact
The text was updated successfully, but these errors were encountered: