Compare commits

...

11 Commits

Author SHA1 Message Date
Amin Yahyaabadi 9bc9b8cd8a chore(release): v1.7.2 [skip test] 2025-11-10 00:13:02 -08:00
Amin Ya 3481e9e840
feat: support LLVM 21 + GCC 15.2 (#447) 2025-11-10 00:10:16 -08:00
renovate[bot] cc0e9fb8ec
chore(deps): update actions/download-artifact action to v5 (#434)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 00:04:40 -07:00
renovate[bot] 131fbe52b0
chore(deps): update actions/checkout action to v5 (#435)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 00:04:08 -07:00
renovate[bot] d93d404f38
fix(deps): update dependency @types/node to v22.17.2 (#431)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 00:03:50 -07:00
renovate[bot] a55b1da658
chore(deps): update pnpm to v10.15.0 (#432)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-25 00:03:37 -07:00
Amin Ya 24822b26f9
Merge pull request #429 from aminya/build-improve
feat: add a unified setup-options for all setup functions
2025-07-10 09:46:29 -07:00
Amin Yahyaabadi 747e9cfe05 fix: fix partial options for tar 2025-07-10 07:11:16 -07:00
Amin Yahyaabadi 26bd7cda45 fix: allow partial options for setup tools 2025-07-10 06:59:25 -07:00
Amin Yahyaabadi 6f1d3cd81e fix: add setup-options for all setup functions 2025-07-10 06:59:25 -07:00
Amin Yahyaabadi bb0daa4e32 build: use esbuild for minification
Size is not much of a concern for setup-cpp and the difference is few KB.
2025-07-10 06:59:25 -07:00
129 changed files with 934 additions and 432 deletions

View File

@ -12,7 +12,7 @@ concurrency:
env:
NODE_OPTIONS: --enable-source-maps
version: "1.7.1"
version: "1.7.2"
jobs:
Build:
@ -24,7 +24,7 @@ jobs:
os:
- ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
ref: ${{ github.head_ref || github.ref_name }}
@ -91,10 +91,10 @@ jobs:
- macos-13 # x64
- macos-14 # arm64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Download Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: dist
@ -170,12 +170,12 @@ jobs:
# - macos-14-xlarge #arm64
- macos-13 # x64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true
- name: Download Dist
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: dist
@ -273,12 +273,12 @@ jobs:
platform: linux/arm64
container: { distro: "alpine", image: "setup-cpp-alpine", tag: "3.21", base_version: "22-alpine3.21" }
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
submodules: true
- name: Download Dist
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: dist
@ -533,7 +533,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Download Executables
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
pattern: exe-*
path: ./exe/
@ -545,7 +545,7 @@ jobs:
chmod +x -R ./exe/
- name: Download Dist
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: dist
path: dist/

2
.nvmrc
View File

@ -1 +1 @@
22.17.0
22.21.1

View File

@ -1,11 +0,0 @@
import { buildTerserOptions } from "terser-config-atomic/dist/builder.js"
const config = buildTerserOptions(process.env.NODE_ENV, undefined, true)
if (
typeof config.compress === "object"
&& "unsafe_math" in config.compress
) {
config.compress.unsafe_math = false
}
export default config

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.21...3.28)
project(
setup_cpp_tests
VERSION 1.7.1
VERSION 1.7.2
DESCRIPTION "Tests for setup-cpp"
HOMEPAGE_URL "https://github.com/aminya/setup-cpp"
LANGUAGES CXX C)

View File

@ -70,19 +70,19 @@ NOTE: setup-cpp requires Nodejs 12 or higher. If Nodejs shipped with your distri
#### With executable
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v1.7.1), and run it with the available options. You can also automate downloading using `curl`, or other similar tools.
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v1.7.2), and run it with the available options. You can also automate downloading using `curl`, or other similar tools.
```shell
# windows x64
curl -o ./setup-cpp.exe -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.1/setup-cpp-x64-windows.exe"
curl -o ./setup-cpp.exe -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.2/setup-cpp-x64-windows.exe"
# linux x64
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.1/setup-cpp-x64-linux"
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.2/setup-cpp-x64-linux"
# linux arm64
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.1/setup-cpp-arm64-linux"
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.2/setup-cpp-arm64-linux"
# macos arm64
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.1/setup-cpp-arm64-macos"
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.2/setup-cpp-arm64-macos"
# macos x64
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.1/setup-cpp-x64-macos"
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v1.7.2/setup-cpp-x64-macos"
```
An example that installs llvm, cmake, ninja, ccache, and vcpkg:
@ -213,8 +213,8 @@ The tags are in the following template:
- Base image: `aminya/setup-cpp-ubuntu:24.04`
- Compiler image: `aminya/setup-cpp-ubuntu-llvm:24.04`
- Base image with pinned setup-cpp version: `aminya/setup-cpp-ubuntu:24.04-v1.7.1`
- Compiler image with pinned setup-cpp version: `aminya/setup-cpp-ubuntu-llvm:24.04-v1.7.1`
- Base image with pinned setup-cpp version: `aminya/setup-cpp-ubuntu:24.04-v1.7.2`
- Compiler image with pinned setup-cpp version: `aminya/setup-cpp-ubuntu-llvm:24.04-v1.7.2`
The supported platforms are `ubuntu`, `alpine`, `fedora`, and `arch`. The supported compilers are `llvm`, `gcc`, and `mingw`.
@ -366,7 +366,7 @@ RUN apt-get update -qq && \
# install nodejs
apt-get install -y --no-install-recommends nodejs npm && \
# install setup-cpp
npm install -g setup-cpp@v1.7.1 && \
npm install -g setup-cpp@v1.7.2 && \
# install the compiler and tools
NODE_OPTIONS="--enable-source-maps" \
setup-cpp \
@ -476,7 +476,7 @@ stages:
apt-get install -y --no-install-recommends nodejs npm
# install setup-cpp
npm install -g setup-cpp@v1.7.1
npm install -g setup-cpp@v1.7.2
# install the compiler and tools
./setup-cpp-x64-linux --compiler $compiler --cmake true --ninja true --ccache true --vcpkg true

View File

@ -20,8 +20,8 @@ The tags are in the following template:
- Base image: `aminya/setup-cpp-ubuntu:24.04`
- Compiler image: `aminya/setup-cpp-ubuntu-llvm:24.04`
- Base image with pinned setup-cpp version: `aminya/setup-cpp-ubuntu:24.04-v1.7.1`
- Compiler image with pinned setup-cpp version: `aminya/setup-cpp-ubuntu-llvm:24.04-v1.7.1`
- Base image with pinned setup-cpp version: `aminya/setup-cpp-ubuntu:24.04-v1.7.2`
- Compiler image with pinned setup-cpp version: `aminya/setup-cpp-ubuntu-llvm:24.04-v1.7.2`
The supported platforms are `ubuntu`, `alpine`, `fedora`, and `arch`. The supported compilers are `llvm`, `gcc`, and `mingw`.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7
dist/legacy/assets/index-CyGoLSfE.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"ninja":"1.12.1","cmake":"3.31.7","task":"3.43.3","powershell":"7.5.1","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.8.1","18":"0.61.4","else":"0.61.4"},"else":"1.8.1"},"else":"1.8.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-2","ubuntu":{"22":"1.14.0","18":"1.10.0","else":"1.10.0"},"else":"1.14.0"},"else":"1.14.0"},"gcc":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"}}
{"ninja":"1.12.1","cmake":"3.31.7","task":"3.43.3","powershell":"7.5.1","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.8.1","18":"0.61.4","else":"0.61.4"},"else":"1.8.1"},"else":"1.8.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-2","ubuntu":{"22":"1.14.0","18":"1.10.0","else":"1.10.0"},"else":"1.14.0"},"else":"1.14.0"},"tar":{"win32":"1.13-1","else":""},"gcc":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7
dist/modern/assets/index-CkjZCcSz.mjs vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"ninja":"1.12.1","cmake":"3.31.7","task":"3.43.3","powershell":"7.5.1","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.8.1","18":"0.61.4","else":"0.61.4"},"else":"1.8.1"},"else":"1.8.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-2","ubuntu":{"22":"1.14.0","18":"1.10.0","else":"1.10.0"},"else":"1.14.0"},"else":"1.14.0"},"gcc":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"}}
{"ninja":"1.12.1","cmake":"3.31.7","task":"3.43.3","powershell":"7.5.1","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.8.1","18":"0.61.4","else":"0.61.4"},"else":"1.8.1"},"else":"1.8.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-2","ubuntu":{"22":"1.14.0","18":"1.10.0","else":"1.10.0"},"else":"1.14.0"},"else":"1.14.0"},"tar":{"win32":"1.13-1","else":""},"gcc":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"}}

View File

@ -1,4 +1,4 @@
{
"name": "setup-cpp",
"version": "1.7.1"
"version": "1.7.2"
}

View File

