mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
Fixes include when using matrix and strategy build. (#415)
* fixes include directive of strategy build. * Adds test for include and exclude in matrix builds. * ubuntu-16.04 instead of 20.04 * Adds more platforms for runner_test Prevent most "skipping unsupported platform messages". * correct printing for unsupported platform * fix merge
This commit is contained in:
parent
2202cd3cba
commit
b4f337a5c3
4 changed files with 42 additions and 10 deletions
|
@ -3,6 +3,7 @@ package model
|
|||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
|
@ -176,16 +177,12 @@ func (j *Job) GetMatrixes() []map[string]interface{} {
|
|||
continue MATRIX
|
||||
}
|
||||
}
|
||||
for _, include := range includes {
|
||||
if commonKeysMatch(matrix, include) {
|
||||
log.Debugf("Setting add'l values on matrix '%v' due to include '%v'", matrix, include)
|
||||
for k, v := range include {
|
||||
matrix[k] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
matrixes = append(matrixes, matrix)
|
||||
}
|
||||
for _, include := range includes {
|
||||
log.Debugf("Adding include '%v'", include)
|
||||
matrixes = append(matrixes, include)
|
||||
}
|
||||
|
||||
} else {
|
||||
matrixes = append(matrixes, make(map[string]interface{}))
|
||||
|
@ -195,7 +192,7 @@ func (j *Job) GetMatrixes() []map[string]interface{} {
|
|||
|
||||
func commonKeysMatch(a map[string]interface{}, b map[string]interface{}) bool {
|
||||
for aKey, aVal := range a {
|
||||
if bVal, ok := b[aKey]; ok && aVal != bVal {
|
||||
if bVal, ok := b[aKey]; ok && ! reflect.DeepEqual(aVal, bVal) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue