mirror of
https://github.com/nektos/act.git
synced 2026-04-26 09:25:54 +03:00
[PR #964] [MERGED] fix: deep evaluate matrix strategy #1706
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#1706
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/nektos/act/pull/964
Author: @ChristopherHX
Created: 1/23/2022
Status: ✅ Merged
Merged: 2/15/2022
Merged by: @mergify[bot]
Base:
master← Head:fix/evaluate_matrix📝 Commits (7)
92414acfix: deep evaluate matrix strategyf538b28Try to make linter happy.40f2758Apply PR feedback, fix insert directive more tests9c51a5dFix: logic errorba85761Merge branch 'master' into fix/evaluate_matrix454db0bMerge branch 'master' into fix/evaluate_matrix0cce8cbMerge branch 'master' into fix/evaluate_matrix📊 Changes
8 files changed (+238 additions, -46 deletions)
View changed files
📝
pkg/runner/expression.go(+78 -0)📝
pkg/runner/runner.go(+58 -46)📝
pkg/runner/runner_test.go(+5 -0)➕
pkg/runner/testdata/evalmatrix-merge-array/push.yml(+12 -0)➕
pkg/runner/testdata/evalmatrix-merge-map/push.yml(+14 -0)➕
pkg/runner/testdata/evalmatrix/push.yml(+18 -0)➕
pkg/runner/testdata/evalmatrixneeds/push.yml(+24 -0)➕
pkg/runner/testdata/evalmatrixneeds2/push.yml(+29 -0)📄 Description
We need to wait for the previous stage to finish, otherwise we don't know how the final strategy will look like.
Then we need to evaluate all expression nodes of the strategy.matrix property, even the mapping keys.
I also added support for the insert directive and array merge operations, both are undocumented features of the github/actions which are available since 2019.
My tests aren't cover all possibilities, but the fixed issue has a test.
Most likely this change collides with @catthehacker plans of rewriting the yaml parser to actionslint, since I use the current yaml.Node types.
I have no idea how big the regressions regarding parallelism are with this change.
Resolves https://github.com/nektos/act/issues/927
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.