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:
Jason Song authored and Lunny Xiao committed 2023-02-28 23:39:30 +08:00
1 parent 552dbcdda9
commit 436b441cad
11 files changed
+1091 -6

No files matched your search

+8
View File
@@ -8,6 +8,7 @@ import (
"os"
"strings"
"gitea.com/gitea/act_runner/artifactcache"
"gitea.com/gitea/act_runner/client"
"gitea.com/gitea/act_runner/config"
"gitea.com/gitea/act_runner/engine"
@@ -52,6 +53,12 @@ func runDaemon(ctx context.Context, envFile string) func(cmd *cobra.Command, arg
}
}
handler, err := artifactcache.NewHandler()
if err != nil {
return err
}
log.Infof("cache handler listens on: %v", handler.ExternalURL())
var g errgroup.Group
cli := client.New(
@@ -67,6 +74,7 @@ func runDaemon(ctx context.Context, envFile string) func(cmd *cobra.Command, arg
ForgeInstance: cfg.Client.Address,
Environ: cfg.Runner.Environ,
Labels: cfg.Runner.Labels,
CacheHandler: handler,
}
poller := poller.New(