@ -1,6 +1,6 @@
{
"name": "setup-cpp",
"version": "1.7.1",
"version": "1.7.2",
"description": "Install all the tools required for building and testing C++/C projects.",
"repository": "https://github.com/aminya/setup-cpp",
"license": "Apache-2.0",
@ -17,12 +17,12 @@
"build.cli.legacy": "cross-env NODE_ENV=production vite build --mode cli-legacy",
"build.library": "cross-env NODE_ENV=production vite build --mode library",
"build.types.modern": "tsc -p ./tsconfig.types.json",
"build.json": "shx cp ./src/*/*.json ./dist/legacy/ && shx cp ./dist/legacy/*.json ./dist/modern && minijson --file ./dist/**/*.json",
"build.json": "shx cp ./src/*/*.json ./dist/legacy/ && shx cp ./dist/legacy/*.json ./dist/modern && minijson --file \"dist/**/*.json\"",
"build.bash": "shx cp ./src/*/*.bash ./dist/legacy/ && shx cp ./dist/legacy/*.bash ./dist/modern",
"bump": "ncu -u -x execa,numerous,eslint,@types/eslint,which && pnpm update && pnpx typesync && pnpm run clean",
"bump.llvm": "GITHUB_TOKEN=$(gh auth token) tsx ./src/llvm/assets-list.ts",
"bump.gcc": "GITHUB_TOKEN=$(gh auth token) tsx ./src/gcc/assets-list.ts",
"bump.infer": "GITHUB_TOKEN=$(gh auth token) tsx ./src/infer/assets-list.ts",
"bump.llvm": "tsx ./src/llvm/assets-list.ts",
"bump.gcc": "tsx ./src/gcc/assets-list.ts",
"bump.infer": "tsx ./src/infer/assets-list.ts",
"bump.versions": "run-p bump.llvm bump.gcc bump.infer && run-s format",
"clean": "shx rm -rf ./dist ./packages/*/dist ./exe ./.parcel-cache && shx mkdir -p ./dist/legacy ./dist/modern ./dist/modern ",
"dev.vite": "cross-env NODE_ENV=development vite build --watch",
@ -130,8 +130,6 @@
"setup-python": "github:aminya/setup-python#9700887",
"shx": "0.4.0",
"simple-update-notifier": "^2.0.0",
"terser": "^5.39.0",
"terser-config-atomic": "^1.0.0",
"time-delta": "github:aminya/time-delta#69d91a4",
"timers-browserify": "^2.0.12",
"ts-node": "^10.9.2",
@ -178,7 +176,6 @@
"setup-alpine",
"setup-brew",
"setup-python",
"simple-update-notifier",
"time-delta",
"ubuntu-version",
"untildify-user",
@ -194,7 +191,7 @@
"node": ">=12.x",
"pnpm": "^10"
},
"packageManager": "pnpm@10.12.4",
"packageManager": "pnpm@10.21.0",
"workspaces": [
"packages/*"
],

View File

