From 9db1e3860e692a163c2feb312968dbaa234c6611 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Fri, 13 Jan 2023 21:18:44 +0700 Subject: [PATCH 1/6] add release and license badge in `README.md` --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0be5739..9215c5d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # CMake Action +[![latest version](https://img.shields.io/github/v/release/threeal/cmake-action)](https://github.com/threeal/cmake-action/releases/) +[![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 [CMake](https://cmake.org/) project on [GitHub Actions](https://github.com/features/actions). From a6e04c0eddde9ca1853905e5f638a6256bd4980a Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Fri, 13 Jan 2023 21:38:46 +0700 Subject: [PATCH 2/6] update description of inputs in `action.yml` --- action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index fe0ba87..cf45db3 100644 --- a/action.yml +++ b/action.yml @@ -6,27 +6,27 @@ branding: icon: terminal inputs: source-dir: - description: The source directory of CMake project + description: Source directory of the CMake project required: false default: . build-dir: - description: The build directory of CMake project + description: Build directory of the CMake project required: false default: build targets: description: List of build targets required: false generator: - description: The build system generator of the CMake project + description: Build system generator of the CMake project required: false c-compiler: - description: The preferred executable for compiling C language files + description: Preferred executable for compiling C language files required: false cxx-compiler: - description: The preferred executable for compiling CXX language files + description: Preferred executable for compiling CXX language files required: false args: - description: Additional arguments passed during CMake configuration + description: Additional arguments passed during the CMake configuration required: false runs: using: composite From 74b57c8136795e2ac043538bab9a20814f18134c Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Fri, 13 Jan 2023 21:53:20 +0700 Subject: [PATCH 3/6] add inputs usage in `README.md` --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 9215c5d..8a65f37 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,21 @@ [![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 [CMake](https://cmake.org/) project on [GitHub Actions](https://github.com/features/actions). + +## 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). + +### Inputs + +> Note: All inputs are optional. + +| 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. | +| `targets` | Multiple strings | List of build targets. Could be specified more than one. Separate each target with a space or a new line. | +| `generator` | String | Build system generator of the CMake project. | +| `c-compiler` | String | Preferred executable for compiling C language files. | +| `cxx-compiler` | String | Preferred executable for compiling CXX language files. | +| `args` | Multiple strings | Additional arguments passed during the CMake configuration. Could be specified more than one. Separate each target with a space or a new line. | From 6eb10c8bde652faacb19c216d26a16d1747454dd Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Fri, 13 Jan 2023 22:16:56 +0700 Subject: [PATCH 4/6] add example usage in `README.md` --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/README.md b/README.md index 8a65f37..9a92c7a 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,55 @@ For more information, see [action.yml](./action.yml) and [GitHub Actions guide]( | `c-compiler` | String | Preferred executable for compiling C language files. | | `cxx-compiler` | String | Preferred executable for compiling CXX language files. | | `args` | Multiple strings | Additional arguments passed during the CMake configuration. Could be specified more than one. Separate each target with a space or a new line. | + +### Examples + +```yaml +name: build +on: + push: +jobs: + build-project: + runs-on: ubuntu-latest + steps: + - name: Check out this repository + uses: actions/checkout@v3.3.0 + + - name: Configure and build this project + uses: threeal/cmake-action@latest +``` + +> Note: You can replace `@latest` with any version you like. + +#### Using Different Directories + +```yaml +- name: Configure and build this project + uses: threeal/cmake-action@latest + with: + source-dir: submodules + build-dir: submodules/build +``` + +#### Build Custom Targets + +```yaml +- name: Configure and build this project + uses: threeal/cmake-action@latest + with: + targets: hello_world_test fibonacci_test + args: | + -DBUILD_TESTING=ON + -DCMAKE_CXX_FLAGS='-Werror' +``` + +#### Build Using Ninja and Clang + +```yaml +- name: Configure and build this project + uses: threeal/cmake-action@latest + with: + generator: Ninja + c-compiler: clang + cxx-compiler: clang++ +``` From fe03c22b18e3c0881034e608ff9c531cb1fc372c Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Fri, 13 Jan 2023 22:25:13 +0700 Subject: [PATCH 5/6] fix wording in the description --- README.md | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a92c7a..9ce6367 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 [CMake](https://cmake.org/) project on [GitHub Actions](https://github.com/features/actions). +Configure and build a [CMake](https://cmake.org/) project on [GitHub Actions](https://github.com/features/actions). ## Usage diff --git a/action.yml b/action.yml index cf45db3..f2e549a 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: CMake Action -description: Configure and build CMake project +description: Configure and build a CMake project author: Alfi Maulana branding: color: gray-dark From 37384db37fbb963e5d65f3e9067fc4020852c416 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Sat, 14 Jan 2023 15:55:48 +0700 Subject: [PATCH 6/6] add license section in `README.md` --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 9ce6367..8e3bbb6 100644 --- a/README.md +++ b/README.md @@ -75,3 +75,9 @@ jobs: c-compiler: clang cxx-compiler: clang++ ``` + +## License + +This project is licensed under the terms of the [MIT License](./LICENSE). + +Copyright © 2023 [Alfi Maulana](https://github.com/threeal/)