Skip to content

Commit

Permalink
feat: remove support for auto-install Ninja (#258)
Browse files Browse the repository at this point in the history
* feat: remove support for auto-installing Ninja

* ci: add step for setting up Ninja in `test-action-with-custom-tools` job

* docs: update readme related to auto-install Ninja support removal
  • Loading branch information
threeal authored Mar 22, 2024
1 parent ebf367c commit 4427f0f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ jobs:
test
sparse-checkout-cone-mode: false

- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@v4

- name: Configure, Build, and Test Project
uses: ./
with:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Configure and build your [CMake](https://cmake.org/) project using [GitHub Actio

- Configures a CMake project using the [`cmake`](https://cmake.org/cmake/help/latest/manual/cmake.1.html) command.
- Optionally builds a CMake project using the `cmake --build` command.
- Auto-detects and installs required dependencies.
- Supports specifying multiple CMake options directly from the action inputs.

## Usage
Expand Down Expand Up @@ -84,6 +83,9 @@ jobs:
#### Using Ninja as the Generator and Clang as the Compiler

```yaml
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Configure Project
uses: threeal/cmake-action@v1.3.0
with:
Expand Down
16 changes: 0 additions & 16 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
},
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.3"
"@actions/exec": "^1.1.1"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
Expand Down
15 changes: 0 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as core from "@actions/core";
import { exec } from "@actions/exec";
import { which } from "@actions/io";
import { getInputs } from "./inputs.js";

async function main() {
Expand All @@ -12,20 +11,6 @@ async function main() {
configureArgs.push(...["-G", inputs.generator]);
}

if (inputs.generator.match(/ninja/gi) && !(await which("ninja"))) {
switch (process.platform) {
case "linux":
await exec("sudo", ["apt", "install", "-y", "ninja-build"]);
break;
case "darwin":
await exec("brew", ["install", "ninja"]);
break;
case "win32":
await exec("choco", ["install", "ninja"]);
break;
}
}

if (inputs.cCompiler) {
configureArgs.push("-DCMAKE_C_COMPILER=" + inputs.cCompiler);
}
Expand Down
3 changes: 1 addition & 2 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4427f0f

Please sign in to comment.