Workflows improvements (ENVs, Caches, Include/Exclude)#4
Conversation
Add custom cache and include/exclude for matrix workflow.
octonato
left a comment
There was a problem hiding this comment.
I see the value of tweaking the cache key and path, but not clear why we need the rest. Could you clarify?
| include: ${{ fromJson(inputs.include) }} | ||
| exclude: ${{ fromJson(inputs.exclude) }} |
There was a problem hiding this comment.
what's the use case for this?
There was a problem hiding this comment.
It's just to support an existed GA matrix behavior.
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-additional-values-in-combinations
It can be useful in the future when we will want to have a more special matrix strategy than the cartesian product of two array with Java and Scala versions.
There was a problem hiding this comment.
Isn't that enough to just call sbt "-Dvar1=value" ++$SCALA_VERSION test?
Why do we need to set vars and let then be resolved?
There was a problem hiding this comment.
Yes, maybe it's not a good example. 😞
I'm trying to solve the restriction that in GA we can't set an ENV vars in parent workflow and then use theirs in reusable workflows 😞
Firstly, currently, the achievement of this is that if cmd is not a single line sbt command but some script, I don't need to set vars as arguments of this script. For example
cmd: "script/big-task.sh"
env: |
VAR1=value
VAR2=valueSecondly, when GA will support YAML Anchors (actions/runner#1182), we will try to use anchor with env vars in parent workflow and just add them to many jobs instead of copy&paste vars as now (see my draft for main repo playframework/playframework#11142). 🤞
octonato
left a comment
There was a problem hiding this comment.
LGTM, but I have the impression that most of the things we are adding here cannot be used yet or we don't need yet.
I'm fine to merge, but maybe we should keep things at a minimal and only add new stuff when we need them.

Add custom env variables for single and matrix workflows.
Add custom cache and include/exclude for matrix workflow.