]> source.dussan.org Git - gitea.git/commit
Implement actions artifacts (#22738)
authorFuXiaoHei <fuxiaohei@vip.qq.com>
Fri, 19 May 2023 13:37:57 +0000 (21:37 +0800)
committerGitHub <noreply@github.com>
Fri, 19 May 2023 13:37:57 +0000 (21:37 +0800)
commitc757765a9e5c2d4f73b1a7c3debe3548c735bd54
treeffed7692321760ea4f9c72670ed31437b52ff0e0
parent7985cde84df5ee93bfb37b20681d69e67d3f32fc
Implement actions artifacts (#22738)

Implement action artifacts server api.

This change is used for supporting
https://github.com/actions/upload-artifact and
https://github.com/actions/download-artifact in gitea actions. It can
run sample workflow from doc
https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts.
The api design is inspired by
https://github.com/nektos/act/blob/master/pkg/artifacts/server.go and
includes some changes from gitea internal structs and methods.

Actions artifacts contains two parts:

- Gitea server api and storage (this pr implement basic design without
some complex cases supports)
- Runner communicate with gitea server api (in comming)

Old pr https://github.com/go-gitea/gitea/pull/22345 is outdated after
actions merged. I create new pr from main branch.

![897f7694-3e0f-4f7c-bb4b-9936624ead45](https://user-images.githubusercontent.com/2142787/219382371-eb3cf810-e4e0-456b-a8ff-aecc2b1a1032.jpeg)

Add artifacts list in actions workflow page.
24 files changed:
models/actions/artifact.go [new file with mode: 0644]
models/fixtures/access_token.yml
models/fixtures/action_run.yml [new file with mode: 0644]
models/fixtures/action_run_job.yml [new file with mode: 0644]
models/fixtures/action_task.yml [new file with mode: 0644]
models/migrations/migrations.go
models/migrations/v1_20/v257.go [new file with mode: 0644]
models/repo.go
models/unittest/testdb.go
modules/setting/actions.go
modules/storage/storage.go
options/locale/locale_en-US.ini
routers/api/actions/artifacts.go [new file with mode: 0644]
routers/init.go
routers/web/repo/actions/view.go
routers/web/web.go
templates/repo/actions/view.tmpl
tests/integration/api_actions_artifact_test.go [new file with mode: 0644]
tests/mssql.ini.tmpl
tests/mysql.ini.tmpl
tests/mysql8.ini.tmpl
tests/pgsql.ini.tmpl
tests/sqlite.ini.tmpl
web_src/js/components/RepoActionView.vue