feat: merge forgejo/act/pkg in the act directory #753
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo/runner!753
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "earl-warren/runner:wip-act"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The https://code.forgejo.org/forgejo/act repository is merged into the runner, as the
actsub-directory, preserving the commit history.This pull request is extremely large and it will be a noop when merged. To effectively be used by the runner, the following must also happen:
Although this could be done in this pull request, it feels that it could be done in a followup pull request that is not so large and easier to review.
Extract from ACT
Only keep the pkg directory and rename it act.
Merge
Ignore the act directory
The
actdirectory is ignored (commitchore: ignore the act directory for now) when:secret-filein README and add example 6bdb714a0f* set ${{github.event.repository.default_branch}} * change `ok == false` to `!ok` Co-authored-by: Casey Lee <[email protected]>ifexpression is invalid (#485) 0d8e2101cbwith:inputs (#511) 30dc143809README.md/cmd/root.gowith additional information (#523) 1206c3348auses(#530) f15abae92eexpression_test.go/run_context_test.go(#560) fa98d68724ImageOSenv var based on running platform (#571) 195e84f0fd/etc/environment(#570) 7ae8a0d895sc.Envthroughcommon.Loggerto hide secrets (#578) c795435c2dubuntu-latestforImageOSenvvar (#579) bd3f8422d6ubuntu-latestto point toubuntu-20.04(#580) fb937040ab.actrc(#577) e643c2625erun:/uses:keys are used (#593) ac3046915e.actrclocations and default image survey (#600) 7853d7ea3f.gitignoreto be copied to container (#537) cf202bedb5NewWorkflowPlanner(#648) fbdf6e6952super-linter+ fix lint issues (#650) 69b692b962envs.txt/event.jsonto fixed location (#667) dd198c2dd3gopasslib withgolang.org/x/term(#674) e937e114a5gotest.tools(#688) e784133c16arm64/armand capture all snapshots (#699) 343f172304interface{}instead ofmap[string]...(#700) 3ecbd94d96needsjob output (#629) 5ed5bc15b3ImageOSformat (#761) b2d6b07d90* Fix format function {{, }} are escapes Added some tests for some corner cases * Update format function added 2 error checksembedwithout "unused" import (#830) df05a7364eshas default shell for containers (#853) f09a90bf80FixIfStatement()(#990) 9150617decGITHUB_REF_NAME&GITHUB_REF_TYPE(#1142) 68f49c6c6c/(#1226) 5a18d6c28fThis change stops act from rejecting valid entries such as ``` timeout-minutes: ${{ matrix.runtime == 'v8' && 30 || 15 }} ``` at the job level. This change complements the fix that was already in place for the Step struct, done in #1217. See:e35ab25fedCo-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>-j&-l(#1326) 8fb0252e00workflow_dispatchinputs into the Expressioninputscontext (#1363) 9abdd7f050LANG=C.UTF-8to environment (#1476) 4444ced98a--container-options(#1462) 5b3714bfa0GITHUB_env variables (#1582) e8f2d13c43Examples: ```yaml jobs: my_first_job: steps: - name: My first step uses: https://gitea.com/actions/heroku@main - name: My second step uses: http://example.com/actions/[email protected] ``` Reviewed-on: https://gitea.com/gitea/act/pulls/14 Reviewed-by: Lunny Xiao <[email protected]> Co-authored-by: Jason Song <[email protected]> Co-committed-by: Jason Song <[email protected]>strings.ReplaceAlltosafeFilename(#17) 1cd3b6d763strings.ReplaceAlltosafeFilename(#18) 28bc9e893cActionRunsUsingGo(#20) 95e700e85dAnd we will be able to use context like `${{ gitea.repository }}` in workflows yaml files, it's same as `${{ github.repository }}` Reviewed-on: https://gitea.com/gitea/act/pulls/27 Reviewed-by: Zettat123 <[email protected]>ParseRawOn(#28) e00cb13decWithfield tojobparser.Job(#37) ab8000b05elog.Fatalinpkg/*(#39) 73d7678465server_urlattribute to github context (#1727) 8b25ad4dbelog.Fatalinpkg/*(#1705) 8d2c320f7aconfiguration variables(#43) bc78c7964adocker_network.go(#44) 8c57d16e48envofservices(#47) 42f2894accStep(#48) f1c4dec079```yml jobs: job1: steps: - run: echo HelloWorld - # empty step ``` If a job contains an empty step, `Job.Steps` will have a nil element and will cause panic when calling `Step.String()`. See [the code of gitea](948a9ee5e8/models/actions/task.go (L300-L301)) Reviewed-on: https://gitea.com/gitea/act/pulls/48 Co-authored-by: Zettat123 <[email protected]> Co-committed-by: Zettat123 <[email protected]>Job(#49) 4bbdd71062services(#50) ba7ef95f06onwhen parsing workflow (#46) 74f175fe7fcredentials(#51) 96b56f20a7-self-hostedmode as container image (#1783) fc2883b754host(#55) f684988ae2privilegedto false when runner's config is false (#57) 4effa85acboptionsissue. (#59) f78a6206d3variables(#66) c0aa38abeaact_runner exec(#63) 3ad0efb610wei/curl@v1(#1864) 67717d9a14archives.replacementsingoreleaser.yaml(#1895) a2b862a830ValidVolumesfor docker steps (#74) a3c7e09958useskey is provided (#1804) 0c1dc1e2f6uses(#75) 40abc4a106--deviceoption (#1957) e94231487cubuntu-latest(#1959) da3d315438<job>.container.options(#1958) 3b61c0cd55extractFromImageEnv' (#81) from wolfogre/act:bugfix/panic_extractFromImageEnv into main 0c98833f8druns-onerror logging (#2102) 182e1be469restore-keysin creation reverse order (#2153) a25c37e83cparseEnvs(#2162) df3d88caa1workflow_dispatch.inputs5304d71a96workflow_dispatch.inputs' (#45) from viceice/fix-inputs into main 5e7adf690c.githuband.giteaec38ef216e.githuband.gitea' (#50) from chore/drop-github-and-gitea into main 81c1530fceIt is useful to set an alternative hostname when running a service such as: ```yaml services: minio: image: data.forgejo.org/oci/bitnami/minio:2024.8.17 options: >- --hostname alternate.minio ``` Reviewed-on: forgejo/act#95 Reviewed-by: Kwonunn <[email protected]> Co-authored-by: Earl Warren <[email protected]> Co-committed-by: Earl Warren <[email protected]>workflow_call.inputsandworkflow_call.outputs(#70) 54fead51c6distribution/referenceimport 5e76fb3468distribution/referenceimport' (#133) from fix/docker-reference into main d58552be82dryrunparameter (#2311) (#158) af531f2894if: false(#172) 7eb547faa5It is a breaking change because it changes how the shell is determined. Before, if `jobs.<job_id>.container.image` is set and the shell is not specified, it defaults to `sh` instead of `bash`. After, regardless of `jobs.<job_id>.container.image`, if the shell is not specified, it defaults to `bash` if available, otherwise it defaults to `sh`. Rework the shell integration tests: - Remove container specific tests because the special behavior related to shell being set differently when a container image is present is removed - Modify the defaults test case to verify the fallback logic - Use container images from code.forgejo.org to escape rate limiting in the CI - Add the missing node test - Use container: image: code.forgejo.org/oci/node:22-bookworm instead of container: code.forgejo.org/oci/node:22-bookworm because it silently failed to run (with no exit code) - Prefer `-z "${BASH}"` because `-z ${BASH+x}` reads obscure Closes forgejo/runner#150- rc.getToolCache(ctx) is used to figure out RUNNER_TOOL_CACHE and returns RUNNER_TOOL_CACHE if it is found in the runner config, e.g. ```yaml container: env: RUNNER_TOOL_CACHE: /srv/toolcache ``` - store the value in the new `toolCache` data member for containers, in the same way it is done for host - GetRunnerContext for containers return `toolCache` instead of a hard coded string - add integration test Closes forgejo/runner#184 Reviewed-on: forgejo/act#178 Reviewed-by: Michael Kriese <[email protected]> Co-authored-by: Earl Warren <[email protected]> Co-committed-by: Earl Warren <[email protected]>In the current implementation, the network will only be created and be scheduled to be deleted when there is a service: ```go func (rc *RunContext) networkName() (string, bool) { if len(rc.Run.Job().Services) > 0 || rc.Config.ContainerNetworkMode == "" { return fmt.Sprintf("%s-%s-network", rc.jobContainerName(), rc.Run.JobID), true } return string(rc.Config.ContainerNetworkMode), false } ``` Therefore it does not currently make a difference. However, in case the network creation logic changes and a network is created even if a service is not present, it would be incorrect not to delete it. Reviewed-on: forgejo/act#189 Reviewed-by: Michael Kriese <[email protected]> Co-authored-by: Earl Warren <[email protected]> Co-committed-by: Earl Warren <[email protected]>An invalid workflow_{dispatch,call} key with a type that is not a map may attempt to use a nil map. It happens randomly as the order of the key maps is not guaranteed. Without this fix, the tests will fail 100% of the time with: `go test -count=500 -run=TestParseRawOn/on:___workflow_ -v ./pkg/jobparser/` Regression from forgejo/act#45 Reviewed-on: forgejo/act#193 Reviewed-by: Michael Kriese <[email protected]> Co-authored-by: Earl Warren <[email protected]> Co-committed-by: Earl Warren <[email protected]>If not the schema validation will fail because it will be try to validate as if not calling a reusable workflow. ``` === RUN TestWorkflowCallRunsOn schema_test.go:119: Error Trace: /home/earl-warren/software/act/pkg/schema/schema_test.go:119 Error: Received unexpected error: Line: 10 Column 5: Failed to match job-factory: Line: 12 Column 5: Unknown Property uses Line: 13 Column 5: Unknown Property with Line: 15 Column 5: Unknown Property secrets Line: 10 Column 5: Failed to match workflow-job: Line: 11 Column 5: Unknown Property runs-on Test: TestWorkflowCallRunsOn ``` Reviewed-on: forgejo/act#194 Reviewed-by: Michael Kriese <[email protected]> Co-authored-by: Earl Warren <[email protected]> Co-committed-by: Earl Warren <[email protected]>Only changes test files. --- - remove tests specific to running on a host with no container they are the same as with the containers (TestRunEventHostEnvironment) - prefix the name of the tests with a distinctive name to more easily run them together - use code.forgejo.org/oci images whereever possible - remove some tests that are either - difficult to understand (ancient bugs) - not yet well understood (related to reusable workflows) - depend on github (generation of workflows to be run on the fly e.g. updateTestIfWorkflow) - fix the TestSanitizeNetworkAlias tests that were not run and make them easier to debug - disable tests of options that are forbidden in Forgejo Actions (testdata/container-hostname/push.yml) Reviewed-on: forgejo/act#202 Reviewed-by: Michael Kriese <[email protected]> Co-authored-by: Earl Warren <[email protected]> Co-committed-by: Earl Warren <[email protected]>cascading-pr updated at actions/setup-forgejo#533
f9f49d107a1de9938fd4cascading-pr updated at actions/setup-forgejo#533
feat: merge forgejo/act/pkg in the act directoryto feat: merge forgejo/act/pkg in the act directory [skip cascade]feat: merge forgejo/act/pkg in the act directory [skip cascade]to feat: merge forgejo/act/pkg in the act directorye6d4e18a9f78dfe797f0cascading-pr updated at actions/setup-forgejo#533
LGTM, authorship is retained in the commits.