mirror of
https://github.com/gomods/athens
synced 2026-02-03 08:40:31 +00:00
* add github actions workflow for tag releases * migrate drone build &test step to github actions * fix minio service * fix indentation * fix dependency syntax * remove needs keyword * fix service hostnames, add protectedredis * update protected redis docker image * fix too many args error * exclude vendor dir from gofmt * fix fmt errors * fix fmt errors * rm .drone.yml * rename workflow name * break test step * remove vendor step * use makefile rule * use buildx
41 lines
713 B
Go
41 lines
713 B
Go
//go:build e2etests
|
|
// +build e2etests
|
|
|
|
package e2etests
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/exec"
|
|
"path/filepath"
|
|
)
|
|
|
|
func setupTestRepo(repoPath, repoURL string) {
|
|
os.RemoveAll(repoPath)
|
|
cmd := exec.Command("git",
|
|
"clone",
|
|
repoURL,
|
|
repoPath)
|
|
|
|
cmd.Run()
|
|
}
|
|
|
|
func chmodR(path string, mode os.FileMode) error {
|
|
return filepath.Walk(path, func(name string, info os.FileInfo, err error) error {
|
|
if err == nil {
|
|
os.Chmod(name, mode)
|
|
}
|
|
return err
|
|
})
|
|
}
|
|
|
|
func cleanGoCache(env []string) error {
|
|
cmd := exec.Command("go", "clean", "--modcache")
|
|
cmd.Env = env
|
|
output, err := cmd.CombinedOutput()
|
|
if err != nil {
|
|
return fmt.Errorf("Failed to clear go cache: %v - %s", err, string(output))
|
|
}
|
|
return nil
|
|
}
|