Skip to content

Add a Caller Hook That Runs Before the .NET Unit Tests in validate-task #4265

Closed

Description

@ptr727

Problem

A .NET caller of validate-task.yml has no supported way to install system tools on the unit-test runner before its .NET tests run. Tests that shell out to a system tool, such as exiftool or ffmpeg, therefore skip or fail in CI.

Read at hub main (release 2.0.1492), job unit-test:

  • Run unit tests step (the .NET tests) runs right after Setup .NET SDK step and Resolve .NET workspaces step. No caller-supplied step runs before it.
  • Run caller install-test-deps hook runs after the .NET tests and the Codecov upload, and only when a Python project is present and a test-matrix leg is set. A .NET-only caller never reaches it, and when it does run it is too late for the .NET tests.
  • The .github/actions/validate hook runs in the separate validate job, on a different runner.

Downstream case

ptr727/PhotoCleaner#277: the media tests need exiftool and ffmpeg. On the CI runner they skip through a shared fixture, so a large share of the suite never runs in CI. The maintainer chose to install the tools for the existing test job rather than add a separate repo-local job.

Proposal

Add a caller pre-test hook that runs before Setup .NET SDK step whenever **/*Tests*.csproj exists, for example an optional .github/actions/install-test-deps call (or a new .github/actions/pre-test hook) gated on the file existing. That makes it opt-in, with no effect on a caller that has no such hook. The caller would then bump its pin and add the hook action.

Activity

  1. added
    enhancement
    github_actions
    on Nov 18, 2026
  2. added a commit that references this issue on Nov 18, 2026
    c0bc6d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgithub_actions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions