summaryrefslogtreecommitdiffstats
path: root/pkg (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix: log skipped job and step result as info instead of debugEarl Warren2024-11-215-5/+52
| | | | | This allows the Forgejo runner to obtain the job result from the logs even when it is not in debug mode.
* fix: [FORGEJO] do not share the act-toolcache volumeEarl Warren2024-11-201-4/+1
| | | | | | | | | In the context of Forgejo the act-toolcache must not be mounted otherwise independent workflows will race against each other when writing to it. For instance if a setup-go action is run at the same time as another, there is a probability that they both write the same file at the same time, which could lead to a truncated or invalid content.
* fix: cache adjust restore order of exact key matches (#2267)ChristopherHX2024-11-072-0/+115
| | | | | | | | | | | | | | | | | * wip: adjust restore order * fixup * add tests * cleanup * fix typo --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit f825e42ce200fc4973c3f28797ffba942d322d38)
* Support overwriting caches (#2265)Jason Song2024-11-073-118/+239
| | | | | | | | | | | | | | | | | | | | | | | | * feat: support overwrite caches * test: fix case * test: fix get_with_multiple_keys * chore: use atomic.Bool * test: improve get_with_multiple_keys * chore: use ping to improve path * fix: wrong CompareAndSwap * test: TestHandler_gcCache * chore: lint code * chore: lint code (cherry picked from commit b9382a2c4e6801d136c246a7e30e7ceafaad3ade)
* fix: docker buildx cache restore not working (#2236)ChristopherHX2024-11-071-1/+1
| | | | | | * To take effect artifacts v4 pr is needed with adjusted claims (cherry picked from commit 75e4ad93f4c6ba51a7a64f12335dd0268dd7465a)
* fix: return an error when the argument count is wrongEarl Warren2024-10-312-0/+56
| | | | Closes forgejo/runner#307
* fix: debug is leaking host container and network namesEarl Warren2024-10-191-1/+0
| | | | Closes forgejo/runner#295
* [FORGEJO] when a workflow decode error happen, log and do not crashEarl Warren2024-09-152-1/+20
|
* fix(jobparser): support `workflow_dispatch.inputs`Michael Kriese2024-08-222-0/+13
|
* fix(jobparser): template job name if it's definedTheFox0x72024-07-014-3/+126
|
* Fix NewDockerNetworkCreateExecutor in docker_stubTobias Bölz2024-04-031-1/+1
|
* [FORGEJO] add forge alias for github (#37)v1.21.0TheFox0x72024-04-021-0/+2
| | | | | | | | | I left gitea for backwards compatibility Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/37 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org> Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
* [FORGEJO] a network of "" is not the same as "host"Earl Warren2024-03-241-8/+1
| | | | | | | | | | The comment that introduced this change suggests it was motivated by a border case by which the image would be empty. It is however unclear why it should have any impact on how the network name is determined. The hunk is reverted. https://github.com/nektos/act/pull/1949/files#r1315163582
* [FORGEJO] Revert "Don't set GITHUB_TOKEN (#2089)"v1.20.0Earl Warren2024-03-112-0/+2
| | | | | | It is a breaking change. This reverts commit 18b4714e38d4871947eff0acb7f1c8f4625fda9f.
* [FORGEJO] feat(docker): Add flag to enable IPv6 in auto-created networks (#24)s3lph2024-03-113-12/+12
| | | | | | | | | Implements one part of forgejo/runner#119. The other part is a corresponding PR in forgejo/runner: forgejo/runner#120. Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/24 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org> Co-authored-by: s3lph <codeberg@s3lph.me> Co-committed-by: s3lph <codeberg@s3lph.me>
* [LXC] global lock on startEarl Warren2024-03-111-0/+2
| | | | | | Since the start script may create LXC templates that are shared, they may race against each other when running for the first time. A lock global to the host needs to be used to guarantee that does not happen.
* [LXC] split platform into template, release and configEarl Warren2024-03-111-25/+50
|
* [FORGEJO] implement lxc separately from self-hostedEarl Warren2024-03-114-63/+90
|
* [FORGEJO] wrap self-hosted platform steps in an LXC containerEarl Warren2024-03-114-10/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | act PR https://github.com/nektos/act/pull/1682 * shell script to start the LXC container * create and destroy a LXC container * run commands with lxc-attach * expose additional devices for docker & libvirt to work * install node 16 & git for checkout to work [FORGEJO] start/stop lxc working directory is /tmp [FORGEJO] use lxc-helpers to create/destroy containers [FORGEJO] do not setup LXC (cherry picked from commit c2eaf440f591cc8800ff59fef9e155d2904e0e37) Conflicts: pkg/container/host_environment.go Conflicts: pkg/container/host_environment.go [FORGJEO] upgrade to node20
* [FORGEJO] sync lxc-helpers 231215c11d38df793521766dcce0e80e824614caEarl Warren2024-03-112-0/+599
|
* Support cloning remote actions from insecure Gitea instances (#92)Zettat1232024-03-053-0/+29
| | | | | | | | | Related to https://github.com/go-gitea/gitea/issues/28693 Reviewed-on: https://gitea.com/gitea/act/pulls/92 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com>
* Patched options() to let container options propagate to job containers (#80)Claudio Nicora2024-03-041-1/+1
| | | | | | | | | | | | | | This PR let "general" container config to be propagated to each job container. See: - https://gitea.com/gitea/act_runner/issues/265#issuecomment-744382 - https://gitea.com/gitea/act_runner/issues/79 - https://gitea.com/gitea/act_runner/issues/378 Reviewed-on: https://gitea.com/gitea/act/pulls/80 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Claudio Nicora <claudio.nicora@gmail.com> Co-committed-by: Claudio Nicora <claudio.nicora@gmail.com>
* Make runs-on support variable expression (#91)sillyguodong2024-03-012-1/+10
| | | | | | | | | | | Partial implementation of https://gitea.com/gitea/act_runner/issues/445, the Gitea side also needs a PR for the entire functionality. Gitea side: https://github.com/go-gitea/gitea/pull/29468 Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act/pulls/91 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-committed-by: sillyguodong <gedong_1994@163.com>
* Merge branch 'nektos/master' into bump-nektosChongyi Zheng2024-02-1739-231/+962
|\
| * fix: use correct path to toolcache (#1494)Markus Wolf2024-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | The toolcache on GitHub Actions need to be in /opt/hostedtoolcache. This is the case for all environment variables set by act, but it's not the case for the volume mounted into the container. Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de> Co-authored-by: ChristopherHX <christopher.homberger@web.de> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * refactor: filecollector into new package (#2174)ChristopherHX2024-01-306-35/+160
| | | | | | | | | | | | | | | | | | * refactor: filecollector into new package * Add test for symlinks * add test fix bug of GetContainerArchive * add test data
| * fix: improve warning about remote not found (#2169)Josh Soref2024-01-281-1/+1
| | | | | | | | Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * fix: improve new-action-cache fetch failure error (#2172)ChristopherHX2024-01-282-2/+8
| | | | | | | | | | | | | | - include repoURL and repoRef in error - map NoErrAlreadyUptodate to `couldn't find remote ref` for branchOrtag fetch request Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * fix: subpath actions via new artifact cache (#2170)ChristopherHX2024-01-282-9/+10
| | | | | | Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * fix: improve action not found error (#2171)ChristopherHX2024-01-281-6/+18
| |
| * Add containerd's normalized architectures to archMapper (#2168)Matthew2024-01-241-0/+2
| |
| * WorkflowDispatchConfig supports multiple yaml node kinds (#2123)胖梁2024-01-202-13/+135
| | | | | | | | | | | | | | | | | | | | | | * WorkflowDispatchConfig supports ScalarNode and SequenceNode yaml node kinds * Avoid using log.Fatal * package slices is not in golang 1.20 --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * fix: match cache `restore-keys` in creation reverse order (#2153)Kristoffer2024-01-201-1/+7
| | | | | | | | | | | | | | | | | | * Match cache restore-keys in creation reverse order * Match full prefix when selecting cache --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * feat: support offline mode (#2128)TKaxv_7S2024-01-204-18/+27
| | | | | | | | | | | | | | | | | | * Add: Actions Offline Mode * Add: Actions Offline Mode --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * feat: cli option to enable the new action cache (#1954)ChristopherHX2024-01-208-16/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Enable the new action cache * fix * fix: CopyTarStream (Docker) * suppress panic in test * add a cli option for opt in * fixups * add package * fix * rc.Config nil in test??? * add feature flag * patch * Fix respect --action-cache-path Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de> * add remote reusable workflow to ActionCache * fixup --------- Co-authored-by: Björn Brauer <zaubernerd@zaubernerd.de> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * Add support for NetBSD (#2023)Leonardo Taccari2024-01-0810-10/+10
| | | | | | | | | | | | | | | | | | NetBSD can run Docker CLI and then use Docker on some remote machine via DOCKER_HOST. (This can be probably extended to all other Unix-es capable of running just Docker CLI.) Co-authored-by: ChristopherHX <christopher.homberger@web.de>
| * Fix noisy `runs-on` error logging (#2102)Jon Jensen2023-12-171-1/+4
| | | | | | | | | | | | | | | | | | | | Move the logging back up a level to fix a minor logging issue introduced in #2088 `RunContext`s for composite actions have dummy/blank `Job`s with no `runs-on`, meaning their calls to `withGithubEnv` would result in an inaccurate log message complaining that `'runs-on' key not defined in ...` Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * fix: IsHost is defined as false on windows (#2093)ChristopherHX2023-12-161-4/+2
| | | | | | | | | | | | | | * fix: IsHost is defined as false on windows * Update docker_run.go * Update docker_run.go
| * Evaluate if condition when calling a reusable workflow (#2087)Jon Jensen2023-11-122-2/+15
| | | | | | | | Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: ChristopherHX <christopher.homberger@web.de>
| * feat: support runs-on labels and group (#2062)raffis2023-11-122-2/+61
| | | | | | | | Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com> Co-authored-by: ChristopherHX <christopher.homberger@web.de>
| * Evaluate all service values (#2054)Björn Brauer2023-11-121-4/+13
| | | | | | Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * fix: (#2075)ChristopherHX2023-11-121-1/+3
| | | | | | | | | | network-scoped alias is supported only for containers in user defined networks Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * Don't set GITHUB_TOKEN (#2089)Jon Jensen2023-11-122-2/+0
| | | | | | | | | | This needs to be explicitly in the `env` to be consistent with GitHub Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * Support array expressions in runs-on (#2088)Jon Jensen2023-11-122-16/+65
| | | | | | | | | | | | | | | | | | * Support array expressions in runs-on * Simplify appproach to use EvaluateYamlNode, fix case-sensitivity bug --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * Use unique name for reusable workflow (#2015)Andreas Taylor2023-11-121-1/+1
| | | | | | Co-authored-by: ChristopherHX <christopher.homberger@web.de>
| * fix: panic (#2071)Jason Song2023-11-041-11/+14
| | | | | | Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
| * Add support for service containers (#1949)Sam Foo2023-10-1912-100/+465
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support services (#42) Removed createSimpleContainerName and AutoRemove flag Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act/pulls/42 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com> * Support services options (#45) Reviewed-on: https://gitea.com/gitea/act/pulls/45 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com> * Support intepolation for `env` of `services` (#47) Reviewed-on: https://gitea.com/gitea/act/pulls/47 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com> * Support services `credentials` (#51) If a service's image is from a container registry requires authentication, `act_runner` will need `credentials` to pull the image, see [documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idservicesservice_idcredentials). Currently, `act_runner` incorrectly uses the `credentials` of `containers` to pull services' images and the `credentials` of services won't be used, see the related code: https://gitea.com/gitea/act/src/commit/0c1f2edb996a87ee17dcf3cfa7259c04be02abd7/pkg/runner/run_context.go#L228-L269 Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act/pulls/51 Reviewed-by: Jason Song <i@wolfogre.com> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com> * Add ContainerMaxLifetime and ContainerNetworkMode options from: https://gitea.com/gitea/act/commit/b9c20dcaa43899cb3bb327619d447248303170e0 * Fix container network issue (#56) Follow: https://gitea.com/gitea/act_runner/pulls/184 Close https://gitea.com/gitea/act_runner/issues/177 - `act` create new networks only if the value of `NeedCreateNetwork` is true, and remove these networks at last. `NeedCreateNetwork` is passed by `act_runner`. 'NeedCreateNetwork' is true only if `container.network` in the configuration file of the `act_runner` is empty. - In the `docker create` phase, specify the network to which containers will connect. Because, if not specify , container will connect to `bridge` network which is created automatically by Docker. - If the network is user defined network ( the value of `container.network` is empty or `<custom-network>`. Because, the network created by `act` is also user defined network.), will also specify alias by `--network-alias`. The alias of service is `<service-id>`. So we can be access service container by `<service-id>:<port>` in the steps of job. - Won't try to `docker network connect ` network after `docker start` any more. - Because on the one hand, `docker network connect` applies only to user defined networks, if try to `docker network connect host <container-name>` will return error. - On the other hand, we just specify network in the stage of `docker create`, the same effect can be achieved. - Won't try to remove containers and networks berfore the stage of `docker start`, because the name of these containers and netwoks won't be repeat. Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act/pulls/56 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-committed-by: sillyguodong <gedong_1994@163.com> * Check volumes (#60) This PR adds a `ValidVolumes` config. Users can specify the volumes (including bind mounts) that can be mounted to containers by this config. Options related to volumes: - [jobs.<job_id>.container.volumes](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontainervolumes) - [jobs.<job_id>.services.<service_id>.volumes](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idservicesservice_idvolumes) In addition, volumes specified by `options` will also be checked. Currently, the following default volumes (see https://gitea.com/gitea/act/src/commit/a72822b3f83d3e68ffc697101b713b7badf57e2f/pkg/runner/run_context.go#L116-L166) will be added to `ValidVolumes`: - `act-toolcache` - `<container-name>` and `<container-name>-env` - `/var/run/docker.sock` (We need to add a new configuration to control whether the docker daemon can be mounted) Co-authored-by: Jason Song <i@wolfogre.com> Reviewed-on: https://gitea.com/gitea/act/pulls/60 Reviewed-by: Jason Song <i@wolfogre.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com> * Remove ContainerMaxLifetime; fix lint * Remove unused ValidVolumes * Remove ConnectToNetwork * Add docker stubs * Close docker clients to prevent file descriptor leaks * Fix the error when removing network in self-hosted mode (#69) Fixes https://gitea.com/gitea/act_runner/issues/255 Reviewed-on: https://gitea.com/gitea/act/pulls/69 Co-authored-by: Zettat123 <zettat123@gmail.com> Co-committed-by: Zettat123 <zettat123@gmail.com> * Move service container and network cleanup to rc.cleanUpJobContainer * Add --network flag; default to host if not using service containers or set explicitly * Correctly close executor to prevent fd leak * Revert to tail instead of full path * fix network duplication * backport networkingConfig for aliaes * don't hardcode netMode host * Convert services test to table driven tests * Add failing tests for services * Expose service container ports onto the host * Set container network mode in artifacts server test to host mode * Log container network mode when creating/starting a container * fix: Correctly handle ContainerNetworkMode * fix: missing service container network * Always remove service containers Although we usually keep containers running if the workflow errored (unless `--rm` is given) in order to facilitate debugging and we have a flag (`--reuse`) to always keep containers running in order to speed up repeated `act` invocations, I believe that these should only apply to job containers and not service containers, because changing the network settings on a service container requires re-creating it anyway. * Remove networks only if no active endpoints exist * Ensure job containers are stopped before starting a new job * fix: go build -tags WITHOUT_DOCKER --------- Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: sillyguodong <gedong_1994@163.com> Co-authored-by: ChristopherHX <christopher.homberger@web.de> Co-authored-by: ZauberNerd <zaubernerd@zaubernerd.de>
| * Fix float formatting (#2018)Jon Jensen2023-10-132-1/+2
| | | | | | | | | | | | Format floats the same way as actions/runner (precision 15, remove trailing zeroes) See: https://github.com/actions/runner/blob/67d70803a95fca2fc86d89231acbc319f9a9be2a/src/Sdk/DTObjectTemplating/ObjectTemplating/Tokens/NumberToken.cs#L34
* | fix: panicJason Song2023-10-311-15/+17
| |
* | Merge remote-tracking branch 'upstream/master' into bump-nektostechknowlogick2023-10-117-22/+5216
|\|