runner/act
Earl Warren 02a51c0a21
fix: enforce job.<job-id>.timeout-minutes (#982)
- enforce timeout-minutes timeout for jobs in a way similar  to how it is done for steps
- minimal refactor of evaluateStepTimeout evaluateTimeout so it  can be used by jobs as well, with additional debug information  and error logging if parsing fails
- add integration tests for both step and job timeout-minutes,  verifying expressions are allowed and evaluated

Resolves forgejo/runner#979

---

Manually verified to work as expected https://v13.next.forgejo.org/earl-warren/testtimeout-minutes/actions/runs/3/jobs/0/attempt/1

```yaml
on: [push]
jobs:
  test:
    runs-on: docker
    timeout-minutes: 1
    steps:
      - run: |
          set -x
          while : ; do
            sleep 30
          done
```

![image](/attachments/047ddd15-7109-4931-a6ed-43073e4d31f9)

<!--start release-notes-assistant-->
<!--URL:https://code.forgejo.org/forgejo/runner-->
- bug fixes
  - [PR](https://code.forgejo.org/forgejo/runner/pulls/982): <!--number 982 --><!--line 0 --><!--description Zml4OiBlbmZvcmNlIGpvYi48am9iLWlkPi50aW1lb3V0LW1pbnV0ZXM=-->fix: enforce job.<job-id>.timeout-minutes<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/982
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.code.forgejo.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-09-11 14:43:26 +00:00
..
artifactcache chore: cache: handler: test coverage for fatal errors 2025-09-05 17:30:08 +02:00
cacheproxy chore: bump version to v11 (#940) 2025-09-05 07:29:38 +00:00
common chore: bump version to v11 (#940) 2025-09-05 07:29:38 +00:00
container chore: bump version to v11 (#940) 2025-09-05 07:29:38 +00:00
exprparser chore: bump version to v11 (#940) 2025-09-05 07:29:38 +00:00
filecollector chore: modernize code (#857) 2025-08-15 04:54:13 +00:00
jobparser chore: bump version to v11 (#940) 2025-09-05 07:29:38 +00:00
lookpath chore: use the same .golangci.yml as the runner & gofumpt over gofmt (#206) 2025-07-28 12:26:41 +00:00
model chore: bump version to v11 (#940) 2025-09-05 07:29:38 +00:00
runner fix: enforce job.<job-id>.timeout-minutes (#982) 2025-09-11 14:43:26 +00:00
schema fix: allow inputs context in action defaults (#941) 2025-09-05 22:14:52 +00:00
workflowpattern chore: modernize code (#857) 2025-08-15 04:54:13 +00:00