Files
coder/.github/workflows/prcontext/parse.go
T
Ammar Bandukwala 60de8d0279 ci: add skip directives for long tests (#3151)
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)
2022-07-24 14:33:58 -05:00

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
}