@ -20,7 +20,7 @@
},
"dependencies": {
"@actions/core": "^1.10.1",
"@types/node": "22.16.0",
"@types/node": "22.17.2",
"admina": "^1.0.1",
"ci-info": "^4.0.0",
"escape-path-with-spaces": "^1.0.2",

View File

@ -24,7 +24,7 @@
"test": "jest --coverage"
},
"dependencies": {
"@types/node": "22.16.0",
"@types/node": "22.17.2",
"admina": "^1.0.1",
"path-exists": "^5.0.0",
"ci-log": "workspace:*",

View File

@ -24,7 +24,7 @@
"test": "jest --coverage --runInBand"
},
"dependencies": {
"@types/node": "22.16.0",
"@types/node": "22.17.2",
"admina": "^1.0.1",
"ci-info": "^4.0.0",
"ci-log": "workspace:*",

View File

@ -11,7 +11,13 @@ import { qualifiedNeededAptPackage } from "./qualify-install.js"
let binDir: string | undefined
export async function setupNala(version?: string) {
export type SetupOptions = {
version: string
setupDir: string
arch: string
}
export async function setupNala({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
if (!hasAptGet()) {
return undefined
}

View File

@ -24,7 +24,7 @@
"test": "jest --coverage"
},
"dependencies": {
"@types/node": "22.16.0",
"@types/node": "22.17.2",
"ci-log": "workspace:*",
"envosman": "workspace:*",
"which": "4.0.0",

View File

@ -48,7 +48,7 @@ importers:
version: 2.2.5
'@liuli-util/vite-plugin-node':
specifier: ^0.10.0
version: 0.10.0(@types/node@22.16.0)(rollup@4.44.2)(typescript@5.8.3)(vite@6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))
version: 0.10.0(@types/node@22.17.2)(rollup@4.44.2)(typescript@5.8.3)(vite@6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))
'@octokit/core':
specifier: ^7.0.0
version: 7.0.2
@ -102,7 +102,7 @@ importers:
version: 0.4.12
'@types/node':
specifier: ^22.13.8
version: 22.16.0
version: 22.17.2
'@types/semver':
specifier: ^7.5.8
version: 7.7.0
@ -174,7 +174,7 @@ importers:
version: 1.5.0
jest:
specifier: ^29.7.0
version: 29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3))
version: 29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3))
lefthook:
specifier: ^1.11.2
version: 1.11.16
@ -256,12 +256,6 @@ importers:
simple-update-notifier:
specifier: ^2.0.0
version: 2.0.0
terser:
specifier: ^5.39.0
version: 5.43.1
terser-config-atomic:
specifier: ^1.0.0
version: 1.0.0
time-delta:
specifier: github:aminya/time-delta#69d91a4
version: https://codeload.github.com/aminya/time-delta/tar.gz/69d91a4
@ -270,7 +264,7 @@ importers:
version: 2.0.12
ts-node:
specifier: ^10.9.2
version: 10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3)
version: 10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3)
ts-readme:
specifier: ^1.1.3
version: 1.1.3(typescript@5.8.3)
@ -294,10 +288,10 @@ importers:
version: 0.0.2
vite:
specifier: ^6.2.0
version: 6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
version: 6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
vite-plugin-babel:
specifier: ^1.3.0
version: 1.3.2(@babel/core@7.28.0)(vite@6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))
version: 1.3.2(@babel/core@7.28.0)(vite@6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))
web-streams-polyfill:
specifier: ^4.1.0
version: 4.1.0
@ -320,8 +314,8 @@ importers:
specifier: ^1.10.1
version: 1.11.1
'@types/node':
specifier: 22.16.0
version: 22.16.0
specifier: 22.17.2
version: 22.17.2
admina:
specifier: ^1.0.1
version: 1.0.1
@ -361,7 +355,7 @@ importers:
dependencies:
'@types/node':
specifier: ^22.0.0
version: 22.16.0
version: 22.17.2
execa:
specifier: 7.2.0
version: 7.2.0
@ -376,8 +370,8 @@ importers:
packages/setup-alpine:
dependencies:
'@types/node':
specifier: 22.16.0
version: 22.16.0
specifier: 22.17.2
version: 22.17.2
admina:
specifier: ^1.0.1
version: 1.0.1
@ -410,8 +404,8 @@ importers:
packages/setup-apt:
dependencies:
'@types/node':
specifier: 22.16.0
version: 22.16.0
specifier: 22.17.2
version: 22.17.2
admina:
specifier: ^1.0.1
version: 1.0.1
@ -459,8 +453,8 @@ importers:
packages/setup-brew:
dependencies:
'@types/node':
specifier: 22.16.0
version: 22.16.0
specifier: 22.17.2
version: 22.17.2
ci-log:
specifier: workspace:*
version: link:../ci-log
@ -1606,12 +1600,15 @@ packages:
'@jridgewell/gen-mapping@0.3.12':
resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==}
'@jridgewell/gen-mapping@0.3.13':
resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==}
'@jridgewell/resolve-uri@3.1.2':
resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
engines: {node: '>=6.0.0'}
'@jridgewell/source-map@0.3.10':
resolution: {integrity: sha512-0pPkgz9dY+bijgistcTTJ5mR+ocqRXLuhXHYdzoMmmoJ2C9S46RCm2GMUbatPEUK9Yjy26IrAy8D/M00lLkv+Q==}
'@jridgewell/source-map@0.3.11':
resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==}
'@jridgewell/sourcemap-codec@1.5.0':
resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==}
@ -1619,9 +1616,15 @@ packages:
'@jridgewell/sourcemap-codec@1.5.4':
resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==}
'@jridgewell/sourcemap-codec@1.5.5':
resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}
'@jridgewell/trace-mapping@0.3.29':
resolution: {integrity: sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==}
'@jridgewell/trace-mapping@0.3.30':
resolution: {integrity: sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==}
'@jridgewell/trace-mapping@0.3.9':
resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
@ -2085,8 +2088,8 @@ packages:
peerDependencies:
'@swc/core': '*'
'@swc/types@0.1.23':
resolution: {integrity: sha512-u1iIVZV9Q0jxY+yM2vw/hZGDNudsN85bBpTqzAQ9rzkxW9D+e3aEM4Han+ow518gSewkXgjmEK0BD79ZcNVgPw==}
'@swc/types@0.1.24':
resolution: {integrity: sha512-tjTMh3V4vAORHtdTprLlfoMptu1WfTZG9Rsca6yOKyNYsRr+MUXutKmliB17orgSZk5DpnDxs8GUdd/qwYxOng==}
'@szmarczak/http-timer@5.0.1':
resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==}
@ -2195,11 +2198,11 @@ packages:
'@types/ms@2.1.0':
resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==}
'@types/node@18.19.115':
resolution: {integrity: sha512-kNrFiTgG4a9JAn1LMQeLOv3MvXIPokzXziohMrMsvpYgLpdEt/mMiVYc4sGKtDfyxM5gIDF4VgrPRyCw4fHOYg==}
'@types/node@18.19.123':
resolution: {integrity: sha512-K7DIaHnh0mzVxreCR9qwgNxp3MH9dltPNIEddW9MYUlcKAzm+3grKNSTe2vCJHI1FaLpvpL5JGJrz1UZDKYvDg==}
'@types/node@22.16.0':
resolution: {integrity: sha512-B2egV9wALML1JCpv3VQoQ+yesQKAmNMBIAY7OteVrikcOcAkWm+dGL6qpeCktPjAv6N1JLnhbNiqS35UpFyBsQ==}
'@types/node@22.17.2':
resolution: {integrity: sha512-gL6z5N9Jm9mhY+U2KXZpteb+09zyffliRkZyZOHODGATyC5B1Jt/7TzuuiLkFsSUMLbS1OLmlj/E+/3KF4Q/4w==}
'@types/normalize-package-data@2.4.4':
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
@ -5825,9 +5828,6 @@ packages:
resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==}
engines: {node: '>=8'}
terser-config-atomic@1.0.0:
resolution: {integrity: sha512-WlhyFd4+honI08iaMxLg5P1eSg7RknCHzMI+AOwTNtMWkflGRrLHb7enbYmtpirUi05Tdun9wi/TNinNj4mrSg==}
terser@5.43.1:
resolution: {integrity: sha512-+6erLbBm0+LROX2sPXlUYx/ux5PyE9K/a92Wrt6oA+WDAoFTdpHE5tCYCI5PNzq2y8df4rA+QgHLJuR4jNymsg==}
engines: {node: '>=10'}
@ -7331,27 +7331,27 @@ snapshots:
'@jest/console@29.7.0':
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
chalk: 4.1.2
jest-message-util: 29.7.0
jest-util: 29.7.0
slash: 3.0.0
'@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3))':
'@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3))':
dependencies:
'@jest/console': 29.7.0
'@jest/reporters': 29.7.0
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 3.9.0
exit: 0.1.2
graceful-fs: 4.2.11
jest-changed-files: 29.7.0
jest-config: 29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3))
jest-config: 29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3))
jest-haste-map: 29.7.0
jest-message-util: 29.7.0
jest-regex-util: 29.6.3
@ -7380,7 +7380,7 @@ snapshots:
dependencies:
'@jest/fake-timers': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
jest-mock: 29.7.0
'@jest/expect-utils@29.7.0':
@ -7398,7 +7398,7 @@ snapshots:
dependencies:
'@jest/types': 29.6.3
'@sinonjs/fake-timers': 10.3.0
'@types/node': 22.16.0
'@types/node': 22.17.2
jest-message-util: 29.7.0
jest-mock: 29.7.0
jest-util: 29.7.0
@ -7420,7 +7420,7 @@ snapshots:
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@jridgewell/trace-mapping': 0.3.29
'@types/node': 22.16.0
'@types/node': 22.17.2
chalk: 4.1.2
collect-v8-coverage: 1.0.2
exit: 0.1.2
@ -7490,7 +7490,7 @@ snapshots:
'@jest/schemas': 29.6.3
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
'@types/node': 22.16.0
'@types/node': 22.17.2
'@types/yargs': 17.0.33
chalk: 4.1.2
@ -7499,58 +7499,74 @@ snapshots:
'@jridgewell/sourcemap-codec': 1.5.4
'@jridgewell/trace-mapping': 0.3.29
'@jridgewell/gen-mapping@0.3.13':
dependencies:
'@jridgewell/sourcemap-codec': 1.5.5
'@jridgewell/trace-mapping': 0.3.30
optional: true
'@jridgewell/resolve-uri@3.1.2': {}
'@jridgewell/source-map@0.3.10':
'@jridgewell/source-map@0.3.11':
dependencies:
'@jridgewell/gen-mapping': 0.3.12
'@jridgewell/trace-mapping': 0.3.29
'@jridgewell/gen-mapping': 0.3.13
'@jridgewell/trace-mapping': 0.3.30
optional: true
'@jridgewell/sourcemap-codec@1.5.0': {}
'@jridgewell/sourcemap-codec@1.5.4': {}
'@jridgewell/sourcemap-codec@1.5.5':
optional: true
'@jridgewell/trace-mapping@0.3.29':
dependencies:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.4
'@jridgewell/trace-mapping@0.3.30':
dependencies:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.5
optional: true
'@jridgewell/trace-mapping@0.3.9':
dependencies:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.0
'@liuli-util/vite-plugin-node@0.10.0(@types/node@22.16.0)(rollup@4.44.2)(typescript@5.8.3)(vite@6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))':
'@liuli-util/vite-plugin-node@0.10.0(@types/node@22.17.2)(rollup@4.44.2)(typescript@5.8.3)(vite@6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))':
dependencies:
'@microsoft/api-extractor': 7.51.1(@types/node@22.16.0)
'@microsoft/api-extractor': 7.51.1(@types/node@22.17.2)
magic-string: 0.30.17
pathe: 2.0.3
rollup-plugin-node-externals: 8.0.0(rollup@4.44.2)
vite: 6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
vite-plugin-dts: 4.5.4(@types/node@22.16.0)(rollup@4.44.2)(typescript@5.8.3)(vite@6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))
vite: 6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
vite-plugin-dts: 4.5.4(@types/node@22.17.2)(rollup@4.44.2)(typescript@5.8.3)(vite@6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0))
transitivePeerDependencies:
- '@types/node'
- rollup
- supports-color
- typescript
'@microsoft/api-extractor-model@7.30.3(@types/node@22.16.0)':
'@microsoft/api-extractor-model@7.30.3(@types/node@22.17.2)':
dependencies:
'@microsoft/tsdoc': 0.15.1
'@microsoft/tsdoc-config': 0.17.1
'@rushstack/node-core-library': 5.11.0(@types/node@22.16.0)
'@rushstack/node-core-library': 5.11.0(@types/node@22.17.2)
transitivePeerDependencies:
- '@types/node'
'@microsoft/api-extractor@7.51.1(@types/node@22.16.0)':
'@microsoft/api-extractor@7.51.1(@types/node@22.17.2)':
dependencies:
'@microsoft/api-extractor-model': 7.30.3(@types/node@22.16.0)
'@microsoft/api-extractor-model': 7.30.3(@types/node@22.17.2)
'@microsoft/tsdoc': 0.15.1
'@microsoft/tsdoc-config': 0.17.1
'@rushstack/node-core-library': 5.11.0(@types/node@22.16.0)
'@rushstack/node-core-library': 5.11.0(@types/node@22.17.2)
'@rushstack/rig-package': 0.5.3
'@rushstack/terminal': 0.15.0(@types/node@22.16.0)
'@rushstack/ts-command-line': 4.23.5(@types/node@22.16.0)
'@rushstack/terminal': 0.15.0(@types/node@22.17.2)
'@rushstack/ts-command-line': 4.23.5(@types/node@22.17.2)
lodash: 4.17.21
minimatch: 3.0.8
resolve: 1.22.10
@ -7808,7 +7824,7 @@ snapshots:
'@rtsao/scc@1.1.0': {}
'@rushstack/node-core-library@5.11.0(@types/node@22.16.0)':
'@rushstack/node-core-library@5.11.0(@types/node@22.17.2)':
dependencies:
ajv: 8.13.0
ajv-draft-04: 1.0.0(ajv@8.13.0)
@ -7819,23 +7835,23 @@ snapshots:
resolve: 1.22.10
semver: 7.5.4
optionalDependencies:
'@types/node': 22.16.0
'@types/node': 22.17.2
'@rushstack/rig-package@0.5.3':
dependencies:
resolve: 1.22.10
strip-json-comments: 3.1.1
'@rushstack/terminal@0.15.0(@types/node@22.16.0)':
'@rushstack/terminal@0.15.0(@types/node@22.17.2)':
dependencies:
'@rushstack/node-core-library': 5.11.0(@types/node@22.16.0)
'@rushstack/node-core-library': 5.11.0(@types/node@22.17.2)
supports-color: 8.1.1
optionalDependencies:
'@types/node': 22.16.0
'@types/node': 22.17.2
'@rushstack/ts-command-line@4.23.5(@types/node@22.16.0)':
'@rushstack/ts-command-line@4.23.5(@types/node@22.17.2)':
dependencies:
'@rushstack/terminal': 0.15.0(@types/node@22.16.0)
'@rushstack/terminal': 0.15.0(@types/node@22.17.2)
'@types/argparse': 1.0.38
argparse: 1.0.10
string-argv: 0.3.2
@ -7917,7 +7933,7 @@ snapshots:
'@swc/core@1.7.23(@swc/helpers@0.5.13)':
dependencies:
'@swc/counter': 0.1.3
'@swc/types': 0.1.23
'@swc/types': 0.1.24
optionalDependencies:
'@swc/core-darwin-arm64': 1.7.23
'@swc/core-darwin-x64': 1.7.23
@ -7945,7 +7961,7 @@ snapshots:
'@swc/counter': 0.1.3
jsonc-parser: 3.3.1
'@swc/types@0.1.23':
'@swc/types@0.1.24':
dependencies:
'@swc/counter': 0.1.3
@ -7992,7 +8008,7 @@ snapshots:
'@types/cross-spawn@6.0.6':
dependencies:
'@types/node': 22.16.0
'@types/node': 22.17.2
'@types/debug@4.1.12':
dependencies:
@ -8012,22 +8028,22 @@ snapshots:
'@types/fs-extra@11.0.4':
dependencies:
'@types/jsonfile': 6.1.4
'@types/node': 22.16.0
'@types/node': 22.17.2
'@types/glob@7.2.0':
dependencies:
'@types/minimatch': 6.0.0
'@types/node': 22.16.0
'@types/node': 22.17.2
'@types/graceful-fs@4.1.9':
dependencies:
'@types/node': 22.16.0
'@types/node': 22.17.2
'@types/http-cache-semantics@4.0.4': {}
'@types/iarna__toml@2.0.5':
dependencies:
'@types/node': 22.16.0
'@types/node': 22.17.2
'@types/istanbul-lib-coverage@2.0.6': {}
@ -8050,7 +8066,7 @@ snapshots:
'@types/jsonfile@6.1.4':
dependencies:
'@types/node': 22.16.0
'@types/node': 22.17.2
'@types/mdast@4.0.4':
dependencies:
@ -8064,12 +8080,12 @@ snapshots:
'@types/ms@2.1.0': {}
'@types/node@18.19.115':
'@types/node@18.19.123':
dependencies:
undici-types: 5.26.5
optional: true
'@types/node@22.16.0':
'@types/node@22.17.2':
dependencies:
undici-types: 6.21.0
@ -8980,7 +8996,8 @@ snapshots:
commander@14.0.0: {}
commander@2.20.3: {}
commander@2.20.3:
optional: true
commander@6.2.1: {}
@ -9038,13 +9055,13 @@ snapshots:
crc-32: 1.2.2
readable-stream: 3.6.2
create-jest@29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3)):
create-jest@29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3)):
dependencies:
'@jest/types': 29.6.3
chalk: 4.1.2
exit: 0.1.2
graceful-fs: 4.2.11
jest-config: 29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3))
jest-config: 29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3))
jest-util: 29.7.0
prompts: 2.4.2
transitivePeerDependencies:
@ -10767,7 +10784,7 @@ snapshots:
'@jest/expect': 29.7.0
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
chalk: 4.1.2
co: 4.6.0
dedent: 1.5.3
@ -10787,16 +10804,16 @@ snapshots:
- babel-plugin-macros
- supports-color
jest-cli@29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3)):
jest-cli@29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3)):
dependencies:
'@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3))
'@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3))
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
chalk: 4.1.2
create-jest: 29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3))
create-jest: 29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3))
exit: 0.1.2
import-local: 3.2.0
jest-config: 29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3))
jest-config: 29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3))
jest-util: 29.7.0
jest-validate: 29.7.0
yargs: 17.7.2
@ -10806,7 +10823,7 @@ snapshots:
- supports-color
- ts-node
jest-config@29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3)):
jest-config@29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3)):
dependencies:
'@babel/core': 7.28.0
'@jest/test-sequencer': 29.7.0
@ -10831,8 +10848,8 @@ snapshots:
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 22.16.0
ts-node: 10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3)
'@types/node': 22.17.2
ts-node: 10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
@ -10861,7 +10878,7 @@ snapshots:
'@jest/environment': 29.7.0
'@jest/fake-timers': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
jest-mock: 29.7.0
jest-util: 29.7.0
@ -10871,7 +10888,7 @@ snapshots:
dependencies:
'@jest/types': 29.6.3
'@types/graceful-fs': 4.1.9
'@types/node': 22.16.0
'@types/node': 22.17.2
anymatch: 3.1.3
fb-watchman: 2.0.2
graceful-fs: 4.2.11
@ -10910,7 +10927,7 @@ snapshots:
jest-mock@29.7.0:
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
jest-util: 29.7.0
jest-pnp-resolver@1.2.3(jest-resolve@29.7.0):
@ -10945,7 +10962,7 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
chalk: 4.1.2
emittery: 0.13.1
graceful-fs: 4.2.11
@ -10973,7 +10990,7 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
chalk: 4.1.2
cjs-module-lexer: 1.4.3
collect-v8-coverage: 1.0.2
@ -11019,7 +11036,7 @@ snapshots:
jest-util@29.7.0:
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
chalk: 4.1.2
ci-info: 3.9.0
graceful-fs: 4.2.11
@ -11038,7 +11055,7 @@ snapshots:
dependencies:
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.16.0
'@types/node': 22.17.2
ansi-escapes: 4.3.2
chalk: 4.1.2
emittery: 0.13.1
@ -11047,17 +11064,17 @@ snapshots:
jest-worker@29.7.0:
dependencies:
'@types/node': 22.16.0
'@types/node': 22.17.2
jest-util: 29.7.0
merge-stream: 2.0.0
supports-color: 8.1.1
jest@29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3)):
jest@29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3)):
dependencies:
'@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3))
'@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3))
'@jest/types': 29.6.3
import-local: 3.2.0
jest-cli: 29.7.0(@types/node@22.16.0)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3))
jest-cli: 29.7.0(@types/node@22.17.2)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3))
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
@ -11796,7 +11813,7 @@ snapshots:
escape-string-regexp: 5.0.0
replace-ext: 2.0.0
optionalDependencies:
'@types/node': 18.19.115
'@types/node': 18.19.123
'@types/replace-ext': 2.0.2
path-browserify: 1.0.1
process: 0.11.10
@ -12334,6 +12351,7 @@ snapshots:
dependencies:
buffer-from: 1.1.2
source-map: 0.6.1
optional: true
source-map@0.6.1: {}
@ -12529,14 +12547,13 @@ snapshots:
term-size@2.2.1: {}
terser-config-atomic@1.0.0: {}
terser@5.43.1:
dependencies:
'@jridgewell/source-map': 0.3.10
'@jridgewell/source-map': 0.3.11
acorn: 8.15.0
commander: 2.20.3
source-map-support: 0.5.21
optional: true
test-exclude@6.0.0:
dependencies:
@ -12612,14 +12629,14 @@ snapshots:
dependencies:
typescript: 5.8.3
ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.16.0)(typescript@5.8.3):
ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.17.2)(typescript@5.8.3):
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.11
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.4
'@types/node': 22.16.0
'@types/node': 22.17.2
acorn: 8.14.1
acorn-walk: 8.3.4
arg: 4.1.3
@ -12845,14 +12862,14 @@ snapshots:
spdx-correct: 3.2.0
spdx-expression-parse: 3.0.1
vite-plugin-babel@1.3.2(@babel/core@7.28.0)(vite@6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)):
vite-plugin-babel@1.3.2(@babel/core@7.28.0)(vite@6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)):
dependencies:
'@babel/core': 7.28.0
vite: 6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
vite: 6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
vite-plugin-dts@4.5.4(@types/node@22.16.0)(rollup@4.44.2)(typescript@5.8.3)(vite@6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)):
vite-plugin-dts@4.5.4(@types/node@22.17.2)(rollup@4.44.2)(typescript@5.8.3)(vite@6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)):
dependencies:
'@microsoft/api-extractor': 7.51.1(@types/node@22.16.0)
'@microsoft/api-extractor': 7.51.1(@types/node@22.17.2)
'@rollup/pluginutils': 5.1.4(rollup@4.44.2)
'@volar/typescript': 2.4.14
'@vue/language-core': 2.2.0(typescript@5.8.3)
@ -12863,13 +12880,13 @@ snapshots:
magic-string: 0.30.17
typescript: 5.8.3
optionalDependencies:
vite: 6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
vite: 6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0)
transitivePeerDependencies:
- '@types/node'
- rollup
- supports-color
vite@6.3.5(@types/node@22.16.0)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0):
vite@6.3.5(@types/node@22.17.2)(lightningcss@1.26.0)(terser@5.43.1)(tsx@4.20.3)(yaml@2.8.0):
dependencies:
esbuild: 0.25.4
fdir: 6.4.4(picomatch@4.0.2)
@ -12878,7 +12895,7 @@ snapshots:
rollup: 4.44.2
tinyglobby: 0.2.13
optionalDependencies:
'@types/node': 22.16.0
'@types/node': 22.17.2
fsevents: 2.3.3
lightningcss: 1.26.0
terser: 5.43.1

