Commit Graph

1697 Commits

Author SHA1 Message Date
silverwind
4fdf9ab904 Fix executor_test.go: ErrorIs arg order, wrong target, and data races
- TestNewParallelExecutorFailed: fix assert.ErrorIs argument order
- TestNewParallelExecutorCanceled: check for context.Canceled (not the
  executor error) since NewParallelExecutor returns ctx.Err() when
  context is cancelled; use atomic counter to fix data race
- TestNewParallelExecutor: use atomic counters to fix data race with
  concurrent goroutines

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 08:06:05 +01:00
silverwind
8d702e75e7 Fix evalBinaryNodeLeft returning errors.ErrUnsupported instead of nil
The lint fix in 09d1891 incorrectly changed the default return from
(nil, nil) to (nil, errors.ErrUnsupported) to silence a nilnil lint
warning. This broke all binary expression operations (==, !=, >, <,
&&, ||, etc.) because the caller returns early on any non-nil error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 07:59:27 +01:00
Christopher Homberger
c192d65d18 exclude act pkg from vet 2026-02-23 23:33:02 +01:00
Christopher Homberger
b53c54f73d fix last error 2026-02-23 14:09:30 +01:00
silverwind
1670945af3 Fix all 93 lint-go errors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 13:59:05 +01:00
Christopher Homberger
09d18916bf more lint errors 2026-02-23 00:30:44 +01:00
Christopher Homberger
bffc600775 fixes 2026-02-22 21:12:25 +01:00
Christopher Homberger
a27473e6a8 fixes 2026-02-22 21:04:33 +01:00
Christopher Homberger
a77f10683d assert => require 2026-02-22 21:00:42 +01:00
Christopher Homberger
d187ac2fc1 auto adjust code 2026-02-22 20:58:46 +01:00
Christopher Homberger
949a40c7a5 Merge https://gitea.com/actions-oss/act-cli into act-runner-merged 2026-02-22 20:56:21 +01:00
Christopher Homberger
3413919161 update import path 2026-02-22 20:54:58 +01:00
Christopher Homberger
9fd95d203f Merge https://github.com/actions-oss/act-cli into act-runner-merged 2026-02-22 20:38:07 +01:00
Christopher Homberger
52eb6e43cd Merge branch 'main' of gitea.com:gitea/act_runner into act-runner-actions-oss-act 2026-02-22 20:26:32 +01:00
silverwind
658101d9cb chore(lint): add golangci-lint v2 and fix all lint issues (#803)
## Summary
- Replace old `.golangci.yml` (v1 format) with v2 format, aligned with gitea's lint config
- Add `lint-go`, `lint-go-fix`, and `lint` Makefile targets using golangci-lint v2.10.1
- Replace `make vet` with `make lint` in CI workflow (lint includes vet)
- Fix all 35 lint issues: modernize (maps.Copy, range over int, any), perfsprint (errors.New), unparam (remove unused parameters), revive (var naming), staticcheck, forbidigo exclusion for cmd/
- Make `security-check` non-fatal (apply https://github.com/go-gitea/gitea/pull/36681)
- Remove dead gocritic exclusion rules (commentFormatting, exitAfterDefer)
- Remove dead linter exclusions and disabled checks (singleCaseSwitch, ST1003, QF1001, QF1006, QF1008, testifylint go-require/require-error, test file exclusions for dupl/errcheck/staticcheck/unparam)

## Test plan
- [x] `golangci-lint run` passes
- [x] `go build ./...` passes
- [x] `go test ./...` passes

---------

Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/803
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
2026-02-22 17:35:08 +00:00
Christopher Homberger
b48c9c29e9 Merge branch 'act-runner-actions-oss-act' of gitea.com:gitea/act_runner into act-runner-actions-oss-act 2026-02-22 17:34:49 +01:00
Christopher Homberger
cfbb124754 Move logging to another file 2026-02-22 17:34:18 +01:00
Christopher Homberger
340e1de2e3 fix GitHubAPIServerURL 2026-02-22 17:28:48 +01:00
silverwind
f98673129b Merge branch 'main' into act-runner-actions-oss-act 2026-02-22 15:07:57 +00:00
Christopher Homberger
3f008b3310 forget needs 2026-02-22 16:05:39 +01:00
ChristopherHX
f0f9f0c8ab fix: composite action log result reported as step result (#801)
Act logs an array of stepID to signal that this is an partial step result within an composite actions, this is the case for years and act_runner never handled it correctly.

Ref: <43e6958fa3/pkg/runner/logger.go (L142)>

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/801
Reviewed-by: silverwind <silverwind@noreply.gitea.com>
2026-02-22 14:56:09 +00:00
silverwind
ae6e5dfcf7 fix: race condition in reporter between RunDaemon and Close (#796)
## Summary

- Fix data race on `r.closed` between `RunDaemon()` and `Close()` by protecting it with the existing `stateMu` — `closed` is part of the reporter state. `RunDaemon()` reads it under `stateMu.RLock()`, `Close()` sets it inside the existing `stateMu.Lock()` block
- `ReportState` now has a parameter to not report results from runDaemon even if set, from now on `Close` reports the result
- `Close` waits for `RunDaemon()` to signal exit via a closed channel `daemon` before reporting the final logs and state with result, unless something really wrong happens it does not time out
- Add `TestReporter_EphemeralRunnerDeletion` which reproduces the exact scenario from #793: RunDaemon's `ReportState` racing with `Close`, causing the ephemeral runner to be deleted before final logs are sent
- Add `TestReporter_RunDaemonClose_Race` which exercises `RunDaemon()` and `Close()` concurrently to verify no data race on `r.closed` under `go test -race`
- Enable `-race` flag in `make test` so CI catches data races going forward

Based on #794, with fixes for the remaining unprotected `r.closed` reads that the race detector catches.

Fixes #793

---------

Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-authored-by: rmawatson <rmawatson@hotmail.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/796
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-committed-by: silverwind <me@silverwind.io>
2026-02-22 14:52:49 +00:00
Christopher Homberger
9f7b881426 fix lint 2026-02-22 15:51:52 +01:00
Christopher Homberger
0ab72505cc Merge branch 'main' of gitea.com:gitea/act_runner into act-runner-actions-oss-act 2026-02-22 15:45:00 +01:00
silverwind
f4418eff18 chore(deps): update go dependencies (#802)
## Summary
- Update all Go dependencies to latest compatible versions
- Notable updates: connectrpc v1.19.1, cobra v1.10.2, protobuf v1.36.11, otel v1.40.0, actionlint v1.7.11
- docker/docker kept at v25 (v28+ has breaking module restructuring)
- Fix govulncheck issues: update go-git v5.16.2 → v5.16.5 (GO-2026-4473), containerd v1.7.13 → v1.7.29 (GO-2025-4108, GO-2025-4100, GO-2025-3528)
- Remove unnecessary go-git replace directive
- Add `make tidy` and `make tidy-check` Makefile targets
- Clarify `distribution/reference` replace directive comment (needed because `docker/distribution@v2.8.3` uses `reference.SplitHostname` removed in v0.6.0)

## Test plan
- [x] `go build ./...` passes
- [x] `go test ./...` passes
- [x] `govulncheck ./...` passes

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/802
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-committed-by: silverwind <me@silverwind.io>
2026-02-22 11:59:47 +00:00
Christopher Homberger
d4c46e538e add strategy 2026-02-20 21:44:30 +01:00
Christopher Homberger
ae82ca2e97 adapt 2026-02-20 21:37:36 +01:00
Christopher Homberger
d9948c0df4 fix add more ctx 2026-02-20 21:10:28 +01:00
Christopher Homberger
995551f1aa experiment 2026-02-20 21:10:28 +01:00
Christopher Homberger
579b7af04f wip
update go mod
2026-02-20 21:10:16 +01:00
Christopher Homberger
40ee0f3ef6 feat: add act runner compat code (#35)
* attempt to build an act_runner using this implementation of act with minimal changes on act side.

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/35
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2026-02-20 20:06:04 +00:00
Christopher Homberger
17bc93f003 migrate to WithJobLoggerFactory 2026-02-20 14:17:04 +01:00
Christopher Homberger
35df5a61e4 WIP evaluate upgrade 2026-02-20 14:10:55 +01:00
silverwind
0f7efae806 chore(deps): update workflow action versions (#792)
All checks were successful
checks / check and test (push) Successful in 1m41s
## Summary
- `actions/checkout`: v4/v5 → v6
- `actions/setup-go`: v5 → v6
- `docker/build-push-action`: v5 → v6

All other actions (`goreleaser/goreleaser-action@v6`, `docker/setup-qemu-action@v3`, `docker/setup-buildx-action@v3`, `docker/login-action@v3`, `crazy-max/ghaction-import-gpg@v6`) were already at their latest major versions.

No breaking changes affect the current workflow configurations. The main changes in the updated actions are Node.js 24 runtime upgrades and minor feature additions.

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/792
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-committed-by: silverwind <me@silverwind.io>
2026-02-18 06:05:34 +00:00
silverwind
aab249000c chore(deps): update act to v0.261.8 (#791)
## Summary
- Update `gitea.com/gitea/act` from pseudo-version `v0.261.7-0.20251202193638-5417d3ac6742` to `v0.261.8`
- Update yaml import in `workflow.go` from `gopkg.in/yaml.v3` to `go.yaml.in/yaml/v4` to match act's yaml v4 migration
- Add tests to verify yaml/v4 upgrade works correctly

## Changes included in act v0.261.8
- Recover from panics in parallel executor workers ([gitea/act#153](https://gitea.com/gitea/act/pulls/153))
- Fix max-parallel support for matrix jobs ([gitea/act#150](https://gitea.com/gitea/act/pulls/150))
- Fix yaml with prefixed newline broken setjob + yaml v4 ([gitea/act#144](https://gitea.com/gitea/act/pulls/144))
- Fixed typo ([gitea/act#151](https://gitea.com/gitea/act/pulls/151))

## Tests added
- **`Test_generateWorkflow`**: 7 new cases (was 1), covering: no needs, needs as list, workflow env/triggers, container+services, matrix strategy, special YAML characters, and invalid YAML error handling
- **`Test_yamlV4NodeRoundTrip`**: Directly exercises `go.yaml.in/yaml/v4` — `yaml.Node` construction, marshal/unmarshal round-trip, and node kind constants

Fixes: https://gitea.com/gitea/act_runner/issues/371
Fixes: https://gitea.com/gitea/act_runner/issues/772
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/791
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-committed-by: silverwind <me@silverwind.io>
v0.3.0
2026-02-18 05:37:21 +00:00
stecklars
c82077e6b5 examples: improve DIND rootless network performance (#786)
All checks were successful
checks / check and test (push) Successful in 1m13s
## Summary
- Add `DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns` and `DOCKERD_ROOTLESS_ROOTLESSKIT_MTU=65520` to the DIND docker-compose example
- The `docker:dind-rootless` base image defaults to vpnkit as the network driver, which has substantially lower throughput than slirp4netns

## The problem

I noticed that pulling containers as well as downloading data within the container when running act_runner as DIND was very slow (see Ookla speedtest results in the following). While analysing the issue, I found that this was caused by the usage of vpnkit.

The `docker:dind-rootless` base image defaults to vpnkit as the network driver. slirp4netns was [added as an opt-in option](https://github.com/docker-library/docker/pull/543) and must be explicitly enabled via `DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns`.

This means anyone following the current DIND example gets vpnkit, which has significantly lower network throughput. This affects **all** network operations in the container — image pulls, package installs, and CI tasks.

Per the [rootlesskit iperf3 benchmarks](https://github.com/rootless-containers/rootlesskit/blob/master/docs/network.md):

| Driver | MTU 1500 | MTU 65520 |
|--------|----------|-----------|
| **vpnkit** | 0.60 Gbps | not supported |
| **slirp4netns** | 1.06 Gbps | 7.55 Gbps |

## Real-world benchmark results (Ookla speedtest, same server)

| | Download | Upload |
|---|---|---|
| **Default (vpnkit)** | ~130 Mbps | ~126 Mbps |
| **slirp4netns + MTU 65520** | ~958 Mbps | ~462 Mbps |

## References
- [docker-library/docker#543](https://github.com/docker-library/docker/pull/543) — added slirp4netns to dind-rootless as opt-in (vpnkit remains default)
- [rootlesskit network docs](https://github.com/rootless-containers/rootlesskit/blob/master/docs/network.md) — iperf3 benchmarks

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/786
Reviewed-by: silverwind <silverwind@noreply.gitea.com>
Co-authored-by: stecklars <stecklars@noreply.gitea.com>
Co-committed-by: stecklars <stecklars@noreply.gitea.com>
2026-02-16 07:56:45 +00:00
Christopher Homberger
933c4a5bd5 feat: allow configuring gitea schema mode (#23)
* config entries for schema change
* remove broken/unused syntetic nodejs action
* specify desired schema in model struct that is read by unmarshal
* replace params by config
* allows gitea context + env names
* act --gitea now parses a subset of gitea specific workflows

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/23
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2026-02-14 16:23:59 +00:00
Christopher Homberger
faa252c8e9 fix: add branding (#33)
Closes https://gitea.com/actions-oss/act-cli/issues/31

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/33
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2026-02-14 16:16:53 +00:00
silverwind
9f91fdd0eb chore(deps): bump Go version to 1.26 in Dockerfile and Makefile (#788)
All checks were successful
checks / check and test (push) Successful in 1m13s
## Summary
- Bump Dockerfile builder image from `golang:1.24-alpine` to `golang:1.26-alpine`
- Bump Makefile `XGO_VERSION` from `go-1.24.x` to `go-1.26.x`

These were missed in #787 which bumped `go.mod` to Go 1.26.0, causing CI build failures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/788
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-committed-by: silverwind <me@silverwind.io>
2026-02-14 10:32:16 +00:00
silverwind
7a7a5d9051 chore(deps): bump Go version to 1.26.0 (#787)
## Summary
- Bumps Go version from 1.24.0 (toolchain go1.24.11) to 1.26.0
- Fixes CI `govulncheck` failures caused by three standard library vulnerabilities in go1.24.11:
  - GO-2026-4341: Memory exhaustion in `net/url` query parameter parsing
  - GO-2026-4340: Handshake messages at incorrect encryption level in `crypto/tls`
  - GO-2026-4337: Unexpected session resumption in `crypto/tls`

## Test plan
- [x] `make vet` passes
- [x] `make build` passes
- [x] `make test` passes (includes `govulncheck` and all unit tests)

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/787
Reviewed-by: ChristopherHX <christopherhx@noreply.gitea.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-committed-by: silverwind <me@silverwind.io>
2026-02-14 10:19:45 +00:00
Christopher Homberger
8505f73fe4 fix: fallback of localRepository cache being nil (#29)
Doing `act --local-repository test/self-ref@main=/folder-path/self-ref` caused a null pointer exception while fetching a non mapped entry, due to missing remote fallback.

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/29
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2026-02-06 11:11:34 +00:00
Christopher Homberger
6c827eba95 fix: anchor cyclic detection (#30)
Closes #25

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/30
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2026-02-02 20:43:49 +00:00
ChristopherHX
13e0654fd7 fix: gitea release workflow (#22)
Creating release v0.4.0 failed

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/22
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-committed-by: ChristopherHX <christopher.homberger@web.de>
2026-01-31 23:24:09 +00:00
mkesper
90d11b8692 Remove duplicate assignment of DIST (#777)
All checks were successful
checks / check and test (push) Successful in 1m36s
The assignment already happens at line 1.

Signed-off-by: mkesper <mkesper@noreply.gitea.com>

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/777
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: mkesper <mkesper@noreply.gitea.com>
Co-committed-by: mkesper <mkesper@noreply.gitea.com>
2025-12-26 00:38:38 +00:00
Christopher Homberger
c4b57fbcb2 chore(deps): upgrade dependencies (#775)
All checks were successful
checks / check and test (push) Successful in 2m31s
CI uses latest go 24, we may need a cron job after go updates.

Closes https://gitea.com/gitea/act_runner/issues/774

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/775
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2025-12-20 23:35:15 +00:00
Christopher Homberger
0cdc6fd88b test: missing shell property in composite action (#20)
Make sure we report schema errors consistently

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/20
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
2025-12-19 16:25:23 +00:00
ChristopherHX
ce0890578a refactor: move getContainerActionPaths into step interface (#13)
* allows to specialize local vs remote action implementation
* allow paths like ./.. for local action

Closes https://gitea.com/actions-oss/act-cli/issues/12

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/13
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-committed-by: ChristopherHX <christopher.homberger@web.de>
2025-12-19 16:24:48 +00:00
ChristopherHX
ee2e0135d5 feat: implement case function (#16)
Follow GitHub Actions

* added unit tests

Closes #15

Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/16
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-committed-by: ChristopherHX <christopher.homberger@web.de>
2025-12-18 19:27:30 +00:00
Zettat123
e6dbe2a1ca Bump gitea/act (#770)
All checks were successful
checks / check and test (push) Successful in 16m58s
Related to https://gitea.com/gitea/act/pulls/145

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/770
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>
2025-12-02 22:38:31 +00:00
Christopher Homberger
83cbf1f2b8 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>
2025-11-27 14:57:23 +00:00