Sub topic 2
Reading durations in the Actions UI
This chapter assumes you have written or edited a GitHub Actions workflow file, can read basic YAML, and know how pull requests trigger runs. You will learn to read the timings that the Actions UI already shows, so you can decide where to look before you change anything.
The three levels of timing
The Actions UI reports time at three levels. Each one answers a different question.
| Level | Where you see it | Question it answers |
|---|---|---|
| Run | The workflow run page, "Total duration" | How long did the whole workflow take from start to finish? |
| Job | The job boxes and the left sidebar | Which jobs took the longest? |
| Step | The expanded job log | Which command inside a job took the longest? |
Work from the top down. Start with the run, find the job that matters, then open that job to find the step.
Reading the run page
Open the Actions tab, choose a workflow, and click a run. The summary shows the status, the trigger, and "Total duration". Total duration is wall-clock time. It is not the sum of all job times, because jobs that run at the same time overlap.
Below the summary, the graph shows each job as a box. Arrows connect jobs linked by needs. Each box shows the job's duration once it finishes. A row of boxes with no arrows between them ran in parallel.
The left sidebar lists the same jobs. Click one to open its log.
Reading the job page
On a job page, each step is a collapsed row. The right side of each row shows how long that step took. Steps such as "Set up job" and "Post Run actions/checkout@v4" appear even though you did not write them. The runner adds them.
Use the "Usage" page to see billed minutes for a run. In the run summary, open the menu and choose Usage. Billed time rounds each job up to a whole minute, so ten 20-second jobs bill as ten minutes while taking about 20 seconds of wall-clock time.
Here is a small example workflow to read timings from:
name: ci
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm test
deploy:
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- run: echo "deploying"lint and test start together. deploy starts only after both finish.
In the chart, one day stands for one minute. Total duration is 5 minutes, not 6, because lint finished while test was still running.
A worked reading
Suppose the run page shows these job durations:
lint: 1m 10stest: 4m 05sdeploy: 0m 20s
Total duration is about 4m 25s plus any waiting. The deploy job cannot start before test ends, and test is the longest of its two dependencies. Speeding up lint by 30 seconds would not change the total at all. Only a faster test job would help.
Now open test. Say the step durations are:
| Step | Duration |
|---|---|
| Set up job | 2s |
| Run actions/checkout@v4 | 3s |
| Run npm ci | 1m 40s |
| Run npm test | 2m 15s |
| Post Run actions/checkout@v4 | 1s |
The two long steps are npm ci and npm test. That tells you what to investigate next: dependency installation and the test suite.
What the UI does not tell you
The UI has limits that matter when you draw conclusions.
- A job's duration may include waiting. The time before a job starts, while it waits for a runner, is shown separately as queued time, if at all. The next chapter covers how to tell the two apart.
- One run is one sample. Durations vary from run to run because runners and networks vary. Compare several runs before you act.
- Step times are coarse. The UI rounds to whole seconds and does not break a single
run:step into its commands. If a step runs a long script, you need your own timing output.
Exercise
A run shows build at 6m, lint at 2m, and package at 1m. package has needs: [build, lint], and build and lint have no dependencies. What is the approximate total duration, and which job should you speed up first?
Show answer
About 7 minutes: build and lint run in parallel, so the first stage lasts 6 minutes, then package adds 1 minute. Speed up build first, because it is the longest job before package. Making lint faster would not change the total.
Exercise
Why can a run's total duration be shorter than the sum of its job durations?
Show answer
Jobs without a needs relationship run at the same time, so their durations overlap. Total duration is wall-clock time from start to finish.