A GitHub Actions workflow can appear healthy while wasting a significant amount of CI time. Every job completes successfully, pull requests are validated, and deployments work as expected. However, developers may still wait several minutes for feedback, and the organization may consume far more runner minutes than necessary.

The problem is often hidden inside individual jobs.

A workflow might contain a build job that restores the same dependencies repeatedly, a test job that spends more time initializing its environment than executing tests, or a deployment job that waits for another job to finish before performing a simple operation.

Looking only at the total workflow duration does not reveal these problems.

GitHub Actions provides several ways to investigate workflow execution, including job execution times, step logs, visualization graphs, usage metrics, and performance metrics. By combining these tools, teams can identify which jobs consume the most time, understand why they are slow, and prioritize improvements.

Why Some GitHub Actions Jobs Waste Time

A GitHub Actions workflow is made up of jobs, and each job contains one or more steps.

For example, a .NET application might use this workflow:

SQL
CI Workflow
    |
    +---- Build
    |       |
    |       +---- Checkout
    |       +---- Setup .NET
    |       +---- Restore Packages
    |       +---- Compile
    |
    +---- Unit Tests
    |       |
    |       +---- Checkout
    |       +---- Setup .NET
    |       +---- Restore Packages
    |       +---- Execute Tests
    |
    +---- Integration Tests
    |       |
    |       +---- Checkout
    |       +---- Setup .NET
    |       +---- Restore Packages
    |       +---- Start Dependencies
    |       +---- Execute Tests
    |
    +---- Publish
            |
            +---- Checkout
            +---- Build Artifacts
            +---- Upload

Every job has its own execution environment when using GitHub-hosted runners.

This means setup operations can be repeated across jobs. Package restoration, SDK installation, tool initialization, and environment preparation can add considerable time.

Other common sources of wasted time include:

  • Jobs that execute sequentially even though they are independent.
  • Test jobs that run more slowly because of resource contention.
  • Repeated compilation of unchanged projects.
  • Dependency caches that are missing or incorrectly configured.
  • Jobs that wait in a runner queue.
  • Workflows that execute unnecessarily for documentation-only changes.
  • Deployment jobs that run even when the relevant application component has not changed.

The important point is that a slow workflow does not necessarily have a slow build command. The delay may come from job setup, queue time, dependency management, or workflow design.

Start With GitHub Actions Performance Metrics

GitHub Actions provides performance metrics that help identify inefficient workflows and jobs.

These metrics are available at both repository and organization levels.

They include information such as:

  • Average workflow execution time.
  • Average job execution time.
  • Average queue time.
  • Job failure rates.
  • Workflow failure rates.
  • Performance differences across runner types and operating systems.

For an organization, the metrics can help platform teams identify repositories that consistently consume excessive time.

For an individual repository, they help developers understand which workflows and jobs need attention.

To access repository-level metrics:

  • Open the repository on GitHub.
  • Select the Insights tab.
  • Open the Actions Usage Metrics or Actions Performance Metrics section.
  • Select the period you want to investigate.
  • Review the available workflow, job, repository, and runner information.
  • Apply filters to narrow the results.

Organization owners and users with the required organization metrics permission can also view organization-wide information through the organization's Insights section.

The distinction between usage metrics and performance metrics is important.

Usage metrics show how many Actions minutes workflows and jobs consume. Performance metrics focus on execution efficiency, queue times, and failures.

A job that consumes many minutes is not necessarily inefficient. It may perform valuable work, such as running a comprehensive integration test suite. Performance data helps determine whether the time is justified.

Identify the Difference Between Queue Time and Execution Time

One of the most common mistakes when investigating slow CI pipelines is treating queue time and execution time as the same problem.

They are different.

Queue time is the period a job waits before a runner starts executing it.

Execution time is the time spent running the job after it starts.

Consider the following example:

Job

Queue time

Execution time

Build

20 seconds

4 minutes

Unit Tests

3 minutes

2 minutes

Integration Tests

1 minute

8 minutes

Publish

10 seconds

3 minutes

The unit test job has a relatively short execution time but spends three minutes waiting for a runner.

The integration test job starts quickly but takes eight minutes to complete.

