Skip to content

v3.0.0 results in dotnet builds 2x slower than v2 #410

@dylan-smith

Description

@dylan-smith

Description:
We just recently upgraded to v3 of this action and it resulted in significantly slower dotnet builds. NOTE: It's not the setup-dotnet action that is slow, but the subsequent build step.

Task version:
v2 is fast, v3.0.0 is slow

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
I created a small workflow that demonstrates the problem: https://github.com/dylan-smith/setup-dotnet-repro/blob/main/.github/workflows/blank.yml

It has a build-v2 job and a build-v3 job, the only difference is the version of the setup-dotnet task in them. All they do is checkout a dotnet repo, setup-dotnet, then run a dotnet publish command. The dotnet publish command is significantly slower when setup-dotnet@v3 is used.

steps:
- uses: actions/checkout@v3
  with:
    repository: github/gh-gei

- name: Setup .NET
  uses: actions/setup-dotnet@v2
  with:
    dotnet-version: 6.0.x

- name: Build
  run: dotnet publish src/ado2gh/ado2gh.csproj -c Release -o dist/win-x64/ -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true /p:DebugType=None /p:IncludeNativeLibrariesForSelfExtract=true

Windows/Ubuntu runners are more than 2x as slow when using setup-dotnet@v3. Mac runners don't seem to be affected.

Ubuntu: 47s -> 97s
Windows: 96s -> 256s
Mac: 135s -> 139s

The workflow run/logs can be seen here: https://github.com/dylan-smith/setup-dotnet-repro/actions/runs/4609178383

image

Expected behavior:
I wouldn't expect the version of setup-dotnet to affect dotnet build times, or if it did I would expect newer versions to improve build perf not decrease it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions