Skip to content

Commit

Permalink
Merge pull request #26 from threeal/audit-code
Browse files Browse the repository at this point in the history
Audit Wording in the Code
  • Loading branch information
threeal authored Jan 14, 2023
2 parents 5e43077 + dd5801b commit 894b72b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Use this action
uses: ./

- name: Run build result
- name: Run the build result
run: ${{ matrix.os == 'windows' && 'build\Debug\hello_world.exe' || 'build/hello_world' }}

specified-dir-usage:
Expand All @@ -33,7 +33,7 @@ jobs:
source-dir: test
build-dir: test/build

- name: Run build result
- name: Run the build result
run: test/build/hello_world

- name: Check if the default build directory does not exist
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
cxx-compiler: clang++
args: -D CHECK_USING_CLANG=ON

- name: Run build result
- name: Run the build results
run: build/test_c && build/test_cpp

specified-generator-usage:
Expand All @@ -93,5 +93,5 @@ jobs:
source-dir: test
generator: Ninja

- name: Run build result
- name: Run the build result
run: build/hello_world
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ For more information, see [action.yml](./action.yml) and [GitHub Actions guide](

### 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. |
| `targets` | Multiple strings | List of build targets. |
| `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. |
| `c-flags` | Multiple strings | Additional flags passed when compiling C language files. Could be specified more than one. Separate each flag with a space or a new line. |
| `cxx-flags` | Multiple strings | Additional flags passed when compiling C++ language files. Could be specified more than one. Separate each flag with a space or a new line. |
| `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. |
| `cxx-compiler` | String | Preferred executable for compiling C++ language files. |
| `c-flags` | Multiple strings | Additional flags passed when compiling C language files. |
| `cxx-flags` | Multiple strings | Additional flags passed when compiling C++ language files. |
| `args` | Multiple strings | Additional arguments passed during the CMake configuration. |

> Note: Multiple strings mean that the input could be specified with more than one value. Separate each value with a space or a new line.
> Note: All inputs are optional.
### Examples

Expand All @@ -45,7 +47,7 @@ jobs:
> Note: You can replace `@latest` with any version you like.

#### Using Different Directories
#### Specify the Source and the Build Directories

```yaml
- name: Configure and build this project
Expand All @@ -55,19 +57,21 @@ jobs:
build-dir: submodules/build
```

#### Build Custom Targets
#### Specify the Build Targets and Additional Options

```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
-DCMAKE_CXX_FLAGS='-Werror'
```

#### Build Using Ninja and Clang
#### Using Ninja as the Generator and Clang as the Compiler

```yaml
- name: Configure and build this project
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ inputs:
description: Preferred executable for compiling C language files
required: false
cxx-compiler:
description: Preferred executable for compiling CXX language files
description: Preferred executable for compiling C++ language files
required: false
c-flags:
description: Additional flags passed when compiling C language files
Expand All @@ -37,7 +37,7 @@ inputs:
runs:
using: composite
steps:
- name: Process inputs
- name: Process the inputs
id: process_inputs
shell: bash
run: |
Expand Down Expand Up @@ -77,7 +77,7 @@ runs:
*) choco install ninja ;;
esac
- name: Configure CMake
- name: Configure the CMake project
shell: bash
run: cmake ${{ steps.process_inputs.outputs.cmake_args }}

Expand Down

0 comments on commit 894b72b

Please sign in to comment.