mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
feat(run): show runs like gh, watch them live, and download artifacts
run list prints a table with a status icon, the workflow name, title, branch, event, elapsed time and age, and the total from the server; runs carry workflow, workflow_path and run_number in JSON. run view shows the run's state and trigger, its jobs with their steps and durations, the next steps and the run's URL; --json includes the jobs, --log prints their logs and --web opens the run. Run commands accept #N and run URLs, and ask for a recent run in a terminal when the argument is left out. run watch redraws the run on the alternate screen, then prints it with a summary; an expired --timeout names the run and suspects a missing runner when no job started. run cancel no longer asks for confirmation, rerun refuses unfinished runs up front, reruns a single job with --job and reports the new attempt, and delete names the run in its prompt. run logs follows several jobs with --follow, prefixing lines with the job's name, selects jobs by name or with --failed, and downloads the archive with --output or --dir. run download extracts the artifacts of a run by name, and artifact list shows sizes and expiry. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
19 files changed
+2636
-646
No files matched your search
@@ -25,16 +25,16 @@ func TestArtifactListingProjectsMetadataAndEmptyArrays(t *testing.T) {
|
||||
_, _ = w.Write([]byte(`{"artifacts":[{"id":9,"name":"build","size_in_bytes":128,"url":"https://example.test/artifact","expired":false,"expires_at":null,"workflow_run":{"head_sha":"excluded"},"archive_download_url":"excluded"}]}`))
|
||||
}))
|
||||
service := Actions{Client: client, Repository: "owner/repo"}
|
||||
items, err := service.Artifacts(context.Background(), 7, 20, 1)
|
||||
page, err := service.Artifacts(context.Background(), 7, 20, 1)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, items, 1)
|
||||
data, err := json.Marshal(items)
|
||||
require.Len(t, page.Items, 1)
|
||||
data, err := json.Marshal(page.Items)
|
||||
require.NoError(t, err)
|
||||
require.JSONEq(t, `[{"id":9,"name":"build","size_in_bytes":128,"url":"https://example.test/artifact","expired":false,"created_at":"","updated_at":"","expires_at":null}]`, string(data))
|
||||
items, err = service.Artifacts(context.Background(), 7, 20, 2)
|
||||
page, err = service.Artifacts(context.Background(), 7, 20, 2)
|
||||
require.NoError(t, err)
|
||||
require.Empty(t, items)
|
||||
require.NotNil(t, items)
|
||||
require.Empty(t, page.Items)
|
||||
require.NotNil(t, page.Items)
|
||||
}
|
||||
|
||||
func TestArtifactFromMapsServerFields(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user