You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure, build, and test your [CMake](https://cmake.org/) project using [GitHub Actions](https://github.com/features/actions). This action simplifies the workflow for your CMake project. It configures the build environment using the `cmake` command, and optionally builds the project using the `cmake --build` command and tests the project using the `ctest` command.
7
+
Configure, build, and test your [CMake](https://cmake.org/) project using [GitHub Actions](https://github.com/features/actions). This action simplifies the workflow for configuring the build environment of a CMake project. It can also be optionally specified to build a CMake project using the `cmake --build` command and test it using the `ctest` command.
8
8
9
9
## Features
10
10
11
-
- Configures a project using the [`cmake`](https://cmake.org/cmake/help/latest/manual/cmake.1.html) command.
12
-
-Option to build a project using the `cmake --build` command.
13
-
-Option to test a project using the [`ctest`](https://cmake.org/cmake/help/latest/manual/ctest.1.html) command.
11
+
- Configures a CMake project using the [`cmake`](https://cmake.org/cmake/help/latest/manual/cmake.1.html) command.
12
+
-Optionally builds a CMake project using the `cmake --build` command.
13
+
-Optionally tests a CMake project using the [`ctest`](https://cmake.org/cmake/help/latest/manual/ctest.1.html) command.
14
14
- Auto-detects and installs required dependencies.
15
-
- Supports specifying multiple CMake options directly from the Action inputs.
15
+
- Supports specifying multiple CMake options directly from the action inputs.
16
16
17
17
## Usage
18
18
@@ -22,6 +22,7 @@ For more information, refer to [action.yml](./action.yml) and the [GitHub Action
22
22
23
23
| Name | Value Type | Description |
24
24
| --- | --- | --- |
25
+
|`shell`| String | The shell to be used to run the commands. It defaults to `pwsh` on Windows and `bash` on Linux and macOS. Refer to [this](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell) for more information on available shell options. |
25
26
|`source-dir`| Path | The source directory of the CMake project. It defaults to the current directory. |
26
27
|`build-dir`| Path | The build directory of the CMake project. It defaults to the `build` directory inside the source directory. |
27
28
|`generator`| String | The build system generator for the CMake project. It appends the CMake configuration arguments with `-G [val]`. |
@@ -40,6 +41,12 @@ For more information, refer to [action.yml](./action.yml) and the [GitHub Action
40
41
41
42
> **Note**: All inputs are optional.
42
43
44
+
### Outputs
45
+
46
+
| Name | Value Type | Description |
47
+
| --- | --- | --- |
48
+
|`build-dir`| Path | The build directory of the CMake project. |
> **Note**: You can replace `@main` with any version you prefer. See [this](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses).
73
+
> **Note**: You can replace [`v1.3.0`](https://github.com/threeal/cmake-action/releases/tag/v1.3.0) with any version you prefer. See [this](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses).
67
74
68
-
#### Specify the Source and Build Directories
75
+
#### Configure, Build, and Test in the Same Step
69
76
70
77
```yaml
71
-
- name: Configure the project
72
-
uses: threeal/cmake-action@main
78
+
- name: Configure, build, and test the project
79
+
uses: threeal/cmake-action@v1.3.0
73
80
with:
74
-
source-dir: submodules
75
-
build-dir: submodules/out
81
+
run-build: true
82
+
run-test: true
76
83
```
77
84
78
-
#### Configure, Build, and Test in the Same Step
85
+
#### Specify the Source and Build Directories
79
86
80
87
```yaml
81
-
- name: Configure, build, and test the project
82
-
uses: threeal/cmake-action@main
88
+
- name: Configure the project
89
+
uses: threeal/cmake-action@v1.3.0
83
90
with:
84
-
options: BUILD_TESTING=ON
85
-
run-build: true
86
-
run-test: true
91
+
source-dir: submodules
92
+
build-dir: submodules/out
87
93
```
88
94
89
95
#### Using Ninja as the Generator and Clang as the Compiler
0 commit comments