mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-08 00:00:28 +00:00
Support cache (#25)
See [Caching dependencies to speed up workflows](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows). Reviewed-on: https://gitea.com/gitea/act_runner/pulls/25 Reviewed-by: Lunny Xiao <[email protected]> Reviewed-by: Zettat123 <[email protected]> Co-authored-by: Jason Song <[email protected]> Co-committed-by: Jason Song <[email protected]>
This commit is contained in:
1 parent
552dbcdda9
commit
436b441cad
11 files changed
+1091
-6
No files matched your search
+9
-1
@@ -8,6 +8,8 @@ import (
|
||||
"strings"
|
||||
|
||||
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
|
||||
|
||||
"gitea.com/gitea/act_runner/artifactcache"
|
||||
"gitea.com/gitea/act_runner/client"
|
||||
)
|
||||
|
||||
@@ -18,11 +20,17 @@ type Runner struct {
|
||||
Environ map[string]string
|
||||
Client client.Client
|
||||
Labels []string
|
||||
CacheHandler *artifactcache.Handler
|
||||
}
|
||||
|
||||
// Run runs the pipeline stage.
|
||||
func (s *Runner) Run(ctx context.Context, task *runnerv1.Task) error {
|
||||
return NewTask(s.ForgeInstance, task.Id, s.Client, s.Environ, s.platformPicker).Run(ctx, task)
|
||||
env := map[string]string{}
|
||||
for k, v := range s.Environ {
|
||||
env[k] = v
|
||||
}
|
||||
env["ACTIONS_CACHE_URL"] = s.CacheHandler.ExternalURL() + "/"
|
||||
return NewTask(s.ForgeInstance, task.Id, s.Client, env, s.platformPicker).Run(ctx, task)
|
||||
}
|
||||
|
||||
func (s *Runner) platformPicker(labels []string) string {
|
||||
|
||||
Reference in new issue
Block a user