mirror of
https://github.com/coder/coder.git
synced 2026-06-05 14:08:20 +00:00
60de8d0279
This PR introduces many CI optimizations: 1. The `[ci-skip]` PR body directive to skip the Postgres and end to end tests 2. Improved caching that cuts the Go test matrix in half 3. Increasing Go test parallelism for ~20% gains 4. Enable caching in webpack (4x frontend build)
29 lines
574 B
Go
29 lines
574 B
Go
package main
|
|
|
|
import (
|
|
"regexp"
|
|
"strings"
|
|
)
|
|
|
|
const ciSkipPrefix = "ci-skip"
|
|
|
|
var skipDirective = regexp.MustCompile(`\[` + ciSkipPrefix + ` ([\w-\/ ]+)]`)
|
|
|
|
func parseBody(body string) (skips []string) {
|
|
matches := skipDirective.FindAllStringSubmatch(body, -1)
|
|
// flog.Info("matches: %+v", matches)
|
|
|
|
var skipMatches []string
|
|
for i := range matches {
|
|
for j := range matches[i] {
|
|
v := matches[i][j]
|
|
// flog.Info("%q", v)
|
|
if !strings.Contains(v, ciSkipPrefix) {
|
|
skipMatches = append(skipMatches, strings.Split(v, " ")...)
|
|
}
|
|
}
|
|
}
|
|
|
|
return skipMatches
|
|
}
|