From c421afa648cac4a833cec61ea88308c544b634ec Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 23 Jan 2023 14:39:51 +0700 Subject: [PATCH 1/7] modify action short description to include testing a project --- README.md | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5923fd7..420f0ce 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![license](https://img.shields.io/github/license/threeal/cmake-action)](./LICENSE) [![test status](https://img.shields.io/github/actions/workflow/status/threeal/cmake-action/test.yml?label=test&branch=main)](https://github.com/threeal/cmake-action/actions/workflows/test.yml) -Configure and build a [CMake](https://cmake.org/) project on [GitHub Actions](https://github.com/features/actions). +Configure, build, and test a [CMake](https://cmake.org/) project on [GitHub Actions](https://github.com/features/actions). ## Usage diff --git a/action.yml b/action.yml index 3759521..ec6c6aa 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: CMake Action -description: Configure and build a CMake project +description: Configure, build, and test a CMake project author: Alfi Maulana branding: color: gray-dark From cb46ab8971d82bfe23cbf78efb850dbf5d97bdd7 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 23 Jan 2023 14:41:35 +0700 Subject: [PATCH 2/7] expand project description --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 420f0ce..c95538e 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ [![test status](https://img.shields.io/github/actions/workflow/status/threeal/cmake-action/test.yml?label=test&branch=main)](https://github.com/threeal/cmake-action/actions/workflows/test.yml) Configure, build, and test a [CMake](https://cmake.org/) project on [GitHub Actions](https://github.com/features/actions). +Use this action to simplify the workflow run of your CMake project. +This action will configure a build environment for your project using the `cmake` command, + then it will build your project by running a `cmake --build` command, + and last it could test your project using the `ctest` command. ## Usage From 38a05924280d848a8a65e7a670177fbb9ca502ed Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 23 Jan 2023 14:54:21 +0700 Subject: [PATCH 3/7] add a new feature section in the `README.md` --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index c95538e..13bbb8e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,13 @@ This action will configure a build environment for your project using the `cmake then it will build your project by running a `cmake --build` command, and last it could test your project using the `ctest` command. +## Features + +- Configure and build a project using the [cmake](https://cmake.org/cmake/help/latest/manual/cmake.1.html) command. +- Optionally test a project using the [ctest](https://cmake.org/cmake/help/latest/manual/ctest.1.html) command. +- Auto-detect and install required dependencies. +- Specify multiple CMake options directly from the Action inputs. + ## Usage For more information, see [action.yml](./action.yml) and [GitHub Actions guide](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions). From 0a9428a22b618641338e9cd4fc8367d94cd91ae2 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 23 Jan 2023 15:02:08 +0700 Subject: [PATCH 4/7] update the default value info of `build-dir` action input --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13bbb8e..6288681 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ For more information, see [action.yml](./action.yml) and [GitHub Actions guide]( | Name | Value Type | Description | | --- | --- | --- | | `source-dir` | Path | Source directory of the CMake project. Defaults to current directory. | -| `build-dir` | Path | Build directory of the CMake project. Defaults to `build` directory in current directory. | +| `build-dir` | Path | Build directory of the CMake project. Defaults to `build` directory inside the source directory. | | `targets` | Multiple strings | List of build targets. | | `run-test` | `true` or `false` | If enabled, run testing using [CTest](https://cmake.org/cmake/help/latest/manual/ctest.1.html). Defaults to `false`. | | `generator` | String | Build system generator of the CMake project. | From 4ee1d5d7fc6ee19e878d20e5aedce71c74df62f4 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 23 Jan 2023 15:31:39 +0700 Subject: [PATCH 5/7] add detailed info about using the action version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6288681..c780911 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ jobs: uses: threeal/cmake-action@latest ``` -> Note: You can replace `@latest` with any version you like. +> Note: You can replace `@latest` with any version you like. See [this](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsuses). #### Specify the Source and the Build Directories From 921b31dcf42da1dc0d09ca909891b398c6481c40 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 23 Jan 2023 15:37:40 +0700 Subject: [PATCH 6/7] add a run unit tests example in the `README.md` --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index c780911..776bee3 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,16 @@ jobs: -DBUILD_TESTING=ON ``` +#### Run Unit Tests After Build + +```yaml +- name: Configure, build, and test this project + uses: threeal/cmake-action@latest + with: + args: -DBUILD_TESTING=ON + run-test: true +``` + #### Using Ninja as the Generator and Clang as the Compiler ```yaml From 42dedb750753cb1ed08aef319011e45fd213daf6 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Mon, 23 Jan 2023 15:39:29 +0700 Subject: [PATCH 7/7] audit examples in the `README.md` --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 776bee3..cc25a92 100644 --- a/README.md +++ b/README.md @@ -67,21 +67,16 @@ jobs: uses: threeal/cmake-action@latest with: source-dir: submodules - build-dir: submodules/build + build-dir: submodules/out ``` -#### Specify the Build Targets and Additional Options +#### Specify the Build Targets ```yaml - name: Configure and build this project uses: threeal/cmake-action@latest with: - targets: hello_world_test fibonacci_test - c-flags: -Werror - cxx-flags: -Werror - args: | - -DCMAKE_BUILD_TYPE=Debug - -DBUILD_TESTING=ON + targets: hello_mars hello_sun ``` #### Run Unit Tests After Build