Setup GCC
Set up a specific version of a GCC 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 GCC version, and not only the versions circumstantially provided by apt-get.
This action uses a number of alternatives to find or install GCC:
-
The GCC path provided to 'path'
-
Any other version of GCC it can find in the system
-
Any other version of GCC available from APT
-
A version of GCC from our own binary releases
The action will not attempt to install GCC from source files, which is the only officially supported method but impossible to run in CI because the machines would take hours to do that.
If a version of GCC is not available by any other methods above, the GCC binaries for a given platform can be built locally with a script provided in this repository and added to our binary release.
In most workflows, this is used as an auxiliary action for the Setup C++ action, which already calls this action if necessary.
Next steps
After setting up the proper C++ compiler for a matrix entry, the next step in your workflow should usually be Install Packages.
Input Parameters
Parameter |
Description |
Default |
|
Version range or exact version of GCC to use, using SemVer’s version range syntax. By default, it uses any version available in the environment. |
|
|
Path to the gcc or g++ executable. We attempt to find GCC at this path first. |
|
|
By default, when GCC 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 GCC version is supported. Set this option if you want the action to check for the latest available version that satisfies the version spec instead. |
|
|
Set this option if you want the action to update environment variables. |
|
|
Trace commands executed by the workflow. |
|
Outputs
Output |
Description |
|
The absolute path to the gcc executable. |
|
The absolute path to the g++ executable. |
|
The absolute path to the GCC directory containing the executable. |
|
The installed GCC version. Useful when given a version range as input. |
|
The installed GCC version major. Useful when given a version range as input. |
|
The installed GCC version minor. Useful when given a version range as input. |
|
The installed GCC version patch. Useful when given a version range as input. |