Commit Graph

48 Commits

Author SHA1 Message Date
Zettat123 8f81f40d62 Fix failed to create container if the runner works in root dir (#67)
Fix #56

This PR uses the `preset.Repository` as a part of the workdir and use `filepath.FromSlash` to convert the slash characters.

Co-authored-by: Jason Song <i@wolfogre.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/67
Reviewed-by: Jason Song <i@wolfogre.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
Co-committed-by: Zettat123 <zettat123@gmail.com>
2023-03-23 09:41:22 +08:00
Jason Song 4d868b7f3c Update act to v0.243 (#54)
- Update act to v0.243.1
- Disable artifacts server when run daemon.
- Adjust cmd.

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/54
Reviewed-by: Zettat123 <zettat123@noreply.gitea.io>
2023-03-17 09:45:46 +08:00
sillyguodong 370989b2d0 Print the kind of event that trigger the actions (#48)
![image](/attachments/28a866c6-3134-477d-a8c8-d624fa90db0b)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/48
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.io>
Co-authored-by: sillyguodong <gedong_1994@163.com>
Co-committed-by: sillyguodong <gedong_1994@163.com>
2023-03-15 09:44:13 +08:00
sillyguodong 0d71463662 Inject version when building and report version to Gitea via log and header (#43)
close #42
1. Inject runner version when `make build`
After building, executing command line: `./act_runner -v` or `./act_runner --version`, the version of runner is printed.
![image](/attachments/e25efbd3-79b3-49a5-b93f-42646d42c707)

2. In `Actions` UI:
![image](/attachments/36c57470-2a1d-4796-9eb0-de3988ab88e1)

3. Set request header in http client interceptor.

Co-authored-by: sillyguodong <gedong_1994@163.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/43
Reviewed-by: delvh <dev.lh@web.de>
Reviewed-by: Jason Song <i@wolfogre.com>
Co-authored-by: sillyguodong <sillyguodong@noreply.gitea.io>
Co-committed-by: sillyguodong <sillyguodong@noreply.gitea.io>
2023-03-13 18:57:35 +08:00
HesterG ebcf341de7 Fix wrong last step duration when job failed (#41)
This PR is to fix the wrong last step duration when job failed like shown in the screenshot.
The reason is because when job failed, `Fire` function did not pass in Time, and `r.state.StoppedAt` is by default set to `0001-01-01 08:05:43 +0805 LMT`, which is later on reported to gitea by `UpdateTask`, which calls `UpdateTaskByState` to update the `task.Stopped`, and `task.Stopped` is used in `FullSteps`, resulting in wrong calcaulation of last step duration.

Co-authored-by: nickname <test@123.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/41
Reviewed-by: Jason Song <i@wolfogre.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: HesterG <hesterg@noreply.gitea.io>
Co-committed-by: HesterG <hesterg@noreply.gitea.io>
2023-03-08 21:32:54 +08:00
Zettat123 f24e0721dc Add runner name to log (#37)
User can get the name of the runner that executed the specified job.
![image](/attachments/61328f68-7223-4345-85c7-ac08781e81db)

Co-authored-by: Zettat123 <zettat123@gmail.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/37
Reviewed-by: Jason Song <i@wolfogre.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Zettat123 <zettat123@noreply.gitea.io>
Co-committed-by: Zettat123 <zettat123@noreply.gitea.io>
2023-03-06 18:42:07 +08:00
ChristopherHX e36300ce28 fix docker executor on windows and local actions (#34)
If the Workdir field doesn't ends with the filepath seperator,
bad things happen

Fixes #33

Sample for host mode on windows, needs be adjusted for linux e.g. replace pwsh with bash
Also fixes
```yaml
on: push
jobs:
  _:
    runs-on: self-hosted
    steps:
    - uses: actions/checkout@v3
      with:
        path: subdir/action
    - uses: ./subdir/action
```

with an action.yml in the same repo
```yaml
runs:
  using: composite
  steps:
    - run: |
        echo "Hello World"
      shell: pwsh
```

Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/34
Reviewed-by: Jason Song <i@wolfogre.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: ChristopherHX <christopherhx@noreply.gitea.io>
Co-committed-by: ChristopherHX <christopherhx@noreply.gitea.io>
2023-03-06 13:24:32 +08:00
Jason Song 436b441cad Support cache (#25)
See [Caching dependencies to speed up workflows](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows).

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/25
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: Zettat123 <zettat123@noreply.gitea.io>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-committed-by: Jason Song <i@wolfogre.com>
2023-02-28 23:39:30 +08:00
sillyguodong 552dbcdda9 Add copyright header and gitea-vet (#29)
Add copyright header

Co-authored-by: sillyguodong <gedong_1994@163.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/29
Reviewed-by: Jason Song <i@wolfogre.com>
Reviewed-by: Zettat123 <zettat123@noreply.gitea.io>
Co-authored-by: sillyguodong <sillyguodong@noreply.gitea.io>
Co-committed-by: sillyguodong <sillyguodong@noreply.gitea.io>
2023-02-28 18:44:46 +08:00
ChristopherHX 990cf93c71 feat: don't require docker (#16)
The only reason docker is really required by now, is that act_runner ping docker.
This change only pings docker if a label with `docker://` is added to the runner.

Plain labels without `:` like `self-hosted` are run directly on the system. Previously the pseudo non docker label `-self-hosted` have been required like this `self-hosted:docker://-self-hosted`, but due to docker ping this still required a dockerd to be pingable.

Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/16
Reviewed-by: Jason Song <i@wolfogre.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: ChristopherHX <christopherhx@noreply.gitea.io>
Co-committed-by: ChristopherHX <christopherhx@noreply.gitea.io>
2023-01-27 20:42:02 +08:00
ChristopherHX f7a52789d9 fix: report job failure on error return (#14)
act_runner only returns the error to the runner, but doesn't update the job result to failure.

Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/14
Reviewed-by: Jason Song <i@wolfogre.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: ChristopherHX <christopherhx@noreply.gitea.io>
Co-committed-by: ChristopherHX <christopherhx@noreply.gitea.io>
2023-01-27 20:18:12 +08:00
Jason Song 6d2200b3d6 Rename to actions (#7)
Co-authored-by: Jason Song <i@wolfogre.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/7
2022-12-06 16:37:38 +08:00
Jason Song 0cbdbd36b6 Trim newline in log message (#6)
Co-authored-by: Jason Song <i@wolfogre.com>
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/6
2022-12-02 16:07:23 +08:00
Jason Song b3e7d6a62d fix: update container config 2022-11-24 15:38:22 +08:00
Jason Song 2354f5bb18 feat: use specified labels 2022-11-24 15:38:21 +08:00
Jason Song 64c9856ba7 fix: set more image 2022-11-24 15:38:17 +08:00
Jason Song 44988db9f8 chore: replace with code.gitea.io/bots-proto-go 2022-11-24 15:38:15 +08:00
Jason Song 8f950ccec0 feat: auto remove containers 2022-11-24 15:38:11 +08:00
Jason Song ab4e06f977 feat: support post step log 2022-11-24 15:38:09 +08:00
Lunny Xiao 5fc35faf17 Support bot site 2022-11-24 15:38:06 +08:00
Lunny Xiao 8cffac65d9 Use normal images which includes git command 2022-11-24 15:38:00 +08:00
Jason Song 2e1326b725 fix: set NoSkipCheckout 2022-11-24 15:37:58 +08:00
Bo-Yi Wu abdb547b1b chore(poller): add metric to track the worker number
Add metric to track multiple task.
2022-11-24 15:37:53 +08:00
Jason Song cbd21b8ec5 feat: avoid reuse of containers 2022-11-24 15:37:51 +08:00
Jason Song d650bae0b6 feat: replace ciphertext in log 2022-11-24 15:37:50 +08:00
Lunny Xiao 222b5100b6 add new envs 2022-11-24 15:37:48 +08:00
Jason Song 93e42d1465 fix: call RunDaemon 2022-11-24 15:37:47 +08:00
Lunny Xiao 93c8de3ec4 get token 2022-11-24 15:37:46 +08:00
Bo-Yi.Wu 2442cdd8ad fix(runner): check task state field exist.
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:45 +08:00
Bo-Yi.Wu 08c94bb564 chore(runner): cancel task if get the cancel from server
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:44 +08:00
Jason Song 2f879c41c4 chore: remove tracing codes 2022-11-24 15:37:42 +08:00
Jason Song 41b5fa6b55 fix: update step result 2022-11-24 15:37:41 +08:00
Lunny Xiao 378966e45f add forgeinstance 2022-11-24 15:37:40 +08:00
Bo-Yi Wu 7bebd2bbad chore(runner): update runner status when start job 2022-11-24 15:37:34 +08:00
Bo-Yi.Wu 7486d2ab91 chore(runner): update fetch job request
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:22 +08:00
Bo-Yi.Wu 82431d8e11 chore(runner): support update log and task
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:21 +08:00
Bo-Yi.Wu 20c3d85ba9 refactor(task): execute single task with gRPC data 2022-11-24 15:37:19 +08:00
Bo-Yi.Wu 5051e4aebd chore(runtime): check error message
data lock by another runner.

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:18 +08:00
Bo-Yi.Wu d3d56ed0ef chore(runtime): fetch build data
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:17 +08:00
fuxiaohei 6030610c04 feat: task can report step and final result 2022-11-24 15:37:14 +08:00
Bo-Yi.Wu f2fb8798fa chore(gRPC): add request interface client
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:11 +08:00
Bo-Yi.Wu 449388f3ab chore(gRPC): register new runner
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:10 +08:00
Bo-Yi.Wu a3e9bbed25 chore: Add makefile
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:09 +08:00
Gitea 3281c6637d feat: fill default task runner 2022-11-24 15:37:08 +08:00
Gitea c5edbbd004 feat: move main task logic to runtime package 2022-11-24 15:37:06 +08:00
GiteaBot aa765ea4d0 chore(go): rename module name
Signed-off-by: GiteaBot <teabot@gitea.io>
2022-11-24 15:37:03 +08:00
GiteaBot 307c2c63de chore(proto): replace import path.
Signed-off-by: GiteaBot <teabot@gitea.io>
2022-11-24 15:37:02 +08:00
Bo-Yi Wu 7d55fd57c9 chore(piepline): add runtime package.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2022-11-24 15:37:01 +08:00