These jobs need different improvements.

For the unit test job, investigate runner availability, concurrency, and queue capacity.

For the integration test job, investigate test execution, database initialization, external dependencies, and resource consumption.

Increasing the runner size will not necessarily fix a job that spends most of its time waiting in a queue. Similarly, adding more runners will not fix inefficient test logic.

Always identify which part of the job lifecycle is responsible for the delay.

Use the Workflow Visualization Graph to Find Bottlenecks

Every GitHub Actions workflow run generates a visualization graph.

The graph displays the jobs in the workflow and the dependencies between them.

To inspect it:

  • Open the repository.
  • Select Actions.
  • Choose the workflow you want to investigate.
  • Open a specific workflow run.
  • Review the visualization graph.
  • Select individual jobs to inspect their execution details.

The graph helps identify jobs that run in parallel and jobs that wait for other jobs to complete.

Consider this workflow:

Code
             Build
               |
       +-------+-------+
       |               |
   Unit Tests     Integration Tests
       |               |
       +-------+-------+
               |
            Package
               |
            Deploy

The unit tests and integration tests can execute concurrently after the build completes.

However, if the workflow defines unnecessary dependencies, jobs may execute sequentially.

For example:

YAML
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Building application"

  unit-tests:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - run: echo "Running unit tests"

  integration-tests:
    needs: unit-tests
    runs-on: ubuntu-latest
    steps:
      - run: echo "Running integration tests"

In this example, integration tests cannot start until unit tests finish.

If both test jobs only require the completed build and do not depend on each other, the dependency is unnecessary.

A better structure is:

YAML
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Building application"

  unit-tests:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - run: echo "Running unit tests"

  integration-tests:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - run: echo "Running integration tests"

Now both test jobs can start after the build job completes.

In a real workflow, remember that each GitHub-hosted job runs in a separate environment. If test jobs require compiled output from the build job, upload the build output as an artifact and download it in the dependent jobs.

The visualization graph helps identify dependency problems, but the workflow YAML determines how those dependencies should be corrected.

Inspect Step-Level Execution Times

After identifying a slow job, the next step is to find the expensive operation inside it.

GitHub Actions logs contain execution information for individual steps.

Open a workflow run, select the relevant job, and inspect its steps.

GitHub records the time taken by each step, making it possible to distinguish between expensive operations.

For example:

Step

Execution time

Checkout source

5 seconds

Setup .NET

12 seconds

Restore NuGet packages

95 seconds

Build solution

45 seconds

Run tests

30 seconds

Upload results

8 seconds

In this example, package restoration consumes more time than the actual test execution.

Optimizing the test code would have little impact on the overall job duration.

A dependency cache would be a more appropriate improvement.

GitHub also adds setup and completion steps to each job. The Set up job step provides information about the runner environment, while Complete job records job completion activity.

These steps are worth inspecting when runner initialization or environment preparation appears to contribute to the delay.

For more detailed investigation, GitHub allows developers to search workflow logs and download log archives.

This is useful when a job contains many steps or when the same problem occurs across multiple workflow runs.

Find Jobs That Consume the Most Actions Minutes

Execution time is only one part of CI optimization.

Organizations also need to understand which jobs consume the most GitHub Actions minutes.

Suppose a repository has three workflows:

Workflow

Average duration

Runs per day

Pull Request Validation

8 minutes

40

Nightly Integration Tests

25 minutes

1

Documentation Validation

3 minutes

30

The nightly integration workflow is the longest individual workflow.

However, pull request validation executes much more frequently and may consume more total runner time.

A useful way to estimate the impact is:

Code
Daily Runner Minutes =
Average Job Duration × Daily Job Runs

For example:

Code
Pull Request Validation:
8 × 40 = 320 minutes

Nightly Integration Tests:
25 × 1 = 25 minutes

Documentation Validation:
3 × 30 = 90 minutes

The pull request workflow is the largest consumer in this simplified example.

This does not mean it should be removed or reduced indiscriminately. It means that even a small improvement to a frequently executed job can produce a meaningful reduction in overall CI consumption.

