1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-06 17:40:58 +00:00

Simplify Matrix decode, add defaults for fail-fast and max-parallel, add test (#763)

* fix[workflow]: multiple fixes for workflow/matrix

fix[workflow]: default `max-parallel`
fix[workflow]: default `fail-fast`, it's `true`, not `false`
fix[workflow]: skipping over the job when `strategy:` is defined but `matrix:` isn't (fixes #625)
fix[workflow]: skip non-existing includes keys and hard fail on non-existing excludes keys
fix[workflow]: simplify Matrix decode (because I "think" I know how `yaml` works) (fixes #760)
fix[tests]: add test for planner and runner

* fix(workflow): use yaml node for env key

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Ryan 2021-08-09 15:35:05 +00:00 committed by GitHub
parent 65f74c5c50
commit 4eb45d4c4b
6 changed files with 237 additions and 73 deletions

View file

@ -9,9 +9,17 @@ import (
"github.com/nektos/act/pkg/model"
assert "github.com/stretchr/testify/assert"
yaml "gopkg.in/yaml.v3"
)
func TestEvaluate(t *testing.T) {
var yml yaml.Node
err := yml.Encode(map[string][]interface{}{
"os": {"Linux", "Windows"},
"foo": {"bar", "baz"},
})
assert.NoError(t, err)
rc := &RunContext{
Config: &Config{
Workdir: ".",
@ -29,10 +37,7 @@ func TestEvaluate(t *testing.T) {
Jobs: map[string]*model.Job{
"job1": {
Strategy: &model.Strategy{
Matrix: map[string][]interface{}{
"os": {"Linux", "Windows"},
"foo": {"bar", "baz"},
},
RawMatrix: yml,
},
},
},