B2 Workflow
This action runs a complete B2 workflow from Boost source files.
If you are developing a Boost library, this is usually the next step in your workflow after setting up a C++ compiler and fetching dependencies with Install Packages.
It takes the Boost source directory and runs the usual steps to test the specified modules. This includes
compiling b2 if needed and generating a proper user-config.jam file.
This action is particularly useful for Boost library proposals, where B2 is mandatory. It assumes
the library being tested is in the libs directory of the Boost super-project and that
source-dir is the root of the super-project.
Next steps
If your library also supports CMake, the next step in your workflow should usually be
CMake Workflow. Otherwise, the next step in your workflow should usually be
the generation of reports, with tools such as the Create Flamegraph (when matrix.time-trace) and
Create Changelog (usually in another workflow job). You can also include customs steps to
upload coverage reports (when matrix.coverage).
If your b2 workflow provides CMake installation and configuration scripts, it is also usual to include multiple CMake workflow steps as integration tests for CMake.
Example
steps:
- name: B2 Workflow
uses: alandefreitas/cpp-actions/b2-workflow@v1.7.0
with:
source-dir: ${{ steps.boost-clone.outputs.boost-dir }}
modules: variant2
toolset: ${{ matrix.b2-toolset }}
build-variant: ${{ matrix.build-type }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx || '' }}
cxxstd: ${{ matrix.cxxstd }}
address-model: ${{ (matrix.x86 && '32') || '64' }}
asan: ${{ matrix.asan }}
ubsan: ${{ matrix.ubsan }}
tsan: ${{ matrix.tsan }}
shared: ${{ matrix.shared }}
Input Parameters
Parameter |
Description |
Default |
|
The boost source directory. This path will be used to build and install |
|
|
Changes the build directories for all project roots being built. When this option is specified, all Jamroot files must declare a project name. The build directory for the project root will be computed by concatenating the value of the --build-dir option, the project name specified in Jamroot, and the build dir specified in Jamroot (or bin, if none is specified). The option is primarily useful when building from read-only media, when you can’t modify Jamroot. |
|
|
Path to C++ compiler. If the input is not specified, the action will use the compiler defined by the environment variable If the environment variable is not specified, the action will use the default compiler as identified by B2. |
|
|
Flags to be used with the C++ compiler.
If the input is not specified, the action will use the flags defined by the environment variable |
|
|
Flags to be used with the C compiler. If the input is not specified, the action will use the flags defined by the environment variable If the environment variable is not specified, the action will use the default flags as identified by B2. |
|
|
Comma-separated list of standards with which B2 will build and test the program. If the input is not specified, the action will use the standards defined by the environment variable If the environment variable is not specified, the action will use the default standards as identified by B2. B2 will iteratively build and test the specified modules with multiple standards. |
|
|
Determines if the If the input is not specified, the action will use the value defined by the environment variable If the environment variable is not specified, the action will use the default value as identified by B2. |
|
|
B2 toolset name. The toolset is somewhat equivalent to a CMake generator. If not specified, the action will use the toolset defined by the environment variable If the environment variable is not specified, the action will use the default toolset detected by B2. |
|
|
Custom build variants. If the provided variant is a CMake build-type, the argument is mapped to the equivalent B2 variant: - - - - If the input is not specified, the action will use the value defined by the environment variable If the environment variable is not specified, the action will use the value from |
|
|
An alternative to If the input is not specified, the action will use the value defined by the environment variable If the environment variable is not specified, the action will use the default value as identified by B2. |
|
|
The list of modules we should test with B2 in the The directory |
|
|
Valid B2 list of address models. |
|
|
Enable address-sanitizer. |
|
|
Enable undefined-sanitizer. |
|
|
Enable thread-sanitizer. |
|
|
Enable coverage. |
|
|
Extra linker flags. |
|
|
B2 threading option. |
|
|
Enables or disables run-time type information. |
|
|
Cleans all targets in the current directory and in any sub-projects. Note that unlike the |
|
|
Cleans all targets, no matter where they are defined. In particular, it will clean targets in parent Jamfiles, and targets defined under other project roots. |
|
|
Compresses target paths by abbreviating each component. This option is useful to keep paths from becoming longer than the filesystem supports. See also the B2 documentation section “Target Paths”. |
|
|
Compresses target paths using an MD5 hash. This option is useful to keep paths from becoming longer than the filesystem supports. This option produces shorter paths than --abbreviate-paths does, but at the cost of making them less understandable. See also the B2 documentation section “Target Paths”. |
|
|
Equivalent to the Causes all files to be rebuilt. |
|
|
Equivalent to the Do not execute the commands, only print them. |
|
|
Equivalent to the Stop at the first error, as opposed to continuing to build targets that don’t depend on the failed ones. |
|
|
Equivalent to the Override all configuration files. |
|
|
Equivalent to the Override the default site-config.jam. |
|
|
Equivalent to the Override the default user-config.jam. When this option is specified, the action will not generate a |
|
|
Equivalent to the Override the default project-config.jam. |
|
|
Equivalent to the Produces debug information about the loading of B2 and toolset files. If not specified, the value is inherited from |
|
|
Equivalent to the Prints what targets are being built and with what properties. If not specified, the value is inherited from |
|
|
Equivalent to the Produces debug output from the generator search process. Useful for debugging custom generators. If not specified, the value is inherited from |
|
|
Additional include paths for C and C++ compilers. |
|
|
Additional macro definitions for C and C++ compilers. The string should be either SYMBOL or SYMBOL=VALUE. |
|
|
Equivalent to the Determines if shared or static version of C and C++ runtimes should be used. |
|
|
Number of jobs to use in parallel builds. If the input is not specified, the action will use the value defined by the environment variable If the environment variable is also not specified, the action will use the number of processors available in the system. |
|
|
Trace commands executed by the workflow. |
|