Merge pull request 'make matrix builds unlimited' (#9) from woodpecker-unlimited-matrix-builds into main
Some checks failed
ci/woodpecker/push/update Pipeline was successful
Hydra emoji-caro Hydra build #12132 of nix-packages:aarch64-linux-master:emoji-caro
Hydra packages.woodpecker-server.aarch64-linux Hydra build #13343 of flakes:nix-packages:packages.woodpecker-server.aarch64-linux
ci/woodpecker/cron/update Pipeline failed
Hydra woodpecker-server Hydra build #13340 of nix-packages:aarch64-linux-master:woodpecker-server
Some checks failed
ci/woodpecker/push/update Pipeline was successful
Hydra emoji-caro Hydra build #12132 of nix-packages:aarch64-linux-master:emoji-caro
Hydra packages.woodpecker-server.aarch64-linux Hydra build #13343 of flakes:nix-packages:packages.woodpecker-server.aarch64-linux
ci/woodpecker/cron/update Pipeline failed
Hydra woodpecker-server Hydra build #13340 of nix-packages:aarch64-linux-master:woodpecker-server
Reviewed-on: #9
This commit is contained in:
commit
28cc84c1d0
2 changed files with 45 additions and 0 deletions
|
@ -22,6 +22,8 @@ in
|
|||
|
||||
CGO_ENABLED = 1;
|
||||
|
||||
patches = [./unlimited-matrix.patch];
|
||||
|
||||
passthru = {
|
||||
inherit woodpecker-frontend;
|
||||
|
||||
|
|
43
ci/woodpecker/unlimited-matrix.patch
Normal file
43
ci/woodpecker/unlimited-matrix.patch
Normal file
|
@ -0,0 +1,43 @@
|
|||
diff --git a/pipeline/frontend/yaml/matrix/matrix.go b/pipeline/frontend/yaml/matrix/matrix.go
|
||||
index da5e9f24..c3fe9896 100644
|
||||
--- a/pipeline/frontend/yaml/matrix/matrix.go
|
||||
+++ b/pipeline/frontend/yaml/matrix/matrix.go
|
||||
@@ -22,11 +22,6 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
-const (
|
||||
- limitTags = 10
|
||||
- limitAxis = 25
|
||||
-)
|
||||
-
|
||||
// Matrix represents the pipeline matrix.
|
||||
type Matrix map[string][]string
|
||||
|
||||
@@ -87,25 +82,15 @@ func calc(matrix Matrix) []Axis {
|
||||
for p := 0; p < perm; p++ {
|
||||
axis := map[string]string{}
|
||||
decr := perm
|
||||
- for i, tag := range tags {
|
||||
+ for _, tag := range tags {
|
||||
elems := matrix[tag]
|
||||
decr = decr / len(elems)
|
||||
elem := p / decr % len(elems)
|
||||
axis[tag] = elems[elem]
|
||||
-
|
||||
- // enforce a maximum number of tags in the pipeline matrix.
|
||||
- if i > limitTags {
|
||||
- break
|
||||
- }
|
||||
}
|
||||
|
||||
// append to the list of axis.
|
||||
axisList = append(axisList, axis)
|
||||
-
|
||||
- // enforce a maximum number of axis that should be calculated.
|
||||
- if p > limitAxis {
|
||||
- break
|
||||
- }
|
||||
}
|
||||
|
||||
return axisList
|
Reference in a new issue