Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.beta.1 #5

Merged
merged 15 commits into from
Aug 31, 2021
6 changes: 3 additions & 3 deletions .github/workflows/test-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:
- "test/**"

env:
BUILD_TYPE: Release
BUILD_TYPE: Debug

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-18.04, windows-2016]

steps:
- uses: actions/checkout@v2
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: test
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -B build
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBoost_LIBRARY_DIRS="${{steps.install-boost.outputs.BOOST_ROOT}}/lib" -B build
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Build
Expand Down
106 changes: 96 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# Download and install Boost
Install Boost in actions using prebuilt versions from [actions/boost-versions](https://github.com/actions/boost-versions).
Install Boost in GitHub actions using prebuilt binaries.

## Inputs

### `boost_version`
**Required** The boost version to install, e.g. ``1.73.0``.
A list of supported versions can be found [here](https://github.com/actions/boost-versions/blob/main/versions-manifest.json).

### `toolset`
**Optional** A toolset used to compile boost, e.g. ``msvc14.2``. May only be used on windows, as the value on ubuntu is always ``gcc``.
A list of supported versions can be found [here](https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json).

### `platform_version`
**Optional** The platform version of the system boost was compiled on, e.g. ``18.04``. May be only used on ubuntu, as the value is undefined on windows,
thus, when specifying a value, this build step will fail.
**Optional** The platform version of the system boost was compiled on, e.g. ``18.04`` for ``ubuntu-18.04``, ``2016`` for ``windows-2016`` or ``10.15`` for ``macos-10.15``.

### `boost_install_dir`
**Optional** The directory to install boost into. If specified, boost will be installed into
``$boost_install_dir/boost/$BOOST_VERSION_STRING/``. The default value is ``${{env.GITHUB_WORKSPACE}}``.
``$boost_install_dir/boost/boost/``. The default value is ``${{env.GITHUB_WORKSPACE}}``.

### `version`
**Optional** The version of the ``install-boost`` action to use. Must be either ``default`` or ``legacy``. Defaults to ``default``.
If the ``default`` version is used, the binaries are downloaded from [MarkusJx/prebuilt-boost](https://github.com/MarkusJx/prebuilt-boost).
The list of supported toolsets and versions can be found [here](https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json).
If the ``legacy`` version is used, the binaries are downloaded from [actions/boost-versions](https://github.com/actions/boost-versions).
The list of supported toolsets and versions can be found [here](https://github.com/actions/boost-versions/blob/main/versions-manifest.json).

### `toolset`
**DEPRECATED Optional** A toolset used to compile boost, e.g. ``msvc14.2``. May only be used on windows, as the value on ubuntu is always ``gcc``.
Can only be specified when the ``legacy`` version is used.

## Outputs
### `BOOST_ROOT`
Expand All @@ -29,11 +36,69 @@ The boost root directory path, to be passed to another tool, e.g. CMake to find
```

### `BOOST_VER`
The version of boost installed, e.g. ``boost-1.73.0-linux-16.04-gcc-x64``.
The version of boost installed, e.g. ``boost-1.73.0-linux-16.04``.

## Example usage
### Windows
```yml
- name: Install boost
uses: MarkusJx/install-boost@v2.0.0
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
boost_version: 1.73.0
# OPTIONAL: Specify a custon install location
boost_install_dir: C:\some_directory
# OPTIONAL: Specify a platform version
platform_version: 2016

# NOTE: If a boost version matching all requirements cannot be found,
# this build step will fail
```

### Ubuntu
```yml
- name: Install boost
uses: MarkusJx/install-boost@v2.0.0
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
boost_version: 1.73.0
# OPTIONAL: Specify a platform version
platform_version: 18.04
# OPTIONAL: Specify a custom install location
boost_install_dir: /home/runner/some_directory

# NOTE: If a boost version matching all requirements cannot be found,
# this build step will fail
```

### MacOs
```yml
- name: Install boost
uses: MarkusJx/install-boost@v2.0.0
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
boost_version: 1.73.0
# OPTIONAL: Specify a platform version
platform_version: 10.15
# OPTIONAL: Specify a custom install location
boost_install_dir: /home/runner/some_directory

# NOTE: If a boost version matching all requirements cannot be found,
# this build step will fail
```

### Legacy use
#### Windows
```yml
- name: Install boost
uses: MarkusJx/install-boost@v1.0.1
id: install-boost
Expand All @@ -51,7 +116,28 @@ The version of boost installed, e.g. ``boost-1.73.0-linux-16.04-gcc-x64``.
# this build step will fail
```

### Ubuntu
or
```yml
- name: Install boost
uses: MarkusJx/install-boost@v2.0.0
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/actions/boost-versions/blob/main/versions-manifest.json
boost_version: 1.73.0
# Use the legacy version of this action
version: legacy
# OPTIONAL: Specify a toolset on windows
toolset: msvc14.2
# OPTIONAL: Specify a custon install location
boost_install_dir: C:\some_directory

# NOTE: If a boost version matching all requirements cannot be found,
# this build step will fail
```

#### Ubuntu
```yml
- name: Install boost
uses: MarkusJx/install-boost@v1.0.1
Expand Down
Loading