mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-20 11:56:47 +08:00
Port CI to Gitea.com (#1)
# Problems
- [x] Some env variables from act itself / act_runner let the tests fail.
- [ ] CI takes too long to clone actions, need to speed up the used act_runner by sparse checkout
- Runners are reused this speeds up once every runner has ran every job
- [ ] Qemu setup is broken and do not add all platforms like GitHub CI expected` linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/loong64,linux/arm/v7,linux/arm/v6` got `linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/386` without qemu set up
- Test Disabled
- [x] ACTIONS_RUNTIME_TOKEN needs to be unset
- [ ] Snapshot needs our version of the npm package / patching
- Test Disabled
- [ ] ACTIONS_RESULTS_URL:http://127.0.0.1:12345/ seems to be a fallback to localhost this is a problem
- Test Disabled
Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/1
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
This commit is contained in:
committed by
ChristopherHX
parent
2c1a559406
commit
83cbf1f2b8
@@ -212,7 +212,8 @@ func matchesRegex(url string, matchers ...findStringSubmatcher) []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func findGitSlug(url string, githubInstance string) (string, string, error) {
|
||||
// TODO deprecate and remove githubInstance parameter
|
||||
func findGitSlug(url string, _ /* githubInstance */ string) (string, string, error) {
|
||||
if matches := matchesRegex(url, codeCommitHTTPRegex, codeCommitSSHRegex); matches != nil {
|
||||
return "CodeCommit", matches[2], nil
|
||||
}
|
||||
@@ -221,14 +222,13 @@ func findGitSlug(url string, githubInstance string) (string, string, error) {
|
||||
return "GitHub", fmt.Sprintf("%s/%s", matches[1], matches[2]), nil
|
||||
}
|
||||
|
||||
if githubInstance != "github.com" {
|
||||
if matches := matchesRegex(url,
|
||||
regexp.MustCompile(fmt.Sprintf(`^https?://%s/(.+)/(.+?)(?:.git)?$`, githubInstance)),
|
||||
regexp.MustCompile(fmt.Sprintf(`%s[:/](.+)/(.+?)(?:.git)?$`, githubInstance)),
|
||||
); matches != nil {
|
||||
return "GitHubEnterprise", fmt.Sprintf("%s/%s", matches[1], matches[2]), nil
|
||||
}
|
||||
if matches := matchesRegex(url,
|
||||
regexp.MustCompile(`^https?://(?:[^/]+)/([^/]+)/([^/]+)(?:.git)?$`),
|
||||
regexp.MustCompile(`([^/]+)[:/]([^/]+)/([^/]+)(?:.git)?$`),
|
||||
); matches != nil {
|
||||
return "GitHubEnterprise", fmt.Sprintf("%s/%s", matches[1], matches[2]), nil
|
||||
}
|
||||
|
||||
return "", url, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ func TestFindGitSlug(t *testing.T) {
|
||||
{"http://github.com/actions-oss/act-cli", "GitHub", "actions-oss/act-cli"},
|
||||
{"git+ssh://git@github.com/owner/repo.git", "GitHub", "owner/repo"},
|
||||
{"http://myotherrepo.com/act.git", "", "http://myotherrepo.com/act.git"},
|
||||
{"https://gitea.com/actions-oss/act-cli.git", "GitHubEnterprise", "actions-oss/act-cli.git"},
|
||||
}
|
||||
|
||||
for _, tt := range slugTests {
|
||||
|
||||
Reference in New Issue
Block a user