A GitHub Action to install and configure the Conan package manager in your workflow.
This action provides a simple and flexible way to set up Conan with custom configurations and audit settings.
Features
🚀 Install any version of Conan 2.x
⚙️ Apply custom Conan configurations
🔐 Configure audit tokens for dependencies vulnerabilities scanning
🗂️ Cache Conan packages using GitHub cache
🔍 Support for custom Conan home
💪 Cross-platform support
Usage
Basic Usage
Install Conan, authenticate to Audit server, install custom configurations:
Lockfiles ensure that Conan will resolve the same graph in a repeatable and consistent manner - thus making sure the same versions are used across multiple systems (CI, developers, etc).
Lockfiles are strict by default, that means that if there is some requires and it cannot find a matching locked reference in the lockfile, it will error and stop. For cases where it is expected that the lockfile will not be complete, as there might be new dependencies, the --lockfile-partial argument can be used.
By default, conan install will not generate an output lockfile, but if the --lockfile-out argument is provided, pointing to a filename, then a lockfile will be generated from the current dependency graph. The same lockfile can be cached or stored in the repository, so that it can be used in the future.
Options
This Github Action offers options inputs to execute extra steps just after installing Conan.
This is useful for installing custom configurations or applying any other setup you need.
It’s possible to customize the action using the following options:
Option
Type
Description
version
string
Conan client version 2.x to be installed. By default, it’s the latest version available.
home
string
A custom path to be used as Conan cache directory.
audit_token
string
The Conan audit token to authenticate to the Audit server with Conan.
config_urls
list
URLs of the Git repositories containing the custom Conan configurations to be installed.
cache_packages
boolean
Cache all stored Conan packages, under Conan cache, using Github cache support. false by default
use_venv
boolean
Use a virtual environment for the Python version set in the GitHub runner.
profile_detect
boolean
Automatically detect and use a Conan profile based on the GitHub runner environment. true by default
python_version
string
DEPRECATED Use the Python version set in the GitHub runner instead or a GitHub Action to set up Python.
Using setup-python Action alongside setup-conan
If you are using the setup-python action in your workflow, you can use it alongside the setup-conan action.
However, keep in mind PKG_CONFIG_PATH is configured by the setup-python action, so it may break the Conan build in case needing to consume .pc files generated by Conan. As workaround, you can clear the PKG_CONFIG_PATH environment variable before running the Conan install command:
Setup Conan Action Github Action
A GitHub Action to install and configure the Conan package manager in your workflow. This action provides a simple and flexible way to set up Conan with custom configurations and audit settings.
Features
Usage
Basic Usage
Install Conan, authenticate to Audit server, install custom configurations:
Using Lockfiles
In order to ensure repeatability, the use of lockfiles on the consumer side is greatly encouraged:
Lockfiles ensure that Conan will resolve the same graph in a repeatable and consistent manner - thus making sure the same versions are used across multiple systems (CI, developers, etc).
Lockfiles are strict by default, that means that if there is some requires and it cannot find a matching locked reference in the lockfile, it will error and stop. For cases where it is expected that the lockfile will not be complete, as there might be new dependencies, the
--lockfile-partialargument can be used.By default, conan install will not generate an output lockfile, but if the
--lockfile-outargument is provided, pointing to a filename, then a lockfile will be generated from the current dependency graph. The same lockfile can be cached or stored in the repository, so that it can be used in the future.Options
This Github Action offers options inputs to execute extra steps just after installing Conan. This is useful for installing custom configurations or applying any other setup you need. It’s possible to customize the action using the following options:
versionhomeaudit_tokenconfig_urlscache_packagesuse_venvprofile_detectpython_versionUsing setup-python Action alongside setup-conan
If you are using the setup-python action in your workflow, you can use it alongside the setup-conan action. However, keep in mind PKG_CONFIG_PATH is configured by the setup-python action, so it may break the Conan build in case needing to consume .pc files generated by Conan. As workaround, you can clear the
PKG_CONFIG_PATHenvironment variable before running the Conan install command:For further details on how to manage enviroment variables of setup-python action, please refer to the setup-python documentation.
License
This project is licensed under the MIT License. See the LICENSE file for details.