forgejo-runner-act/pkg/common
Markus Wolf 11f6ee37a6
Asset server implementation (#677)
* Add asset server and upload handling of binary files

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* Add asset download parts to the asset server

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* Add artifact-server-path flag

If the flag is not defined, the artifact server isn't started.
This includes the configuration of ACTIONS_RUNTIME_URL and
ACTIONS_RUNTIME_TOKEN which are set if the server is started.

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* Move ACTIONS_RUNTIME_* vars into the withGithubEnv setup

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* feat: add artifact server port as flag

This commits adds a flag to define the artifact server port.
If not given, the port defaults to 34567.

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* test: add artifact server tests

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* refactor: use fs.FS

This allows to add tests with in-memory file system

* feat: add support for gzip encoded uploads

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* test: add artifact integration test

* chore: run act tests with asset server path

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* docs: add new cli flags

Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>

* test: add test workflow to testdata

* feat: add log output

* refactor: log shutdown error instead of panic

* feat: use outbound ip for the asset server

This change should allow to use the host ip in macos and windows.
Since docker is running in an intermediate vm, localhost is not
sufficient to have the artifacts in the host system.

* fix: do not use canceled context

To shutdown artifact server, we should not use the already canceled
context but the parent context instead.

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* feat: shutdown artifact server at end of pipeline

When the pipeline is done the asset server should be shut down
gracefully.

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* fix: close server if graceful shutdown failed

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

* fix: ignore server closed error from listen call

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>

Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de>
Co-authored-by: Björn Brauer <bjoern.brauer@new-work.se>
2021-11-10 09:57:22 -08:00
..
cartesian.go Fix Cartesian product to return empty set if empty set is given (#503) 2021-01-23 14:55:54 -08:00
cartesian_test.go Fix indent with go fmt (#531) 2021-02-17 11:47:59 -08:00
draw.go GitHub env file support (#426) 2021-01-11 22:39:43 -08:00
dryrun.go successfully able to run simple workflows 2020-02-20 21:05:25 -05:00
executor.go Clean the repository cache if it is in incomplete state (#595) 2021-04-06 06:43:02 -07:00
executor_test.go Clean the repository cache if it is in incomplete state (#595) 2021-04-06 06:43:02 -07:00
file.go Add super-linter + fix lint issues (#650) 2021-05-03 09:52:03 -07:00
git.go Refresh hash after pull for branch refs (#791) 2021-09-08 16:47:12 +00:00
git_test.go refactor: return more errors, add more tests (#679) 2021-05-08 03:29:03 +00:00
line_writer.go integration test 2020-02-24 12:48:12 -08:00
line_writer_test.go integration test 2020-02-24 12:48:12 -08:00
logger.go successfully able to run simple workflows 2020-02-20 21:05:25 -05:00
outbound_ip.go Asset server implementation (#677) 2021-11-10 09:57:22 -08:00