GitHub Actions usage metrics provide workflow and job usage information to help investigate these patterns.

When reviewing billable minutes, remember that billing rules depend on the runner type and repository visibility. For example, GitHub-hosted jobs in private repositories accrue billable minutes, while public repository jobs and self-hosted runner jobs do not accrue GitHub-hosted runner minutes in the same way.

Runner usage and infrastructure costs still matter for self-hosted environments, even when GitHub does not charge hosted-runner minutes.

Detect Repeated Dependency Downloads

Dependency restoration is a common source of unnecessary execution time.

GitHub-hosted runners start with clean environments, so dependencies may need to be downloaded again during every workflow run.

Consider a .NET workflow:

YAML
steps:
  - uses: actions/checkout@v6

  - uses: actions/setup-dotnet@v5
    with:
      dotnet-version: '10.0.x'

  - name: Restore dependencies
    run: dotnet restore MyApplication.sln

  - name: Build application
    run: dotnet build MyApplication.sln --no-restore

If restoration takes 90 seconds on every run, the workflow repeatedly spends time downloading packages that may not have changed.

The setup-dotnet action supports NuGet caching.

YAML
steps:
  - uses: actions/checkout@v6

  - uses: actions/setup-dotnet@v5
    with:
      dotnet-version: '10.0.x'
      cache: true
      cache-dependency-path: '**/packages.lock.json'

  - name: Restore dependencies
    run: dotnet restore MyApplication.sln

  - name: Build application
    run: dotnet build MyApplication.sln --no-restore

The cache key is based on the dependency lock files.

When the dependencies remain unchanged, the workflow can reuse the cached packages.

When dependencies change, a new cache entry is created.

This optimization is especially useful for frequently executed workflows.

However, caching should not be treated as a guaranteed performance improvement. Cache restoration itself takes time, and very large caches can reduce the benefit.

Monitor cache usage and compare execution times before and after introducing caching.

Also, never store credentials or sensitive information in dependency caches. Treat restored cache contents as untrusted input, particularly when workflows execute code from external pull requests.

Find Jobs That Run Even When They Are Not Needed

Another source of wasted CI time is unnecessary workflow execution.

For example, a repository may contain application code, documentation, deployment scripts, and infrastructure configuration.

A documentation-only change may trigger a complete application build and integration test suite.

GitHub Actions supports path filters that allow workflows to run only when relevant files change.

YAML
name: Application CI

on:
  pull_request:
    paths:
      - 'src/**'
      - 'tests/**'
      - '*.sln'
      - '*.csproj'
      - '.github/workflows/application-ci.yml'

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

      - uses: actions/setup-dotnet@v5
        with:
          dotnet-version: '10.0.x'

      - name: Build application
        run: dotnet build MyApplication.sln --configuration Release

This workflow runs only when relevant paths change.

It can prevent application builds from running for unrelated documentation updates.

However, path filters should be designed carefully.

A shared library change may affect multiple applications even if the application-specific folder was not modified. Similarly, changes to reusable workflows or shared build configuration may require broader validation.

GitHub also documents limits on path-filter evaluation, including a limit of 3,000 files in the diff used for filtering. For large repositories, do not rely on path filtering as the only mechanism for ensuring required validation.

The goal is to avoid unnecessary work without accidentally skipping important tests.

Investigate Jobs That Repeat the Same Build

Some workflows build the same application multiple times.

For example, a pipeline may compile a solution in a build job and then compile it again independently in unit test, integration test, and packaging jobs.

This can happen because every GitHub-hosted job starts with a separate runner environment.

A better design may be to build once, upload the required output, and let downstream jobs reuse it.

For example:

YAML
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

      - uses: actions/setup-dotnet@v5
        with:
          dotnet-version: '10.0.x'

      - name: Restore
        run: dotnet restore MyApplication.sln

      - name: Build
        run: dotnet build MyApplication.sln -c Release --no-restore

      - name: Upload build output
        uses: actions/upload-artifact@v6
        with:
          name: application-build
          path: src/MyApplication/bin/Release/

  test:
    needs: build
    runs-on: ubuntu-latest

    steps:
      - uses: actions/download-artifact@v6
        with:
          name: application-build
          path: application-build

      - name: Run tests
        run: echo "Execute tests using the downloaded build output"

