Skip to content

Commit 17fa293

Browse files
committed
fix: make nala optional
1 parent e4001f3 commit 17fa293

File tree

7 files changed

+22
-30
lines changed

7 files changed

+22
-30
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ Setting up a **cross-platform** environment for building and testing C++/C proje
1010

1111
`setup-cpp` is supported on many platforms. It is continuously tested on several configurations including Windows (11, 10, 2022, 2019), Linux (Ubuntu 22.04, Ubuntu 20.04, Fedora, ArchLinux), and macOS (12, 11, 10.15). `setup-cpp` is backed by unit tests for each tool and integration tests for compiling cpp projects.
1212

13-
# Features
13+
## Features
1414

1515
`setup-cpp` is **modular** and you can choose to install any of these tools:
1616

1717
| category | tools |
1818
| --------------------- | ------------------------------------------------------------ |
1919
| compiler and analyzer | llvm, gcc, msvc, vcvarsall, cppcheck, clangtidy, clangformat |
2020
| build system | cmake, ninja, meson, make, task |
21-
| package manager | vcpkg, conan, choco, brew |
21+
| package manager | vcpkg, conan, choco, brew, nala |
2222
| cache | cppcache |
2323
| documentation | doxygen, graphviz |
2424
| coverage | gcovr, opencppcoverage, kcov |
2525
| other | python, sevenzip |
2626

2727
`setup-cpp` automatically installs the dependencies above tools if needed for the selected tool (e.g., `python` is required for `conan`).
2828

29-
# Usage
29+
## Usage
3030

31-
## From Terminal
31+
### From Terminal
3232

3333
You should download the executable file or the js file (if Nodejs installed), and run it with the available options.
3434

3535
Tip: You can automate downloading using `wget`, `curl`, or other similar tools.
3636

37-
### Executable
37+
#### Executable
3838

3939
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.18.0), and run it with the available options.
4040

@@ -72,7 +72,7 @@ NOTE: On Unix systems, when `setup-cpp` is used locally or in other CI services
7272

7373
NOTE: On Unix systems, you will not need `sudo` if you are already a root user (e.g., in a GitLab runner or Docker).
7474

75-
### With Nodejs
75+
#### With Nodejs
7676

7777
Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.18.0/setup_cpp.js), and run it with the available options.
7878

@@ -97,7 +97,7 @@ sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true
9797
source ~/.cpprc # activate cpp environment variables
9898
```
9999

100-
## Inside GitHub Actions
100+
### Inside GitHub Actions
101101

102102
Here is a complete cross-platform example that tests llvm, gcc, and msvc. It also uses cmake, ninja, vcpkg, and cppcheck.
103103

@@ -158,7 +158,7 @@ jobs:
158158
# ...
159159
```
160160

161-
## Inside Docker
161+
### Inside Docker
162162

163163
Here is an example for using setup_cpp to make a builder image that has the Cpp tools you need.
164164

@@ -213,7 +213,7 @@ After build, run the following to start an interactive shell in your container
213213
docker run -it setup_cpp
214214
```
215215

216-
## Inside Docker inside GitHub Actions
216+
### Inside Docker inside GitHub Actions
217217

218218
You can use the docker file discussed in the previous section inside GitHub Actions like the following:
219219

@@ -235,7 +235,7 @@ jobs:
235235
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
236236
```
237237
238-
## Inside GitLab pipelines
238+
### Inside GitLab pipelines
239239
240240
The following gives an example for setting up a C++ environment inside GitLab pipelines.
241241
@@ -292,11 +292,11 @@ test_linux_gcc:
292292
- *test
293293
```
294294

295-
# Articles
295+
## Articles
296296

297297
[Setup-Cpp on Dev.to](https://dev.to/aminya/setup-cpp-3ia4)
298298

299-
# Usage Examples
299+
## Usage Examples
300300

301301
- [cpp_vcpkg_project project](https://github.com/aminya/cpp_vcpkg_project)
302302
- [ftxui](https://github.com/ArthurSonzogni/FTXUI)

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ inputs:
7575
sevenzip:
7676
description: "The 7z version to install."
7777
required: false
78+
nala:
79+
description: 'The nala version to install ("" or "legacy").'
80+
required: false
7881

7982
runs:
8083
using: "node12"

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/setup_cpp.mjs.map

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/main.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ import { addEnv } from "./utils/env/addEnv"
4343
import { setupSevenZip } from "./sevenzip/sevenzip"
4444
import { setupGraphviz } from "./graphviz/graphviz"
4545
import { setupNala } from "./nala/nala"
46-
import { isUbuntu } from "./utils/env/isUbuntu"
4746

4847
/** The setup functions */
4948
const setups = {
49+
nala: setupNala,
5050
cmake: setupCmake,
5151
ninja: setupNinja,
5252
python: setupPython,
@@ -71,11 +71,11 @@ const setups = {
7171
make: setupMake,
7272
task: setupTask,
7373
sevenzip: setupSevenZip,
74-
nala: setupNala,
7574
}
7675

7776
/** The tools that can be installed */
7877
const tools: Array<keyof typeof setups> = [
78+
"nala",
7979
"choco",
8080
"brew",
8181
"python",
@@ -100,7 +100,6 @@ const tools: Array<keyof typeof setups> = [
100100
"make",
101101
"task",
102102
"sevenzip",
103-
"nala",
104103
]
105104

106105
/** The possible inputs to the program */
@@ -155,17 +154,6 @@ export async function main(args: string[]): Promise<number> {
155154
return 1
156155
}
157156

158-
// https://gitlab.com/volian/nala/-/issues/115
159-
//
160-
if (isUbuntu()) {
161-
try {
162-
setupNala(getVersion("nala", undefined, osVersion), "", arch)
163-
} catch (err) {
164-
warning((err as Error).toString())
165-
// continue with apt-get
166-
}
167-
}
168-
169157
// loop over the tools and run their setup function
170158
for (const tool of tools) {
171159
// get the version or "true" or undefined for this tool from the options
@@ -387,6 +375,7 @@ All the available tools:
387375
--python
388376
--choco
389377
--brew
378+
--nala
390379
--sevenzip
391380
--graphviz
392381
`)

0 commit comments

Comments
 (0)