11
src/actions-input.ts Normal file
View File

@ -0,0 +1,11 @@
import { getInput } from "@actions/core"
/** Get an object from github actions */
export function maybeGetInput(key: string) {
const value = getInput(key.toLowerCase())
if (value !== "false" && value !== "") {
return value
}
return undefined // skip installation
}

View File

@ -11,7 +11,7 @@ describe("setup-bazel", () => {
return
}
it("should setup bazel", async () => {
const installInfo = await setupBazel("", "", process.arch)
const installInfo = await setupBazel()
await testBin("bazel", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
})

View File

@ -2,14 +2,14 @@ import { execRoot } from "admina"
import { hasApk, installApkPack } from "setup-alpine"
import { addAptKeyViaURL, hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import type { SetupOptions } from "../setup-options.js"
import { getDebArch } from "../utils/env/arch.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupBazel(version: string, _setupDir: string, _arch: string) {
export async function setupBazel({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
switch (process.platform) {
case "win32": {
// install bazelisk because it contains both

View File

@ -5,7 +5,7 @@ import { setupCcache } from "../ccache.js"
jest.setTimeout(300000)
describe("setup-ccache", () => {
it("should setup ccache", async () => {
const installInfo = await setupCcache("", "", process.arch)
const installInfo = await setupCcache()
await testBin("ccache", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
})

View File

@ -1,14 +1,14 @@
import { hasApk, installApkPack } from "setup-alpine"
import { hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import type { SetupOptions } from "../setup-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupCcache(version: string, _setupDir: string, _arch: string) {
export async function setupCcache({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
switch (process.platform) {
case "win32": {
return setupChocoPack("ccache", version)

View File

@ -9,7 +9,7 @@ describe("setup-chocolatey", () => {
return
}
it("should setup chocolatey", async () => {
const { binDir } = (await setupChocolatey("", "", process.arch)) as InstallationInfo
const { binDir } = (await setupChocolatey({ version: "", setupDir: "", arch: process.arch })) as InstallationInfo
await testBin("choco", ["--version"], binDir)
})
})

View File

@ -4,19 +4,13 @@ import { execaSync } from "execa"
import { pathExists } from "path-exists"
import which from "which"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import type { InstallationInfo } from "../utils/setup/setupBin.js"
/* eslint-disable require-atomic-updates */
let binDir: string | undefined
export async function setupChocolatey(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_version: string,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_setupDir: string,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_arch: string,
): Promise<InstallationInfo | undefined> {
export async function setupChocolatey(_opts?: SetupOptions): Promise<InstallationInfo | undefined> {
if (process.platform !== "win32") {
return undefined
}

View File

@ -14,12 +14,20 @@ describe("setup-cmake", () => {
})
it("should setup CMake", async () => {
const { binDir } = await setupCmake(getVersion("cmake", "true"), directory, process.arch)
const { binDir } = await setupCmake({
version: getVersion("cmake", "true"),
setupDir: directory,
arch: process.arch,
})
await testBin("cmake", ["--version"], binDir)
})
it("should find CMake in the cache", async () => {
const { binDir } = await setupCmake(getVersion("cmake", "true"), directory, process.arch)
const { binDir } = await setupCmake({
version: getVersion("cmake", "true"),
setupDir: directory,
arch: process.arch,
})
await testBin("cmake", ["--version"], binDir)
if (GITHUB_ACTIONS) {
expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache")

View File

@ -2,6 +2,7 @@ import { info } from "ci-log"
import { addExeExt } from "patha"
import semverLte from "semver/functions/lte"
import { hasApk, installApkPack } from "setup-alpine"
import type { SetupOptions } from "../setup-options.js"
import { arm64, x86, x86_64 } from "../utils/env/arch.js"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
import { semverCoerceIfInvalid } from "../utils/setup/version.js"
@ -67,7 +68,7 @@ function getCmakePackageInfo(version: string, platform: NodeJS.Platform, arch: s
}
/** Setup cmake */
export async function setupCmake(version: string, setupDir: string, arch: string): Promise<InstallationInfo> {
export async function setupCmake({ version, setupDir, arch }: SetupOptions): Promise<InstallationInfo> {
if (await hasApk()) {
return installApkPack([
{

View File

@ -6,7 +6,9 @@ import { setupCmakelang } from "../cmakelang.js"
jest.setTimeout(300000)
describe("setup-cmakelang", () => {
it("should setup cmakelang", async () => {
const installInfo = await setupCmakelang(getVersion("cmakelang", "true", await ubuntuVersion()), "", process.arch)
const installInfo = await setupCmakelang({
version: getVersion("cmakelang", "true", await ubuntuVersion()),
})
await testBin("cmake-lint", ["--version"], installInfo.binDir)
await testBin("cmake-format", ["--version"], installInfo.binDir)
})

View File

@ -1,6 +1,6 @@
import type { SetupOptions } from "../setup-options.js"
import { setupPipPack } from "../utils/setup/setupPipPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupCmakelang(version: string | undefined, _setupDir: string, _arch: string) {
export function setupCmakelang({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
return setupPipPack("cmakelang[YAML]", version)
}

View File

@ -5,10 +5,10 @@ import semverValid from "semver/functions/valid"
import { setupGcc } from "./gcc/gcc.js"
import { setupMingw } from "./gcc/mingw.js"
import { activateGcovGCC, activateGcovLLVM } from "./gcovr/gcovr.js"
import { getSuccessMessage } from "./installTool.js"
import { setupAppleClang } from "./llvm/apple-clang.js"
import { setupLLVM } from "./llvm/llvm.js"
import { setupMSVC } from "./msvc/msvc.js"
import { getSuccessMessage } from "./options.js"
import { appleClangSetups, gccSetups, llvmSetups, mingwSetups, msvcSetups } from "./tool.js"
import type { InstallationInfo } from "./utils/setup/setupBin.js"
import { getVersion } from "./versions/versions.js"
@ -74,26 +74,26 @@ export async function installCompiler(
// install the compiler. We allow some aliases for the compiler name
startGroup(`Installing ${compiler} ${version ?? ""}`)
if (compiler in llvmSetups) {
installationInfo = await setupLLVM(
getVersion("llvm", version, osVersion),
join(setupCppDir, "llvm"),
installationInfo = await setupLLVM({
version: getVersion("llvm", version, osVersion),
setupDir: join(setupCppDir, "llvm"),
arch,
)
})
await activateGcovLLVM()
} else if (compiler in gccSetups) {
const gccVersion = getVersion("gcc", version, osVersion)
installationInfo = await setupGcc(gccVersion, join(setupCppDir, "gcc"), arch)
installationInfo = await setupGcc({ version: gccVersion, setupDir: join(setupCppDir, "gcc"), arch })
await activateGcovGCC(gccVersion)
} else if (compiler in mingwSetups) {
const gccVersion = getVersion("mingw", version, osVersion)
installationInfo = await setupMingw(gccVersion, join(setupCppDir, "gcc"), arch)
installationInfo = await setupMingw({ version: gccVersion, setupDir: join(setupCppDir, "gcc"), arch })
await activateGcovGCC(gccVersion)
} else if (compiler in msvcSetups) {
installationInfo = await setupMSVC(
getVersion("msvc", version, osVersion),
join(setupCppDir, "msvc"),
installationInfo = await setupMSVC({
version: getVersion("msvc", version, osVersion),
setupDir: join(setupCppDir, "msvc"),
arch,
)
})
} else if (compiler in appleClangSetups) {
await setupAppleClang()
} else {

View File

@ -5,7 +5,7 @@ import { setupConan } from "../conan.js"
jest.setTimeout(300000)
describe("setup-conan", () => {
it("should setup conan", async () => {
const installInfo = await setupConan(getVersion("conan", "true"), "", process.arch)
const installInfo = await setupConan({ version: getVersion("conan", "true") })
await testBin("conan", ["--version"], installInfo.binDir)
})

View File

@ -1,6 +1,6 @@
import type { SetupOptions } from "../setup-options.js"
import { setupPipPack } from "../utils/setup/setupPipPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupConan(version: string | undefined, _setupDir: string, _arch: string) {
export function setupConan({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
return setupPipPack("conan", version)
}

View File

@ -7,7 +7,9 @@ describe("setup-cppcheck", () => {
it("should setup cppcheck", async () => {
// TODO: choco fails abnormally on windows
if (process.platform !== "win32") {
const installInfo = await setupCppcheck(getVersion("cppcheck", undefined), "", process.arch)
const installInfo = await setupCppcheck({
version: getVersion("cppcheck", undefined),
})
await testBin("cppcheck", ["--version"], installInfo.binDir)
}

View File

@ -3,14 +3,14 @@ import { hasApk, installApkPack } from "setup-alpine"
import { hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupCppcheck(version: string | undefined, _setupDir: string, _arch: string) {
export async function setupCppcheck({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
switch (process.platform) {
case "win32": {
await setupChocoPack("cppcheck", version)

View File

@ -6,7 +6,9 @@ import { setupCpplint } from "../cpplint.js"
jest.setTimeout(300000)
describe("setup-cpplint", () => {
it("should setup cpplint", async () => {
const installInfo = await setupCpplint(getVersion("cpplint", "true", await ubuntuVersion()), "", process.arch)
const installInfo = await setupCpplint({
version: getVersion("cpplint", "true", await ubuntuVersion()),
})
await testBin("cpplint", ["--version"], installInfo.binDir)
})
})

View File

@ -1,7 +1,7 @@
import type { SetupOptions } from "../setup-options.js"
import { setupPipPack } from "../utils/setup/setupPipPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupCpplint(version: string | undefined, _setupDir: string, _arch: string) {
export function setupCpplint({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
return setupPipPack("cpplint", version, {
pythonVersion: ">=3.8.0",
})

View File

@ -19,11 +19,11 @@ describe("setup-doxygen", () => {
})
it("should setup doxygen and dot", async () => {
const installInfo = await setupDoxygen(
getVersion("doxygen", undefined, await ubuntuVersion()),
directory,
process.arch,
)
const installInfo = await setupDoxygen({
version: getVersion("doxygen", undefined, await ubuntuVersion()),
setupDir: directory,
arch: process.arch,
})
await testBin("doxygen", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)

View File

@ -9,6 +9,7 @@ import { hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import { setupGraphviz } from "../graphviz/graphviz.js"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import { arm64 } from "../utils/env/arch.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
@ -22,7 +23,7 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
import { getVersion } from "../versions/versions.js"
/** Get the platform data for cmake */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch: string): PackageInfo {
switch (platform) {
case "linux": {
@ -61,7 +62,7 @@ function getDoxygenPackageInfo(version: string, platform: NodeJS.Platform, _arch
}
}
export async function setupDoxygen(version: string, setupDir: string, arch: string) {
export async function setupDoxygen({ version, setupDir, arch }: SetupOptions) {
switch (process.platform) {
case "win32": {
// try to download the package 4 times with 2 seconds delay
@ -73,7 +74,7 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
)
const binDir = await activateWinDoxygen()
const installationInfo = { binDir }
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
await setupGraphviz({ version: getVersion("graphviz", undefined) })
return installationInfo
}
case "darwin": {
@ -88,13 +89,13 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
// only install graphviz if the macOS version is greater than 11
if (macosVersion()[0] > 11) {
await setupGraphviz(getVersion("graphviz", undefined), "", arch)
await setupGraphviz({ version: getVersion("graphviz", undefined) })
}
return installationInfo
}
case "linux": {
const installationInfo = await setupLinuxDoxygen(version, setupDir, arch)
await setupGraphviz(getVersion("graphviz", undefined, await ubuntuVersion()), "", arch)
const installationInfo = await setupLinuxDoxygen({ version, setupDir, arch })
await setupGraphviz({ version: getVersion("graphviz", undefined, await ubuntuVersion()) })
return installationInfo
}
default: {
@ -102,7 +103,7 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
}
}
}
async function setupLinuxDoxygen(version: string, setupDir: string, arch: string) {
async function setupLinuxDoxygen({ version, setupDir, arch }: SetupOptions) {
try {
if (isArch()) {
return await setupPacmanPack("doxygen", version)

View File

@ -6,7 +6,9 @@ import { setupFlawfinder } from "../flawfinder.js"
jest.setTimeout(300000)
describe("setup-flawfinder", () => {
it("should setup flawfinder", async () => {
const installInfo = await setupFlawfinder(getVersion("flawfinder", "true", await ubuntuVersion()), "", process.arch)
const installInfo = await setupFlawfinder({
version: getVersion("flawfinder", "true", await ubuntuVersion()),
})
await testBin("flawfinder", ["--version"], installInfo.binDir)
})
})

View File

@ -1,6 +1,6 @@
import type { SetupOptions } from "../setup-options.js"
import { setupPipPack } from "../utils/setup/setupPipPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupFlawfinder(version: string | undefined, _setupDir: string, _arch: string) {
export function setupFlawfinder({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
return setupPipPack("flawfinder", version)
}

View File

@ -21,7 +21,7 @@ describe("setup-gcc", () => {
it("should setup gcc", async () => {
const ubuntuVersionOutput = await ubuntuVersion()
const version = getVersion("gcc", undefined, ubuntuVersionOutput)
const installInfo = await setupGcc(version, directory, process.arch)
const installInfo = await setupGcc({ version, setupDir: directory, arch: process.arch })
let gpp = "g++"
if (hasAptGet()) {

View File

@ -15,6 +15,7 @@ import { addUpdateAlternativesToRc, hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk.js"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import type { InstallationInfo } from "../utils/setup/setupBin.js"
@ -26,11 +27,11 @@ import { setupMingw } from "./mingw.js"
export const dirname = typeof __dirname === "string" ? __dirname : path.dirname(fileURLToPath(import.meta.url))
export async function setupGcc(version: string, setupDir: string, arch: string, priority: number = 40) {
export async function setupGcc({ version, setupDir, arch, priority = 40 }: SetupOptions & { priority?: number }) {
let installationInfo: InstallationInfo | undefined
switch (process.platform) {
case "win32": {
installationInfo = await setupMingw(version, setupDir, arch)
installationInfo = await setupMingw({ version, setupDir, arch })
break
}
case "darwin": {

View File

@ -1,8 +1,48 @@
{
"15.2.0posix-13.0.0-ucrt-r3": [
"winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64ucrt-13.0.0-r3.7z",
"winlibs-i686-posix-dwarf-gcc-15.2.0-mingw-w64ucrt-13.0.0-r3.7z"
],
"15.2.0posix-13.0.0-ucrt-r2": [
"winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64ucrt-13.0.0-r2.7z",
"winlibs-i686-posix-dwarf-gcc-15.2.0-mingw-w64ucrt-13.0.0-r2.7z"
],
"15.2.0posix-13.0.0-ucrt-r1": [
"winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64ucrt-13.0.0-r1.7z",
"winlibs-i686-posix-dwarf-gcc-15.2.0-mingw-w64ucrt-13.0.0-r1.7z"
],
"15.2.0posix-13.0.0-msvcrt-r3": [
"winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64msvcrt-13.0.0-r3.7z",
"winlibs-i686-posix-dwarf-gcc-15.2.0-mingw-w64msvcrt-13.0.0-r3.7z"
],
"15.2.0posix-13.0.0-msvcrt-r2": [
"winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64msvcrt-13.0.0-r2.7z",
"winlibs-i686-posix-dwarf-gcc-15.2.0-mingw-w64msvcrt-13.0.0-r2.7z"
],
"15.2.0posix-13.0.0-msvcrt-r1": [
"winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64msvcrt-13.0.0-r1.7z",
"winlibs-i686-posix-dwarf-gcc-15.2.0-mingw-w64msvcrt-13.0.0-r1.7z"
],
"15.1.0posix-13.0.0-ucrt-r4": [
"winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64ucrt-13.0.0-r4.7z",
"winlibs-i686-posix-dwarf-gcc-15.1.0-mingw-w64ucrt-13.0.0-r4.7z"
],
"15.1.0posix-13.0.0-ucrt-r3": [
"winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64ucrt-13.0.0-r3.7z",
"winlibs-i686-posix-dwarf-gcc-15.1.0-mingw-w64ucrt-13.0.0-r3.7z"
],
"15.1.0posix-13.0.0-ucrt-r2": [
"winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64ucrt-13.0.0-r2.7z",
"winlibs-i686-posix-dwarf-gcc-15.1.0-mingw-w64ucrt-13.0.0-r2.7z"
],
"15.1.0posix-13.0.0-msvcrt-r4": [
"winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r4.7z",
"winlibs-i686-posix-dwarf-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r4.7z"
],
"15.1.0posix-13.0.0-msvcrt-r3": [
"winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r3.7z",
"winlibs-i686-posix-dwarf-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r3.7z"
],
"15.1.0posix-13.0.0-msvcrt-r2": [
"winlibs-x86_64-posix-seh-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r2.7z",
"winlibs-i686-posix-dwarf-gcc-15.1.0-mingw-w64msvcrt-13.0.0-r2.7z"

View File

@ -11,6 +11,7 @@ import semverSatisfies from "semver/functions/satisfies.js"
import { enableCommunityRepository, hasApk, installApkPack } from "setup-alpine"
import { hasAptGet, installAptPack } from "setup-apt"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import { loadAssetList, matchAsset } from "../utils/asset/load-assets.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
@ -23,7 +24,7 @@ import { addGccLoggingMatcher } from "./gccMatcher.js"
const dirname = typeof __dirname === "string" ? __dirname : path.dirname(fileURLToPath(import.meta.url))
export async function setupMingw(version: string, setupDir: string, arch: string) {
export async function setupMingw({ version, setupDir, arch }: SetupOptions) {
let installationInfo: InstallationInfo | undefined
switch (process.platform) {
case "win32": {

View File

@ -6,7 +6,9 @@ import { setupGcovr } from "../gcovr.js"
jest.setTimeout(300000)
describe("setup-gcovr", () => {
it("should setup gcovr", async () => {
const installInfo = await setupGcovr(getVersion("gcovr", "true", await ubuntuVersion()), "", process.arch)
const installInfo = await setupGcovr({
version: getVersion("gcovr", "true", await ubuntuVersion()),
})
await testBin("gcovr", ["--version"], installInfo.binDir)
})
})

View File

@ -3,10 +3,10 @@ import semverMajor from "semver/functions/major"
import semverValid from "semver/functions/valid"
import { hasAptGet, installAptPack } from "setup-apt"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import { setupPipPack } from "../utils/setup/setupPipPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupGcovr(version: string | undefined, _setupDir: string, _arch: string) {
export function setupGcovr({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
if (hasAptGet() && (version === undefined || version === "")) {
// use apt on Ubuntu/Debian if version is not specified
return installAptPack([{ name: "gcovr", version }])

View File

@ -5,7 +5,7 @@ import { setupGit } from "../git.js"
jest.setTimeout(300000)
describe("setup-git", () => {
it("should setup git", async () => {
const installInfo = await setupGit("", "", process.arch)
const installInfo = await setupGit()
await testBin("git", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
})

View File

@ -7,14 +7,14 @@ import { hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import which from "which"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupGit(version: string, _setupDir: string, _arch: string) {
export async function setupGit({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
const git = await which("git", { nothrow: true })
if (git !== null) {
info(`Git already installed at ${git}`)

View File

@ -1,7 +1,7 @@
import { macosVersion } from "../../utils/env/macos_version.js"
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
import type { InstallationInfo } from "../../utils/setup/setupBin.js"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { cleanupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"
import { setupGraphviz } from "../graphviz.js"
@ -12,17 +12,10 @@ describe("setup-graphviz", () => {
return
}
let directory: string
beforeAll(async () => {
directory = await setupTmpDir("graphviz")
})
it("should setup graphviz", async () => {
const installInfo = await setupGraphviz(
getVersion("graphviz", undefined, await ubuntuVersion()),
directory,
process.arch,
)
const installInfo = await setupGraphviz({
version: getVersion("graphviz", undefined, await ubuntuVersion()),
})
await testBin("dot", ["-V"], (installInfo as InstallationInfo | undefined)?.binDir)
})

View File

@ -3,6 +3,7 @@ import { hasApk, installApkPack } from "setup-alpine"
import { hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import type { InstallationInfo } from "../utils/setup/setupBin.js"
@ -10,8 +11,7 @@ import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupGraphviz(version: string, _setupDir: string, _arch: string) {
export async function setupGraphviz({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
switch (process.platform) {
case "win32": {
await setupChocoPack("graphviz", version)

View File

@ -28,7 +28,11 @@ describe("setup-infer", () => {
return
}
const { binDir } = await setupInfer(getVersion("infer", "true"), directory, process.arch)
const { binDir } = await setupInfer({
version: getVersion("infer", "true"),
setupDir: directory,
arch: process.arch,
})
await testBin("infer", ["--version"], binDir)
})

View File

@ -2,6 +2,7 @@ import path, { basename, join } from "path"
import { fileURLToPath } from "url"
import { info } from "ci-log"
import { addExeExt } from "patha"
import type { SetupOptions } from "../setup-options.js"
import { loadAssetList, matchAsset } from "../utils/asset/load-assets.js"
import { arm64, x86_64 } from "../utils/env/arch.js"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
@ -41,7 +42,7 @@ async function getInferPackageInfo(version: string, platform: NodeJS.Platform, a
}
/** Setup infer */
export function setupInfer(version: string, setupDir: string, arch: string): Promise<InstallationInfo> {
export function setupInfer({ version, setupDir, arch }: SetupOptions): Promise<InstallationInfo> {
return setupBin("infer", version, getInferPackageInfo, setupDir, arch)
}

View File

@ -2,7 +2,7 @@ import { join } from "path"
import { endGroup, startGroup } from "@actions/core"
import { error } from "ci-log"
import { setupBrew } from "setup-brew"
import { getSuccessMessage, rcOptions } from "./options.js"
import { rcOptions } from "./options.js"
import { type ToolName, llvmTools, setups } from "./tool.js"
import type { InstallationInfo } from "./utils/setup/setupBin.js"
import { setupVCVarsall } from "./vcvarsall/vcvarsall.js"
@ -47,7 +47,7 @@ async function installToolImpl(
let installationInfo: InstallationInfo | undefined | void
if (tool === "vcvarsall") {
// eslint-disable-next-line no-await-in-loop
await setupVCVarsall(getVersion(tool, version, osVersion), undefined, arch, undefined, undefined, false, false)
await setupVCVarsall({ version: getVersion(tool, version, osVersion), arch, uwp: false, spectre: false })
} else if (tool === "brew") {
// eslint-disable no-await-in-loop
installationInfo = await setupBrew({ rcOptions })
@ -61,8 +61,22 @@ async function installToolImpl(
const setupFunction = setups[tool]
// eslint-disable no-await-in-loop
installationInfo = await setupFunction(setupVersion, setupDir, arch)
installationInfo = await setupFunction({ version: setupVersion, setupDir, arch })
}
// preparing a report string
successMessages.push(getSuccessMessage(tool, installationInfo))
}
export function getSuccessMessage(tool: string, installationInfo: InstallationInfo | undefined | void) {
let msg = `${tool} was installed successfully:`
if (installationInfo === undefined) {
return msg
}
if ("installDir" in installationInfo) {
msg += `\n- The installation directory is ${installationInfo.installDir}`
}
if (installationInfo.binDir !== "") {
msg += `\n- The binary directory is ${installationInfo.binDir}`
}
return msg
}

View File

@ -13,7 +13,7 @@ describe("setup-Kcov", () => {
it("should build and setup kcov-41", async () => {
const directory = await setupTmpDir("kcov-v41")
const { binDir } = (await setupKcov("41", directory, "")) as InstallationInfo
const { binDir } = (await setupKcov({ version: "41", setupDir: directory, arch: process.arch })) as InstallationInfo
// the prebuild binary only works on ubuntu 20.04
try {
await testBin("kcov", ["--version"], binDir)
@ -25,7 +25,8 @@ describe("setup-Kcov", () => {
it("should setup Kcov v40 via downloading the binaries", async () => {
const directory = await setupTmpDir("kcov-v40")
const { binDir } = (await setupKcov("40-binary", directory, "")) as InstallationInfo
const { binDir } =
(await setupKcov({ version: "40-binary", setupDir: directory, arch: process.arch })) as InstallationInfo
// the prebuild binary only works on ubuntu 20.04
try {
await testBin("kcov", ["--version"], binDir)
@ -37,7 +38,7 @@ describe("setup-Kcov", () => {
it("should build and setup Kcov v40", async () => {
const directory = await setupTmpDir("kcov-v40")
const { binDir } = (await setupKcov("40", directory, "")) as InstallationInfo
const { binDir } = (await setupKcov({ version: "40", setupDir: directory, arch: process.arch })) as InstallationInfo
await testBin("kcov", ["--version"], binDir)
await cleanupTmpDir("kcov-v40")
})
@ -46,7 +47,7 @@ describe("setup-Kcov", () => {
try {
const directory2 = await setupTmpDir("kcov-v38")
await setupKcov("38", directory2, "")
await setupKcov({ version: "38", setupDir: directory2, arch: process.arch })
expect(which.sync("kcov", { nothrow: true })).toBeTruthy()

View File

@ -8,6 +8,7 @@ import { untildifyUser } from "untildify-user"
import which from "which"
import { setupCmake } from "../cmake/cmake.js"
import { setupNinja } from "../ninja/ninja.js"
import type { SetupOptions } from "../setup-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { ubuntuVersion } from "../utils/env/ubuntu_version.js"
@ -29,21 +30,21 @@ function getDownloadKcovPackageInfo(version: string): PackageInfo {
}
}
function getBuildKcovPackageInfo(version: string): PackageInfo {
function getBuildKcovPackageInfo(version: string, _platform: NodeJS.Platform, arch: string): PackageInfo {
return {
url: `https://github.com/SimonKagstrom/kcov/archive/refs/tags/${version}.tar.gz`,
extractedFolderName: "",
binRelativeDir: "build/src",
binFileName: addExeExt("kcov"),
extractFunction: buildKcov,
extractFunction: (file, dest) => buildKcov(file, dest, arch),
}
}
async function buildKcov(file: string, dest: string) {
async function buildKcov(file: string, dest: string, arch: string) {
const out = await extractTarByExe(file, dest, 1)
// build after extraction using CMake
const cmake = await getCmake()
const cmake = await getCmake(arch)
if (process.platform === "linux") {
if (isArch()) {
@ -78,24 +79,28 @@ async function buildKcov(file: string, dest: string) {
return out
}
async function getCmake() {
async function getCmake(arch: string) {
let cmake = which.sync("cmake", { nothrow: true })
if (cmake === null) {
const { binDir } = await setupCmake(
getVersion("cmake", undefined, await ubuntuVersion()),
join(untildifyUser("~"), "cmake"),
"",
)
const { binDir } = await setupCmake({
version: getVersion("cmake", undefined, await ubuntuVersion()),
setupDir: join(untildifyUser("~"), "cmake"),
arch,
})
cmake = join(binDir, "cmake")
}
const ninja = which.sync("ninja", { nothrow: true })
if (ninja === null) {
await setupNinja(getVersion("ninja", undefined, await ubuntuVersion()), join(untildifyUser("~"), "ninja"), "")
await setupNinja({
version: getVersion("ninja", undefined, await ubuntuVersion()),
setupDir: join(untildifyUser("~"), "ninja"),
arch,
})
}
return cmake
}
export async function setupKcov(versionGiven: string, setupDir: string, arch: string) {
export async function setupKcov({ version: versionGiven, setupDir, arch }: SetupOptions) {
if (process.platform !== "linux") {
info("Kcov is not supported on non-linux")
return

View File

@ -20,7 +20,6 @@ import { syncVersions } from "./versions/versions.js"
// re-export for the setup-cpp CLI
export { GITHUB_ACTIONS } from "ci-info"
export * from "ci-log"
export { maybeGetInput, type Opts } from "./options.js"
export { type Inputs, inputs } from "./tool.js"
/**

View File

@ -6,7 +6,9 @@ import { setupLizard } from "../lizard.js"
jest.setTimeout(300000)
describe("setup-lizard", () => {
it("should setup lizard", async () => {
const installInfo = await setupLizard(getVersion("lizard", "true", await ubuntuVersion()), "", process.arch)
const installInfo = await setupLizard({
version: getVersion("lizard", "true", await ubuntuVersion()),
})
await testBin("lizard", ["--version"], installInfo.binDir)
})
})

View File

@ -1,6 +1,6 @@
import type { SetupOptions } from "../setup-options.js"
import { setupPipPack } from "../utils/setup/setupPipPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupLizard(version: string | undefined, _setupDir: string, _arch: string) {
export function setupLizard({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
return setupPipPack("lizard", version)
}

View File

@ -66,7 +66,11 @@ describe("setup-llvm", () => {
const osVersion = await ubuntuVersion()
{
const { binDir } = await setupLLVM(getVersion("llvm", "true", osVersion), directory, process.arch)
const { binDir } = await setupLLVM({
version: getVersion("llvm", "true", osVersion),
setupDir: directory,
arch: process.arch,
})
await testBin("clang++", ["--version"], binDir)
expect(process.env.CC?.includes("clang")).toBeTruthy()
@ -83,12 +87,20 @@ describe("setup-llvm", () => {
}
{
const { binDir } = await setupClangFormat(getVersion("llvm", "true", osVersion), directory, process.arch)
const { binDir } = await setupClangFormat({
version: getVersion("llvm", "true", osVersion),
setupDir: directory,
arch: process.arch,
})
await testBin("clang-format", ["--version"], binDir)
}
{
const { binDir } = await setupClangTools(getVersion("llvm", "true", osVersion), directory, process.arch)
const { binDir } = await setupClangTools({
version: getVersion("llvm", "true", osVersion),
setupDir: directory,
arch: process.arch,
})
await testBin("clang-tidy", ["--version"], binDir)
await testBin("clang-format", ["--version"], binDir)
}
@ -99,7 +111,7 @@ describe("setup-llvm", () => {
it("should setup LLVM 5 from llvm.org", async () => {
const directory = await setupTmpDir("llvm")
const { binDir } = await setupLLVM("5", directory, process.arch)
const { binDir } = await setupLLVM({ version: "5", setupDir: directory, arch: process.arch })
await testBin("clang++", ["--version"], binDir)
expect(process.env.CC?.includes("clang")).toBeTruthy()
@ -127,7 +139,7 @@ describe("setup-llvm", () => {
it(`should setup LLVM ${version} on Linux`, async () => {
const directory = await setupTmpDir("llvm")
const { binDir } = await setupLLVM(`${version}`, directory, process.arch)
const { binDir } = await setupLLVM({ version: `${version}`, setupDir: directory, arch: process.arch })
await testBin("clang++", ["--version"], binDir)
expect(process.env.CC?.includes("clang")).toBeTruthy()

View File

@ -1,6 +1,77 @@
{
"llvmorg-21.1.5": [
"clang+llvm-21.1.5-x86_64-pc-windows-msvc.tar.xz",
"LLVM-21.1.5-win64.exe",
"LLVM-21.1.5-win32.exe",
"LLVM-21.1.5-Linux-X64.tar.xz",
"LLVM-21.1.5-Linux-ARM64.tar.xz"
],
"llvmorg-21.1.4": [
"clang+llvm-21.1.4-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-21.1.4-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-21.1.4-aarch64-pc-windows-msvc.tar.xz",
"LLVM-21.1.4-woa64.exe",
"LLVM-21.1.4-win64.exe",
"LLVM-21.1.4-win32.exe",
"LLVM-21.1.4-Linux-X64.tar.xz",
"LLVM-21.1.4-Linux-ARM64.tar.xz"
],
"llvmorg-21.1.3": [
"clang+llvm-21.1.3-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-21.1.3-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-21.1.3-aarch64-pc-windows-msvc.tar.xz",
"LLVM-21.1.3-woa64.exe",
"LLVM-21.1.3-win64.exe",
"LLVM-21.1.3-win32.exe",
"LLVM-21.1.3-Linux-X64.tar.xz",
"LLVM-21.1.3-Linux-ARM64.tar.xz"
],
"llvmorg-21.1.2": [
"clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-21.1.2-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-21.1.2-aarch64-pc-windows-msvc.tar.xz",
"LLVM-21.1.2-woa64.exe",
"LLVM-21.1.2-win64.exe",
"LLVM-21.1.2-win32.exe",
"LLVM-21.1.2-Linux-X64.tar.xz",
"LLVM-21.1.2-Linux-ARM64.tar.xz"
],
"llvmorg-21.1.1": [
"clang+llvm-21.1.1-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-21.1.1-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-21.1.1-aarch64-pc-windows-msvc.tar.xz",
"LLVM-21.1.1-woa64.exe",
"LLVM-21.1.1-win64.exe",
"LLVM-21.1.1-win32.exe",
"LLVM-21.1.1-Linux-X64.tar.xz",
"LLVM-21.1.1-Linux-ARM64.tar.xz"
],
"llvmorg-21.1.0": [
"clang+llvm-21.1.0-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-21.1.0-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-21.1.0-aarch64-pc-windows-msvc.tar.xz",
"LLVM-21.1.0-woa64.exe",
"LLVM-21.1.0-win64.exe",
"LLVM-21.1.0-win32.exe",
"LLVM-21.1.0-Linux-X64.tar.xz",
"LLVM-21.1.0-Linux-ARM64.tar.xz"
],
"llvmorg-20.1.8": [
"clang+llvm-20.1.8-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-20.1.8-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-20.1.8-aarch64-pc-windows-msvc.tar.xz",
"LLVM-20.1.8-woa64.exe",
"LLVM-20.1.8-win64.exe",
"LLVM-20.1.8-win32.exe",
"LLVM-20.1.8-macOS-ARM64.tar.xz",
"LLVM-20.1.8-Linux-X64.tar.xz",
"LLVM-20.1.8-Linux-ARM64.tar.xz"
],
"llvmorg-20.1.7": [
"clang+llvm-20.1.7-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-20.1.7-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-20.1.7-aarch64-pc-windows-msvc.tar.xz",
"LLVM-20.1.7-woa64.exe",
"LLVM-20.1.7-win64.exe",
"LLVM-20.1.7-win32.exe",
"LLVM-20.1.7-macOS-X64.tar.xz",
@ -9,12 +80,9 @@
"LLVM-20.1.7-Linux-ARM64.tar.xz"
],
"llvmorg-20.1.6": [
"clang+llvm-20.1.7-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-20.1.7-aarch64-pc-windows-msvc.tar.xz",
"clang+llvm-20.1.6-x86_64-pc-windows-msvc.tar.xz",
"clang+llvm-20.1.6-armv7a-linux-gnueabihf.tar.gz",
"clang+llvm-20.1.6-aarch64-pc-windows-msvc.tar.xz",
"LLVM-20.1.7-woa64.exe",
"LLVM-20.1.6-woa64.exe",
"LLVM-20.1.6-win64.exe",
"LLVM-20.1.6-win32.exe",

View File

@ -11,6 +11,7 @@ import { addUpdateAlternativesToRc, hasAptGet } from "setup-apt"
import { setupGcc } from "../gcc/gcc.js"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk.js"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import { ubuntuVersion } from "../utils/env/ubuntu_version.js"
import type { InstallationInfo } from "../utils/setup/setupBin.js"
import { quoteIfHasSpace } from "../utils/std/index.js"
@ -23,7 +24,7 @@ import { majorLLVMVersion } from "./utils.js"
const dirname = typeof __dirname === "string" ? __dirname : path.dirname(fileURLToPath(import.meta.url))
export async function setupLLVM(version: string, setupDir: string, arch: string): Promise<InstallationInfo> {
export async function setupLLVM({ version, setupDir, arch }: SetupOptions): Promise<InstallationInfo> {
const installationInfo = await setupLLVMOnly(version, setupDir, arch)
// install gcc for LLVM (for ld, libstdc++, etc.)
@ -55,19 +56,19 @@ async function setupLLVMOnly(
return apkInstallInfo
}
const brewInstallInfo = await trySetupLLVMBrew(version, setupDir, arch)
const brewInstallInfo = await trySetupLLVMBrew({ version })
if (brewInstallInfo !== undefined) {
return brewInstallInfo
}
return setupLLVMBin(version, setupDir, arch)
return setupLLVMBin({ version, setupDir, arch })
}
async function setupGccForLLVM_(arch: string) {
if (process.platform === "linux") {
// using llvm requires ld, an up to date libstdc++, etc. So, install gcc first,
// but with a lower priority than the one used by activateLLVM()
await setupGcc(getVersion("gcc", undefined, await ubuntuVersion()), "", arch, 40)
await setupGcc({ version: getVersion("gcc", undefined, await ubuntuVersion()), setupDir: "", arch, priority: 40 })
}
}
const setupGccForLLVM = memoize(setupGccForLLVM_, { promise: true })
@ -139,11 +140,11 @@ async function addLLVMLoggingMatcher() {
*
* This uses the LLVM installer on Ubuntu, and the LLVM binaries on other platforms
*/
export function setupClangFormat(version: string, setupDir: string, arch: string) {
export function setupClangFormat({ version, setupDir, arch }: SetupOptions) {
return setupLLVMOnly(version, setupDir, arch, LLVMPackages.ClangFormat)
}
/** Setup llvm tools (clang tidy, etc.) without activating llvm and using it as the compiler */
export function setupClangTools(version: string, setupDir: string, arch: string) {
export function setupClangTools({ version, setupDir, arch }: SetupOptions) {
return setupLLVMOnly(version, setupDir, arch)
}

View File

@ -5,6 +5,7 @@ import { info } from "ci-log"
import memoize from "memoizee"
import { DownloaderHelper } from "node-downloader-helper"
import { hasAptGet, installAptPack } from "setup-apt"
import type { SetupOptions } from "../setup-options.js"
import { getDebArch } from "../utils/env/arch.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
@ -14,7 +15,7 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
import { getLLVMPackageInfo } from "./llvm_url.js"
import { majorLLVMVersion } from "./utils.js"
export async function setupLLVMBin(version: string, setupDir: string, arch: string) {
export async function setupLLVMBin({ version, setupDir, arch }: SetupOptions) {
const installInfo = await setupBin("llvm", version, getLLVMPackageInfo, setupDir, arch)
await llvmBinaryDeps(majorLLVMVersion(version), arch)
return installInfo

View File

@ -2,22 +2,23 @@ import { info } from "ci-log"
import { addPath } from "envosman"
import { installBrewPack } from "setup-brew"
import { rcOptions } from "../options.ts"
import type { SetupOptions } from "../setup-options.ts"
import { majorLLVMVersion } from "./utils.ts"
export async function trySetupLLVMBrew(version: string, _setupDir: string, _arch: string) {
export async function trySetupLLVMBrew({ version }: Pick<SetupOptions, "version">) {
if (process.platform !== "darwin") {
return Promise.resolve(undefined)
}
try {
return await setupLLVMBrew(version, _setupDir, _arch)
return await setupLLVMBrew({ version })
} catch (err) {
info(`Failed to install llvm via brew: ${err}`)
return undefined
}
}
export async function setupLLVMBrew(version: string, _setupDir: string, _arch: string) {
export async function setupLLVMBrew({ version }: Pick<SetupOptions, "version">) {
const majorVersion = majorLLVMVersion(version)
// install llvm via brew if a bottle is available for it

View File

@ -5,7 +5,7 @@ import { setupMake } from "../make.js"
jest.setTimeout(300000)
describe("setup-make", () => {
it("should setup make", async () => {
const installInfo = await setupMake("", "", process.arch)
const installInfo = await setupMake()
await testBin("make", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
})

View File

@ -4,14 +4,14 @@ import { hasApk, installApkPack } from "setup-alpine"
import { hasAptGet, installAptPack } from "setup-apt"
import { getBrewDir, installBrewPack } from "setup-brew"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupMake(version: string, _setupDir: string, _arch: string) {
export async function setupMake({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
switch (process.platform) {
case "win32": {
return setupChocoPack("make", version)

View File

@ -6,7 +6,9 @@ import { setupMeson } from "../meson.js"
jest.setTimeout(300000)
describe("setup-meson", () => {
it("should setup meson", async () => {
const installInfo = await setupMeson(getVersion("meson", "true", await ubuntuVersion()), "", process.arch)
const installInfo = await setupMeson({
version: getVersion("meson", "true", await ubuntuVersion()),
})
await testBin("meson", ["--version"], installInfo.binDir)
})

View File

@ -1,6 +1,6 @@
import type { SetupOptions } from "../setup-options.js"
import { setupPipPack } from "../utils/setup/setupPipPack.js"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupMeson(version: string | undefined, _setupDir: string, _arch: string) {
export function setupMeson({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
return setupPipPack("meson", version)
}

View File

@ -11,7 +11,7 @@ describe("setup-msvc", () => {
}
it("should setup the pre-installed msvc", async () => {
try {
await setupMSVC("", "", process.arch)
await setupMSVC({ version: "", setupDir: "", arch: process.arch })
console.log(which.sync("cl"))
} catch (err) {
if (err instanceof Error) {
@ -27,7 +27,7 @@ describe("setup-msvc", () => {
}
it(`should setup msvc ${version}`, async () => {
try {
await setupMSVC(`${version}`, "", process.arch)
await setupMSVC({ version: `${version}`, setupDir: "", arch: process.arch })
console.log(which.sync("cl"))
} catch (err) {
if (err instanceof Error) {

View File

@ -14,13 +14,17 @@ const dirname = typeof __dirname === "string" ? __dirname : path.dirname(fileURL
type MSVCVersion = "2022" | "17.0" | "2019" | "16.0" | "2017" | "15.0" | "2015" | "14.0" | "2013" | "12.0" | string
export type SetupMSVCOptions = {
version: MSVCVersion
setupDir: string
arch: string
sdk?: string
uwp?: boolean
spectre?: boolean
}
export async function setupMSVC(
versionGiven: MSVCVersion,
_setupDir: string,
arch: string,
sdk?: string,
uwp?: boolean,
spectre?: boolean,
{ version: versionGiven, setupDir: _setupDir, arch, sdk, uwp, spectre }: SetupMSVCOptions,
) {
if (process.platform !== "win32") {
return
@ -67,7 +71,7 @@ export async function setupMSVC(
}
}
// run vcvarsall.bat environment variables
await setupVCVarsall(version, VCTargetsPath, arch, toolset, sdk, uwp, spectre)
await setupVCVarsall({ version, VCTargetsPath, arch, toolset, sdk, uwp, spectre, setupDir: _setupDir })
if (GITHUB_ACTIONS) {
await addMSVCLoggingMatcher()

Some files were not shown because too many files have changed in this diff Show More