This is an architectural example. A production workflow must also download the source or test binaries and dependencies required by the test runner, and the build output must be compatible with the downstream job's environment.

For .NET solutions, build and test orchestration can be more complicated when projects have different target frameworks or runtime requirements.

The important principle is to avoid compiling identical outputs repeatedly when they can safely be reused.

Artifacts are appropriate for passing build outputs between jobs. Dependency caches serve a different purpose: reusing files that are expensive to regenerate across workflow runs.

Use Concurrency Controls to Avoid Obsolete Runs

Pull request workflows can create unnecessary work when developers push several commits in a short period.

For example, a developer pushes three commits within a few minutes. The first workflow starts, the second workflow starts, and the third workflow starts.

By the time the first two workflows finish, their results may no longer be relevant because newer commits have already been pushed.

GitHub Actions concurrency groups can help manage this situation.

YAML
name: CI

on:
  pull_request:

concurrency:
  group: ci-${{ github.workflow }}-${{ github.event.pull_request.number }}
  cancel-in-progress: true

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6

      - name: Build
        run: echo "Building current pull request commit"

The concurrency group identifies workflow runs associated with the same pull request and workflow.

When a newer run enters the same group, cancel-in-progress allows the older in-progress run to be canceled.

This is useful for validation workflows where only the latest commit needs a complete result.

Be careful when applying this strategy to deployment workflows or jobs that perform operations that should not be interrupted. Cancellation is not always safe, especially when a job is midway through modifying external resources.

Also, concurrency groups have specific queuing behavior. They should be designed around the workflow's purpose rather than applied globally without considering release requirements.

Build a Simple CI Performance Baseline

Optimizations are easier to evaluate when the team has a baseline.

Before changing the workflow, record a few measurements over a representative period.

Metric

What it tells you

Average workflow duration

Overall feedback time

Average job duration

Which jobs take the longest

Average queue time

Whether runner availability is a problem

Actions minutes consumed

Which workflows use the most capacity

Failure rate

Whether reliability is affecting productivity

Cache effectiveness

Whether repeated downloads are being reduced

Avoid making decisions based on a single workflow run.

Runner availability, network conditions, dependency changes, and test data can make individual runs unusually fast or slow.

Compare averages over a suitable period and investigate repeated patterns.

After making an optimization, measure the same metrics again.

For example, if dependency caching reduces package restoration from 90 seconds to 15 seconds, the improvement should be visible across repeated workflow runs.

Similarly, if parallelizing independent jobs reduces total pull request feedback time, verify that the gain is not offset by increased runner usage or resource contention.

A Practical Approach to Reducing CI Waste

A good optimization process should prioritize changes that improve feedback time without weakening validation.

Start with the jobs that consume the most total Actions minutes or consistently delay pull request completion.

Inspect their queue times and execution times separately.

Then investigate the individual steps inside those jobs.

If package restoration is slow, introduce caching. If jobs are waiting unnecessarily, review dependencies and concurrency. If a workflow repeatedly builds identical outputs, consider sharing build artifacts. If unrelated changes trigger expensive workflows, improve path filters carefully.

Finally, review the impact after each change.

Avoid changing several unrelated parts of the workflow simultaneously. Making one meaningful change at a time makes it easier to understand whether the optimization actually helped.

Summary

GitHub Actions jobs can quietly waste build time through repeated dependency downloads, unnecessary compilation, excessive job dependencies, avoidable workflow triggers, and inefficient runner usage.

GitHub Actions performance metrics help identify slow workflows, queue delays, and frequently failing jobs. Usage metrics reveal which workflows and jobs consume the most Actions minutes. The visualization graph and execution logs provide additional detail about job dependencies and individual step durations.

The most effective optimization is not always adding more runners or increasing parallelism. Sometimes removing an unnecessary dependency, reusing a build artifact, or avoiding an irrelevant workflow run provides a greater improvement.

By measuring workflow performance regularly and addressing the largest sources of wasted work, teams can make CI pipelines faster, more predictable, and less expensive to operate.