Setup Clang

Set up a specific version of a Clang compiler and add it to the PATH. In most workflows, this is used as an auxiliary action for the setup-cpp action.

This allows us to test a C++ library with any Clang version, and not only the versions circumstantially provided by apt-get.

This action uses a number of alternatives to find or install Clang:

  • The Clang path provided to 'path'

  • Any other version of Clang it can find in the system

  • Any other version of Clang available from APT

  • A version of Clang from our own binary releases

Input Parameters

Parameter

Description

Default

version

Version range or exact version of Clang to use, using SemVer’s version range syntax.

By default, it uses any version available in the environment. .

*

path

The clang or clang++ executable. We attempt to find Clang at this path first.

clang++

cache

Used to specify whether the Clang installation should be cached in the case Clang needs to be downloaded." .

false

architecture

The target architecture (x86, x64). By default, this value is inferred. .

check-latest

By default, when Clang is not available, this action will install the minimum version in the version spec. This ensures the code respects its contract in terms of what minimum Clang version is supported.

Set this option if you want the action to check for the latest available version that satisfies the version spec instead. .

false

update-environment

Set this option if you want the action to update environment variables.

true

trace-commands

Trace commands executed by the workflow.

false

Outputs

Output

Description

cc

The absolute path to the clang executable.

cxx

The absolute path to the clang++ executable.

dir

The absolute path to the Clang directory containing the executable.

version

The installed Clang version. Useful when given a version range as input.

version-major

The installed Clang version major. Useful when given a version range as input.

version-minor

The installed Clang version minor. Useful when given a version range as input.

version-patch

The installed Clang version patch. Useful when given a version range as input.

cache-hit

A boolean value to indicate a cache entry was found