mirror of https://github.com/aminya/setup-cpp
Merge pull request #251 from aminya/biome [skip ci]
This commit is contained in:
commit
1257bf3d2f
|
@ -24,9 +24,9 @@ jobs:
|
|||
os:
|
||||
- ubuntu-22.04
|
||||
node:
|
||||
- 20
|
||||
- 22
|
||||
pnpm:
|
||||
- 8
|
||||
- 9
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
@ -73,6 +73,7 @@ jobs:
|
|||
|
||||
- name: Upload Dist
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: dist
|
||||
path: |
|
||||
|
@ -95,9 +96,9 @@ jobs:
|
|||
- macos-13
|
||||
- macos-12
|
||||
node:
|
||||
- 20
|
||||
- 22
|
||||
pnpm:
|
||||
- 8
|
||||
- 9
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
@ -159,11 +160,10 @@ jobs:
|
|||
- ubuntu-20.04
|
||||
- macos-13
|
||||
- macos-12
|
||||
- macos-11
|
||||
node:
|
||||
- 20
|
||||
- 22
|
||||
pnpm:
|
||||
- 8
|
||||
- 9
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
@ -236,9 +236,9 @@ jobs:
|
|||
os:
|
||||
- ubuntu-22.04
|
||||
node:
|
||||
- 20
|
||||
- 22
|
||||
pnpm:
|
||||
- 8
|
||||
- 9
|
||||
container:
|
||||
- { file: "ubuntu-llvm.dockerfile", image: "setup-cpp-ubuntu-llvm", tag: "22.04-0.37.0" }
|
||||
- { file: "fedora-llvm.dockerfile", image: "setup-cpp-fedora-llvm", tag: "40-0.37.0" }
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
{
|
||||
"recommendations": ["orta.vscode-jest", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
|
||||
"recommendations": [
|
||||
"orta.vscode-jest",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"biomejs.biome"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
|
||||
"files": {
|
||||
"ignore": [
|
||||
"**/node_modules/**",
|
||||
"**/.pnpm-store/**",
|
||||
"**/dist/**",
|
||||
"dev/cpp_vcpkg_project/**/*",
|
||||
"**/.venv/",
|
||||
"**/.*cache/"
|
||||
],
|
||||
"ignoreUnknown": true
|
||||
},
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"style": {
|
||||
"noInferrableTypes": "off",
|
||||
"noUselessElse": "off",
|
||||
"noNonNullAssertion": "off",
|
||||
"useNodejsImportProtocol": "off"
|
||||
},
|
||||
"complexity": {
|
||||
"useLiteralKeys": "off"
|
||||
},
|
||||
"suspicious": {
|
||||
"noConfusingVoidType": "off"
|
||||
}
|
||||
}
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": false,
|
||||
"indentWidth": 4,
|
||||
"indentStyle": "space"
|
||||
},
|
||||
"json": {
|
||||
"formatter": {
|
||||
"enabled": false,
|
||||
"trailingCommas": "none"
|
||||
},
|
||||
"parser": {
|
||||
"allowComments": true,
|
||||
"allowTrailingCommas": true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,6 +15,8 @@ words:
|
|||
- hadolint
|
||||
- aminya
|
||||
- applellvm
|
||||
- biome
|
||||
- biomejs
|
||||
- bazel
|
||||
- bazelisk
|
||||
- buildtools
|
||||
|
|
|
@ -34,7 +34,7 @@ function main() {
|
|||
`./exe/setup-cpp-${process.arch}-${getPlatformName()}${exe}`,
|
||||
"--",
|
||||
`{{caxa}}/node_modules/.bin/node${exe}`,
|
||||
`{{caxa}}/setup-cpp.js`,
|
||||
"{{caxa}}/setup-cpp.js",
|
||||
])
|
||||
),
|
||||
)
|
||||
|
|
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
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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,9 @@
|
|||
"typescript": {
|
||||
"semiColons": "asi",
|
||||
"quoteProps": "asNeeded",
|
||||
"useBraces": "always"
|
||||
"useBraces": "always",
|
||||
"module.sortImportDeclarations": "maintain",
|
||||
"importDeclaration.sortNamedImports": "maintain"
|
||||
},
|
||||
"json": {},
|
||||
"markdown": {},
|
||||
|
|
63
package.json
63
package.json
|
@ -29,9 +29,10 @@
|
|||
"scripts": {
|
||||
"build": "run-s clean build.packages && run-p lint.tsc build.parcel copy.matchers",
|
||||
"build.packages": "pnpm run -r build",
|
||||
"build.parcel": "cross-env NODE_ENV=production parcel build && babel ./dist --out-dir dist --plugins @upleveled/babel-plugin-remove-node-prefix --compact --no-babelrc --source-maps true",
|
||||
"bump": "ncu -u -x numerous,execa,prettier,@types/node && pnpm update",
|
||||
"clean": "shx rm -rf ./dist ./exe ./packages/*/dist/ && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern ",
|
||||
"build.parcel": "cross-env NODE_ENV=production parcel build --detailed-report 10 && run-s build.babel",
|
||||
"build.babel": "babel ./dist --out-dir dist --plugins @upleveled/babel-plugin-remove-node-prefix --plugins @babel/plugin-transform-private-methods --compact --no-babelrc --source-maps true",
|
||||
"bump": "ncu -u -x numerous,execa,prettier,@types/node,eslint,@types/eslint && pnpm update && pnpx typesync",
|
||||
"clean": "shx rm -rf ./dist ./exe ./packages/*/dist/ ./.parcel-cache && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern ",
|
||||
"copy.matchers": "run-p copy.matchers.legacy copy.matchers.actions copy.matchers.modern",
|
||||
"copy.matchers.legacy": "shx cp ./src/gcc/gcc_matcher.json ./dist/legacy/ && shx cp ./src/msvc/msvc_matcher.json ./dist/legacy/ && shx cp ./src/python/python_matcher.json ./dist/legacy/ && shx cp ./src/llvm/llvm_matcher.json ./dist/legacy/",
|
||||
"copy.matchers.actions": "shx cp ./src/gcc/gcc_matcher.json ./dist/actions/ && shx cp ./src/msvc/msvc_matcher.json ./dist/actions/ && shx cp ./src/python/python_matcher.json ./dist/actions/ && shx cp ./src/llvm/llvm_matcher.json ./dist/actions/",
|
||||
|
@ -39,15 +40,17 @@
|
|||
"dev": "cross-env NODE_ENV=development parcel watch",
|
||||
"docs": "shx rm -rf packages/*/README.md && pnpm -r exec readme --path ../../dev/readme/template.md -y && pnpm -r exec ts-readme",
|
||||
"format": "run-s lint.dprint",
|
||||
"lint": "run-p --aggregate-output --continue-on-error lint.cspell lint.eslint lint.dprint lint.tsc",
|
||||
"lint": "run-p --aggregate-output --continue-on-error lint.cspell lint.eslint lint.dprint lint.tsc lint.biome",
|
||||
"lint.cspell": "cspell lint --no-progress --show-suggestions --cache --cache-location ./.cache/cspell/.cspellcache",
|
||||
"lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix",
|
||||
"lint.biome": "biome check --write --unsafe",
|
||||
"lint.dprint": "dprint fmt",
|
||||
"lint.tsc": "tsc --noEmit",
|
||||
"lint.tsc": "tsc --noEmit --pretty",
|
||||
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && node ./dev/scripts/pack-exe.mjs",
|
||||
"prepublishOnly": "rm ./dist/tsconfig.tsbuildinfo",
|
||||
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.dprint lint.tsc",
|
||||
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.dprint lint.tsc test.lint.biome",
|
||||
"test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
|
||||
"test.lint.biome": "biome check",
|
||||
"test.lint.dprint": "dprint check",
|
||||
"test": "jest --runInBand --forceExit --coverage",
|
||||
"build.docker-ci": "node ./dev/docker/ci/docker-ci.mjs"
|
||||
|
@ -57,15 +60,17 @@
|
|||
"@actions/exec": "^1.1.1",
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@babel/cli": "^7.24.1",
|
||||
"@babel/cli": "^7.24.8",
|
||||
"@babel/plugin-transform-private-methods": "^7.24.7",
|
||||
"@biomejs/biome": "^1.8.3",
|
||||
"@shockpkg/archive-files": "github:aminya/archive-files#54ec59fad46aca736ac6feb6c7bb526528141b9d",
|
||||
"@swc/jest": "^0.2.36",
|
||||
"@types/cross-spawn": "^6.0.6",
|
||||
"@types/eslint": "^8.56.6",
|
||||
"@types/eslint": "^8.56.11",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/node": "^12.20.55",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/which": "^3.0.3",
|
||||
"@types/which": "^3.0.4",
|
||||
"@upleveled/babel-plugin-remove-node-prefix": "github:aminya/babel-plugin-remove-node-prefix#95fcbd92405b99a6eece48c493548996f12e6519",
|
||||
"admina": "^1.0.1",
|
||||
"caxa": "^3.0.1",
|
||||
|
@ -73,24 +78,25 @@
|
|||
"ci-log": "workspace:*",
|
||||
"cross-env": "7.0.3",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"cspell": "^8.6.1",
|
||||
"dprint": "^0.45.0",
|
||||
"cspell": "^8.13.1",
|
||||
"diagnostics_channel": "^1.1.0",
|
||||
"dprint": "^0.47.2",
|
||||
"escape-path-with-spaces": "^1.0.2",
|
||||
"escape-quotes": "^1.0.2",
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-atomic": "^1.21.2",
|
||||
"eslint-config-atomic": "^1.22.0",
|
||||
"exec-powershell": "workspace:*",
|
||||
"execa": "^7.2.0",
|
||||
"is-url-online": "^1.5.0",
|
||||
"jest": "^29.7.0",
|
||||
"macos-release": "^3.2.0",
|
||||
"macos-release": "^3.3.0",
|
||||
"micro-memoize": "^4.1.2",
|
||||
"mkdirp": "^3.0.1",
|
||||
"mri": "^1.2.0",
|
||||
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#c01f519bd995460228ed3dec4df51df92dc290fd",
|
||||
"npm-check-updates": "^16.14.18",
|
||||
"npm-run-all2": "^6.1.2",
|
||||
"npm-check-updates": "^17.0.3",
|
||||
"npm-run-all2": "^6.2.2",
|
||||
"numerous": "1.0.3",
|
||||
"p-timeout": "^6.1.2",
|
||||
"parcel": "2.12.0",
|
||||
|
@ -100,7 +106,7 @@
|
|||
"prettier-config-atomic": "^4.0.0",
|
||||
"readme-md-generator": "^1.0.0",
|
||||
"retry-as-promised": "^7.0.4",
|
||||
"semver": "7.6.0",
|
||||
"semver": "7.6.3",
|
||||
"setup-python": "github:aminya/setup-python#a783db655c6e40317e2c0c96f9d162d9c9f4a751",
|
||||
"shx": "0.3.4",
|
||||
"simple-update-notifier": "^2.0.0",
|
||||
|
@ -108,9 +114,11 @@
|
|||
"time-delta": "github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e",
|
||||
"ts-node": "^10.9.2",
|
||||
"ts-readme": "^1.1.3",
|
||||
"typescript": "^5.4.3",
|
||||
"typescript": "^5.5.4",
|
||||
"ubuntu-version": "^2.0.0",
|
||||
"untildify-user": "workspace:*",
|
||||
"util.types": "^0.0.2",
|
||||
"web-streams-polyfill": "^4.0.0",
|
||||
"which": "^4.0.0"
|
||||
},
|
||||
"productionDependencies": [
|
||||
|
@ -139,10 +147,14 @@
|
|||
"simple-update-notifier",
|
||||
"time-delta",
|
||||
"ubuntu-version",
|
||||
"untildify-user"
|
||||
"untildify-user",
|
||||
"web-streams-polyfill",
|
||||
"util.types",
|
||||
"diagnostics_channel"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12.x"
|
||||
"node": ">=12.x",
|
||||
"pnpm": "^9"
|
||||
},
|
||||
"keywords": [
|
||||
"github-actions",
|
||||
|
@ -168,7 +180,10 @@
|
|||
"patha": "patha/dist/index.node.mjs",
|
||||
"admina": "admina/dist/index.mjs",
|
||||
"fs/promises": "./src/utils/compat/fs/promises.ts",
|
||||
"stream/promises": "./src/utils/compat/stream/promises.ts"
|
||||
"stream/promises": "./src/utils/compat/stream/promises.ts",
|
||||
"stream/web": "web-streams-polyfill/dist/ponyfill.mjs",
|
||||
"util/types": "util.types/index.js",
|
||||
"diagnostics_channel": "diagnostics_channel/index.js"
|
||||
},
|
||||
"targets": {
|
||||
"main": {
|
||||
|
@ -176,9 +191,7 @@
|
|||
"engines": {
|
||||
"node": ">=12.x"
|
||||
},
|
||||
"includeNodeModules": {
|
||||
"update-notifier": false
|
||||
},
|
||||
"includeNodeModules": true,
|
||||
"optimize": true,
|
||||
"outputFormat": "commonjs"
|
||||
},
|
||||
|
@ -187,9 +200,7 @@
|
|||
"engines": {
|
||||
"node": ">=20.x"
|
||||
},
|
||||
"includeNodeModules": {
|
||||
"update-notifier": false
|
||||
},
|
||||
"includeNodeModules": true,
|
||||
"optimize": true,
|
||||
"outputFormat": "commonjs"
|
||||
},
|
||||
|
|
|
@ -25,5 +25,6 @@
|
|||
"console",
|
||||
"info",
|
||||
"notifications"
|
||||
]
|
||||
],
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
|
|
@ -24,5 +24,6 @@
|
|||
"user",
|
||||
"shell",
|
||||
"bash"
|
||||
]
|
||||
],
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { isSudo } from "admina"
|
||||
import { homedir } from "os"
|
||||
import { join } from "path"
|
||||
import { isSudo } from "admina"
|
||||
|
||||
export function userHomeDir() {
|
||||
if (isSudo() && typeof process.env.SUDO_USER === "string" && process.env.SUDO_USER !== "") {
|
||||
|
|
15926
pnpm-lock.yaml
15926
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
import { parseArgs } from "../cli-options"
|
||||
import { getCompilerInfo } from "../compilers"
|
||||
import { Inputs } from "../tool"
|
||||
import type { Inputs } from "../tool"
|
||||
import { DefaultLinuxVersion } from "../versions/default_versions"
|
||||
import { getVersion, syncVersions } from "../versions/versions"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import { testBin } from "../../utils/tests/test-helpers"
|
||||
import { setupBazel } from "../bazel"
|
||||
|
||||
|
|
|
@ -38,10 +38,10 @@ export async function setupBazel(version: string, _setupDir: string, _arch: stri
|
|||
])
|
||||
return setupAptPack([{ name: "bazel", version }], true)
|
||||
}
|
||||
throw new Error(`Unsupported linux distribution`)
|
||||
throw new Error("Unsupported linux distribution")
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { tmpdir } from "os"
|
||||
import path, { join } from "path"
|
||||
import { mkdirP } from "@actions/io"
|
||||
import { execaSync } from "execa"
|
||||
import { readFile } from "fs/promises"
|
||||
import { tmpdir } from "os"
|
||||
import path, { join } from "path"
|
||||
import { dirname } from "patha"
|
||||
import which from "which"
|
||||
import { addPath } from "../utils/env/addEnv"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import { testBin } from "../../utils/tests/test-helpers"
|
||||
import { setupCcache } from "../ccache"
|
||||
|
||||
|
|
|
@ -24,10 +24,10 @@ export function setupCcache(version: string, _setupDir: string, _arch: string) {
|
|||
} else if (isUbuntu()) {
|
||||
return setupAptPack([{ name: "ccache", version }])
|
||||
}
|
||||
throw new Error(`Unsupported linux distribution`)
|
||||
throw new Error("Unsupported linux distribution")
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import { testBin } from "../../utils/tests/test-helpers"
|
||||
import { setupChocolatey } from "../chocolatey"
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { pathExists } from "path-exists"
|
|||
import { dirname } from "patha"
|
||||
import which from "which"
|
||||
import { addPath } from "../utils/env/addEnv"
|
||||
import { InstallationInfo } from "../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../utils/setup/setupBin"
|
||||
|
||||
let binDir: string | undefined
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { getInput } from "@actions/core"
|
||||
import { info } from "ci-log"
|
||||
import mri from "mri"
|
||||
import { Inputs, inputs } from "./tool"
|
||||
import { InstallationInfo } from "./utils/setup/setupBin"
|
||||
import { type Inputs, inputs } from "./tool"
|
||||
import type { InstallationInfo } from "./utils/setup/setupBin"
|
||||
|
||||
export function parseArgs(args: string[]): Opts {
|
||||
return mri<Record<Inputs, string | undefined> & { help: boolean }>(args, {
|
||||
|
@ -31,13 +31,13 @@ All the available tools:
|
|||
|
||||
console.table(
|
||||
{
|
||||
"compiler and analyzer": { tools: `--llvm, --gcc, --msvc, --vcvarsall, --cppcheck, --clangtidy, --clangformat` },
|
||||
"build system": { tools: `--cmake, --ninja, --meson, --make, --task, --bazel` },
|
||||
"package manager": { tools: `--vcpkg, --conan, --choco, --brew, --nala` },
|
||||
cache: { tools: `--cppcache, --sccache` },
|
||||
documentation: { tools: `--doxygen, --graphviz` },
|
||||
coverage: { tools: `--gcovr, --opencppcoverage, --kcov` },
|
||||
other: { tools: `--python, --powershell, --sevenzip` },
|
||||
"compiler and analyzer": { tools: "--llvm, --gcc, --msvc, --vcvarsall, --cppcheck, --clangtidy, --clangformat" },
|
||||
"build system": { tools: "--cmake, --ninja, --meson, --make, --task, --bazel" },
|
||||
"package manager": { tools: "--vcpkg, --conan, --choco, --brew, --nala" },
|
||||
cache: { tools: "--cppcache, --sccache" },
|
||||
documentation: { tools: "--doxygen, --graphviz" },
|
||||
coverage: { tools: "--gcovr, --opencppcoverage, --kcov" },
|
||||
other: { tools: "--python, --powershell, --sevenzip" },
|
||||
},
|
||||
["tools"],
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@ import { addExeExt } from "patha"
|
|||
import semverCoerce from "semver/functions/coerce"
|
||||
import semverLte from "semver/functions/lte"
|
||||
import { extractZip } from "../utils/setup/extract"
|
||||
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
|
||||
/** Get the platform data for cmake */
|
||||
function getCmakePackageInfo(version: string, platform: NodeJS.Platform, arch: string): PackageInfo {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { join } from "path"
|
||||
import { endGroup, notice, startGroup } from "@actions/core"
|
||||
import { error, info } from "ci-log"
|
||||
import { join } from "path"
|
||||
import semverValid from "semver/functions/valid"
|
||||
import { getSuccessMessage } from "./cli-options"
|
||||
import { setupGcc, setupMingw } from "./gcc/gcc"
|
||||
|
|
|
@ -27,10 +27,10 @@ export async function setupCppcheck(version: string | undefined, _setupDir: stri
|
|||
} else if (isUbuntu()) {
|
||||
return setupAptPack([{ name: "cppcheck", version }])
|
||||
}
|
||||
throw new Error(`Unsupported linux distribution`)
|
||||
throw new Error("Unsupported linux distribution")
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import which from "which"
|
||||
import { macosVersion } from "../../utils/env/macos_version"
|
||||
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
|
||||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||
import { getVersion } from "../../versions/versions"
|
||||
import { setupDoxygen } from "../doxygen"
|
||||
|
|
|
@ -4,7 +4,7 @@ import { setupGraphviz } from "../graphviz/graphviz"
|
|||
import { addPath } from "../utils/env/addEnv"
|
||||
import { extractTar, extractZip } from "../utils/setup/extract"
|
||||
import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
||||
|
@ -98,7 +98,7 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
|
|||
} else if (isUbuntu()) {
|
||||
installationInfo = await setupAptPack([{ name: "doxygen", version }])
|
||||
} else {
|
||||
throw new Error(`Unsupported linux distributions`)
|
||||
throw new Error("Unsupported linux distributions")
|
||||
}
|
||||
} else if (isUbuntu()) {
|
||||
try {
|
||||
|
@ -114,13 +114,13 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
|
|||
installationInfo = await setupAptPack([{ name: "doxygen" }])
|
||||
}
|
||||
} else {
|
||||
throw new Error(`Unsupported linux distributions`)
|
||||
throw new Error("Unsupported linux distributions")
|
||||
}
|
||||
await setupGraphviz(getVersion("graphviz", undefined, await ubuntuVersion()), "", arch)
|
||||
return installationInfo
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ async function activateWinDoxygen() {
|
|||
throw new Error("Failed to find doxygen binary")
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ import { addEnv, addPath } from "../utils/env/addEnv"
|
|||
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { info, warning } from "ci-log"
|
||||
import { ExecaReturnValue } from "execa"
|
||||
import type { ExecaReturnValue } from "execa"
|
||||
import { pathExists } from "path-exists"
|
||||
import { addExeExt, join } from "patha"
|
||||
import semverCoerce from "semver/functions/coerce"
|
||||
|
@ -13,7 +13,7 @@ import { isArch } from "../utils/env/isArch"
|
|||
import { isUbuntu } from "../utils/env/isUbuntu"
|
||||
import { extract7Zip } from "../utils/setup/extract"
|
||||
import { setupAptPack, updateAptAlternatives } from "../utils/setup/setupAptPack"
|
||||
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { macosVersion } from "../../utils/env/macos_version"
|
||||
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
|
||||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||
import { getVersion } from "../../versions/versions"
|
||||
import { setupGraphviz } from "../graphviz"
|
||||
|
|
|
@ -3,7 +3,7 @@ import { hasDnf } from "../utils/env/hasDnf"
|
|||
import { isArch } from "../utils/env/isArch"
|
||||
import { isUbuntu } from "../utils/env/isUbuntu"
|
||||
import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||
import { InstallationInfo } from "../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../utils/setup/setupBin"
|
||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||
|
@ -27,10 +27,10 @@ export async function setupGraphviz(version: string, _setupDir: string, _arch: s
|
|||
} else if (isUbuntu()) {
|
||||
return setupAptPack([{ name: "graphviz", version }])
|
||||
}
|
||||
throw new Error(`Unsupported linux distribution`)
|
||||
throw new Error("Unsupported linux distribution")
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ async function activateGraphviz(): Promise<InstallationInfo> {
|
|||
return { binDir }
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ import { error } from "ci-log"
|
|||
import pTimeout from "p-timeout"
|
||||
import { join } from "patha"
|
||||
import { getSuccessMessage } from "./cli-options"
|
||||
import { setups, ToolName } from "./tool"
|
||||
import { InstallationInfo } from "./utils/setup/setupBin"
|
||||
import { type ToolName, setups } from "./tool"
|
||||
import type { InstallationInfo } from "./utils/setup/setupBin"
|
||||
import { setupVCVarsall } from "./vcvarsall/vcvarsall"
|
||||
import { getVersion } from "./versions/versions"
|
||||
|
||||
|
@ -23,7 +23,7 @@ export async function installTool(
|
|||
startGroup(`Installing ${tool} ${version}`)
|
||||
let hasLLVM = false
|
||||
try {
|
||||
hasLLVM = await pTimeout(installToolImpl(tool, version, osVersion, arch, hasLLVM, setupCppDir, successMessages), {
|
||||
hasLLVM = await pTimeout(installToolImpl(tool, version, osVersion, arch, setupCppDir, successMessages), {
|
||||
milliseconds: timeout,
|
||||
message: `Timeout while installing ${tool} ${version}. You can increase the timeout from options`,
|
||||
})
|
||||
|
@ -41,10 +41,12 @@ async function installToolImpl(
|
|||
version: string,
|
||||
osVersion: number[] | null,
|
||||
arch: string,
|
||||
hasLLVM: boolean,
|
||||
setupCppDir: string,
|
||||
successMessages: string[],
|
||||
) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
const hasLLVM = ["llvm", "clangformat", "clangtidy"].includes(tool)
|
||||
|
||||
let installationInfo: InstallationInfo | undefined | void
|
||||
if (tool === "vcvarsall") {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
|
@ -53,9 +55,6 @@ async function installToolImpl(
|
|||
// get the setup function
|
||||
const setupFunction = setups[tool]
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
hasLLVM = ["llvm", "clangformat", "clangtidy"].includes(tool)
|
||||
|
||||
// the tool installation directory (for the functions that ue it)
|
||||
const setupDir = join(setupCppDir, hasLLVM ? "llvm" : tool)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { info } from "@actions/core"
|
||||
import which from "which"
|
||||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||
import { setupKcov } from "../kcov"
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import { isUbuntu } from "../utils/env/isUbuntu"
|
|||
import { ubuntuVersion } from "../utils/env/ubuntu_version"
|
||||
import { extractTarByExe } from "../utils/setup/extract"
|
||||
import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
||||
import { addVPrefix, removeVPrefix } from "../utils/setup/version"
|
||||
|
|
|
@ -8,7 +8,7 @@ import { getSpecificVersionAndUrl } from "../../utils/setup/version"
|
|||
import { setupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||
import { getVersion } from "../../versions/versions"
|
||||
import { setupClangFormat, setupClangTools, setupLLVM } from "../llvm"
|
||||
import { getLinuxUrl, getUrl, VERSIONS } from "../llvm_url"
|
||||
import { VERSIONS, getLinuxUrl, getUrl } from "../llvm_url"
|
||||
|
||||
jest.setTimeout(400000)
|
||||
async function testUrl(version: string) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { delimiter } from "path"
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { info, warning } from "ci-log"
|
||||
import memoize from "micro-memoize"
|
||||
import { delimiter } from "path"
|
||||
import { pathExists } from "path-exists"
|
||||
import { addExeExt, join } from "patha"
|
||||
import { setupGcc } from "../gcc/gcc"
|
||||
|
@ -10,7 +10,7 @@ import { addEnv } from "../utils/env/addEnv"
|
|||
import { isUbuntu } from "../utils/env/isUbuntu"
|
||||
import { ubuntuVersion } from "../utils/env/ubuntu_version"
|
||||
import { setupAptPack, updateAptAlternatives } from "../utils/setup/setupAptPack"
|
||||
import { InstallationInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { type InstallationInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { semverCoerceIfInvalid } from "../utils/setup/version"
|
||||
import { getVersion } from "../versions/versions"
|
||||
import { LLVMPackages, setupLLVMApt } from "./llvm_installer"
|
||||
|
@ -55,7 +55,7 @@ async function setupLLVMOnly(
|
|||
packages: LLVMPackages = LLVMPackages.All,
|
||||
) {
|
||||
const coeredVersion = semverCoerceIfInvalid(version)
|
||||
const majorVersion = parseInt(coeredVersion.split(".")[0], 10)
|
||||
const majorVersion = Number.parseInt(coeredVersion.split(".")[0], 10)
|
||||
try {
|
||||
if (isUbuntu()) {
|
||||
return await setupLLVMApt(majorVersion, packages)
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { execRoot } from "admina"
|
||||
import { info } from "console"
|
||||
import { execRoot } from "admina"
|
||||
import { execa } from "execa"
|
||||
import { chmod, readFile, writeFile } from "fs/promises"
|
||||
import { DEFAULT_TIMEOUT } from "../installTool"
|
||||
import { addPath } from "../utils/env/addEnv"
|
||||
import { hasNala, isPackageInstalled, setupAptPack } from "../utils/setup/setupAptPack"
|
||||
import { InstallationInfo } from "../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../utils/setup/setupBin"
|
||||
|
||||
export enum LLVMPackages {
|
||||
All,
|
||||
ClangFormat,
|
||||
Core,
|
||||
All = 0,
|
||||
ClangFormat = 1,
|
||||
Core = 2,
|
||||
}
|
||||
|
||||
export async function setupLLVMApt(
|
||||
|
|
|
@ -3,7 +3,7 @@ import { isUrlOnline } from "is-url-online"
|
|||
import { addExeExt } from "patha"
|
||||
import semverLte from "semver/functions/lte"
|
||||
import { extractExe, extractTarByExe } from "../utils/setup/extract"
|
||||
import { PackageInfo } from "../utils/setup/setupBin"
|
||||
import type { PackageInfo } from "../utils/setup/setupBin"
|
||||
import { getSpecificVersionAndUrl, getSpecificVersions, getVersions } from "../utils/setup/version"
|
||||
|
||||
// ================================================
|
||||
|
|
|
@ -10,7 +10,7 @@ export async function setupMacOSSDK() {
|
|||
if (sdkroot) {
|
||||
await addEnv("SDKROOT", sdkroot.trim())
|
||||
} else {
|
||||
error(`SDKROOT not set`)
|
||||
error("SDKROOT not set")
|
||||
}
|
||||
} catch (e) {
|
||||
error(e as Error | string)
|
||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -97,7 +97,7 @@ async function main(args: string[]): Promise<number> {
|
|||
setupCppDir,
|
||||
successMessages,
|
||||
errorMessages,
|
||||
parseFloat(opts.timeout ?? "20") * 60 * 1000,
|
||||
Number.parseFloat(opts.timeout ?? "20") * 60 * 1000,
|
||||
)
|
||||
time2 = Date.now()
|
||||
info(`took ${timeFormatter.format(time1, time2) || "0 seconds"}`)
|
||||
|
@ -123,8 +123,12 @@ async function main(args: string[]): Promise<number> {
|
|||
}
|
||||
|
||||
// report the messages in the end
|
||||
successMessages.forEach((tool) => success(tool))
|
||||
errorMessages.forEach((tool) => error(tool))
|
||||
for (const tool of successMessages) {
|
||||
success(tool)
|
||||
}
|
||||
for (const tool of errorMessages) {
|
||||
error(tool)
|
||||
}
|
||||
|
||||
info("setup-cpp finished")
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import { testBin } from "../../utils/tests/test-helpers"
|
||||
import { setupMake } from "../make"
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ export async function setupMake(version: string, _setupDir: string, _arch: strin
|
|||
} else if (isUbuntu()) {
|
||||
return setupAptPack([{ name: "make", version }])
|
||||
}
|
||||
throw new Error(`Unsupported linux distribution`)
|
||||
throw new Error("Unsupported linux distribution")
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||
import { setupVCVarsall } from "../vcvarsall/vcvarsall"
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { findVcvarsall, vsversion_to_versionnumber } from "msvc-dev-cmd/lib.js"
|
||||
import { join } from "patha"
|
||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||
import { setupVCVarsall } from "../vcvarsall/vcvarsall"
|
||||
|
||||
import { error, info, warning } from "ci-log"
|
||||
import { pathExists } from "path-exists"
|
||||
|
|
|
@ -21,14 +21,14 @@ export async function setupNala(version: string, _setupDir: string, _arch: strin
|
|||
return { binDir }
|
||||
}
|
||||
|
||||
// https://github.com/volitank/nala#-installation
|
||||
// https://gitlab.com/volian/nala/-/wikis/Installation
|
||||
const keyFileName = await addAptKeyViaDownload(
|
||||
"volian-archive-scar-unstable.gpg",
|
||||
"https://deb.volian.org/volian/scar.key",
|
||||
"volian-archive-nala.gpg",
|
||||
"https://deb.volian.org/volian/nala.key",
|
||||
)
|
||||
execRootSync("/bin/bash", [
|
||||
"-c",
|
||||
`echo "deb [signed-by=${keyFileName}] http://deb.volian.org/volian/ scar main" | tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list`,
|
||||
`echo "deb [signed-by=${keyFileName}] http://deb.volian.org/volian/ nala main" | tee /etc/apt/sources.list.d/volian-archive-nala.list`,
|
||||
])
|
||||
|
||||
try {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { addExeExt } from "patha"
|
||||
import { extractZip } from "../utils/setup/extract"
|
||||
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
|
||||
/** Get the platform name Ninja uses in their download links */
|
||||
function getNinjaPlatform(platform: NodeJS.Platform) {
|
||||
|
|
|
@ -29,7 +29,7 @@ export async function setupPowershell(version: string | undefined, _setupDir: st
|
|||
await setupDnfPack([{ name: "curl" }])
|
||||
execRootSync("/bin/bash", [
|
||||
"-c",
|
||||
`curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo`,
|
||||
"curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo",
|
||||
])
|
||||
return setupDnfPack([{ name: "powershell", version }])
|
||||
} else if (isUbuntu()) {
|
||||
|
@ -55,10 +55,10 @@ export async function setupPowershell(version: string | undefined, _setupDir: st
|
|||
|
||||
return setupAptPack([{ name: "powershell", version }], true)
|
||||
}
|
||||
throw new Error(`Unsupported linux distribution`)
|
||||
throw new Error("Unsupported linux distribution")
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import assert from "assert"
|
||||
/* eslint-disable require-atomic-updates */
|
||||
import { getExecOutput } from "@actions/exec"
|
||||
import assert from "assert"
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { info, warning } from "ci-log"
|
||||
import { execa } from "execa"
|
||||
|
@ -13,7 +13,7 @@ import { hasDnf } from "../utils/env/hasDnf"
|
|||
import { isArch } from "../utils/env/isArch"
|
||||
import { isUbuntu } from "../utils/env/isUbuntu"
|
||||
import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||
import { InstallationInfo } from "../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../utils/setup/setupBin"
|
||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import { testBin } from "../../utils/tests/test-helpers"
|
||||
import { setupSccache } from "../sccache"
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export function setupSccache(version: string, _setupDir: string, _arch: string)
|
|||
return setupBrewPack("sccache", version)
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../../utils/setup/setupBin"
|
||||
import { testBin } from "../../utils/tests/test-helpers"
|
||||
import { setupSevenZip } from "../sevenzip"
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ export function setupSevenZip(version: string, _setupDir: string, _arch: string)
|
|||
} else if (isUbuntu()) {
|
||||
return setupAptPack([{ name: "p7zip-full", version }])
|
||||
}
|
||||
throw new Error(`Unsupported linux distribution`)
|
||||
throw new Error("Unsupported linux distribution")
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
throw new Error("Unsupported platform")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { addExeExt } from "patha"
|
||||
import { extractTarByExe, extractZip } from "../utils/setup/extract"
|
||||
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin"
|
||||
|
||||
/** Get the platform name task uses in their download links */
|
||||
function getTaskPlatform(platform: NodeJS.Platform) {
|
||||
|
|
|
@ -4,10 +4,14 @@
|
|||
import * as stream from "stream"
|
||||
import { promisify } from "util"
|
||||
|
||||
// biome-ignore lint: lint/complexity/noBannedTypes
|
||||
export const pipeline = "promises" in stream && "pipeline" in (stream as any).promises
|
||||
// biome-ignore lint: lint/complexity/noBannedTypes
|
||||
? ((stream.promises as any).pipeline as Function)
|
||||
: promisify(stream.pipeline)
|
||||
|
||||
// biome-ignore lint: lint/complexity/noBannedTypes
|
||||
export const finished = "promises" in stream && "finished" in (stream as any).promises
|
||||
// biome-ignore lint: lint/complexity/noBannedTypes
|
||||
? ((stream.promises as any).finished as Function)
|
||||
: promisify(stream.finished)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { addPath as ghAddPath, exportVariable, info, setFailed } from "@actions/core"
|
||||
import { delimiter } from "path"
|
||||
import { exportVariable, addPath as ghAddPath, info, setFailed } from "@actions/core"
|
||||
import { grantUserWriteAccess } from "admina"
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { error, warning } from "ci-log"
|
||||
|
@ -6,7 +7,6 @@ import escapeSpace from "escape-path-with-spaces"
|
|||
import escapeQuote from "escape-quotes"
|
||||
import { execPowershell } from "exec-powershell"
|
||||
import { appendFile, readFile, writeFile } from "fs/promises"
|
||||
import { delimiter } from "path"
|
||||
import { pathExists } from "path-exists"
|
||||
import { untildifyUser } from "untildify-user"
|
||||
|
||||
|
|
|
@ -12,6 +12,6 @@ function macosVersion_raw() {
|
|||
}
|
||||
|
||||
const { version } = macosRelease()
|
||||
return version.split(".").map((v) => parseInt(v, 10))
|
||||
return version.split(".").map((v) => Number.parseInt(v, 10))
|
||||
}
|
||||
export const macosVersion = memoize(macosVersion_raw)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import os from "os"
|
||||
import { warning } from "ci-log"
|
||||
import memoize from "micro-memoize"
|
||||
import os from "os"
|
||||
import { getUbuntuVersion } from "ubuntu-version"
|
||||
import which from "which"
|
||||
import { setupAptPack } from "../setup/setupAptPack"
|
||||
|
@ -45,9 +45,9 @@ function detectUsingOsVersion() {
|
|||
// #46~22.04.1-Ubuntu SMP ...
|
||||
const osVersion: string = os.version()
|
||||
const versionSplitted = osVersion.split(".")
|
||||
const majorVersion = parseInt(versionSplitted[0].replace("#", ""), 10)
|
||||
const minorVersion = parseInt(versionSplitted[1].replace("~", ""), 10)
|
||||
const patchVersion = parseInt(versionSplitted[2].split("-")[0], 10)
|
||||
const majorVersion = Number.parseInt(versionSplitted[0].replace("#", ""), 10)
|
||||
const minorVersion = Number.parseInt(versionSplitted[1].replace("~", ""), 10)
|
||||
const patchVersion = Number.parseInt(versionSplitted[2].split("-")[0], 10)
|
||||
|
||||
return [majorVersion, minorVersion, patchVersion]
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@ import { execRoot, execRootSync } from "admina"
|
|||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { info, warning } from "ci-log"
|
||||
import escapeRegex from "escape-string-regexp"
|
||||
import { execa, ExecaError } from "execa"
|
||||
import { type ExecaError, execa } from "execa"
|
||||
import { appendFile } from "fs/promises"
|
||||
import { pathExists } from "path-exists"
|
||||
import which from "which"
|
||||
import { addEnv, cpprc_path, sourceCpprc } from "../env/addEnv"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
import type { InstallationInfo } from "./setupBin"
|
||||
|
||||
/* eslint-disable require-atomic-updates */
|
||||
let didUpdate: boolean = false
|
||||
|
@ -75,10 +75,10 @@ export async function setupAptPack(packages: AptPackage[], update = false): Prom
|
|||
}
|
||||
|
||||
export enum AptPackageType {
|
||||
NameDashVersion,
|
||||
NameEqualsVersion,
|
||||
Name,
|
||||
None,
|
||||
NameDashVersion = 0,
|
||||
NameEqualsVersion = 1,
|
||||
Name = 2,
|
||||
None = 3,
|
||||
}
|
||||
|
||||
export async function aptPackageType(name: string, version: string | undefined): Promise<AptPackageType> {
|
||||
|
@ -125,7 +125,6 @@ async function getAptArg(name: string, version: string | undefined) {
|
|||
return `${name}=${version}`
|
||||
case AptPackageType.Name:
|
||||
return name
|
||||
case AptPackageType.None:
|
||||
default:
|
||||
throw new Error(`Could not find package ${name} ${version ?? ""}`)
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ import { info } from "ci-log"
|
|||
import { join } from "patha"
|
||||
import { addPath } from "../env/addEnv"
|
||||
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { tmpdir } from "os"
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { pathExists } from "path-exists"
|
||||
import retry from "retry-as-promised"
|
||||
import { hasDnf } from "../env/hasDnf"
|
||||
|
@ -25,9 +25,7 @@ export type PackageInfo = {
|
|||
/** The main binary file. */
|
||||
binFileName: string
|
||||
/** The function to extract the downloaded archive. It can be `undefined`, if the binary itself is downloaded directly. */
|
||||
extractFunction?: {
|
||||
(file: string, dest: string): Promise<unknown>
|
||||
}
|
||||
extractFunction?: (file: string, dest: string) => Promise<unknown>
|
||||
}
|
||||
|
||||
export type InstallationInfo = {
|
||||
|
@ -102,7 +100,7 @@ export async function setupBin(
|
|||
)
|
||||
|
||||
if (!didInit) {
|
||||
info(`Installing extraction dependencies`)
|
||||
info("Installing extraction dependencies")
|
||||
if (process.platform === "linux") {
|
||||
if (isArch()) {
|
||||
await Promise.all([setupPacmanPack("unzip"), setupPacmanPack("tar"), setupPacmanPack("xz")])
|
||||
|
|
|
@ -4,7 +4,7 @@ import { execaSync } from "execa"
|
|||
import { join } from "patha"
|
||||
import which from "which"
|
||||
import { getBrewPath, setupBrew } from "../../brew/brew"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
import type { InstallationInfo } from "./setupBin"
|
||||
|
||||
let hasBrew = false
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { execaSync } from "execa"
|
|||
import which from "which"
|
||||
import { setupChocolatey } from "../../chocolatey/chocolatey"
|
||||
import { addPath } from "../env/addEnv"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
import type { InstallationInfo } from "./setupBin"
|
||||
|
||||
let hasChoco = false
|
||||
|
||||
|
@ -20,9 +20,9 @@ export async function setupChocoPack(name: string, version?: string, args: strin
|
|||
// https://github.com/jberezanski/ChocolateyPackages/issues/97#issuecomment-986825694
|
||||
const PATH = process.env.PATH
|
||||
const env = { ...process.env }
|
||||
delete env.TMP
|
||||
delete env.TEMP
|
||||
delete env.Path
|
||||
env.TMP = undefined
|
||||
env.TEMP = undefined
|
||||
env.Path = undefined
|
||||
env.PATH = PATH
|
||||
|
||||
if (version !== undefined && version !== "") {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { execRootSync } from "admina"
|
||||
import { info, warning } from "ci-log"
|
||||
import { execa } from "execa"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
import type { InstallationInfo } from "./setupBin"
|
||||
|
||||
type DnfPackage = {
|
||||
name: string
|
||||
|
|
|
@ -2,7 +2,7 @@ import { execRootSync } from "admina"
|
|||
import { info, warning } from "ci-log"
|
||||
import { execa, execaSync } from "execa"
|
||||
import which from "which"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
import type { InstallationInfo } from "./setupBin"
|
||||
|
||||
/* eslint-disable require-atomic-updates */
|
||||
let didUpdate: boolean = false
|
||||
|
|
|
@ -14,7 +14,7 @@ import { isArch } from "../env/isArch"
|
|||
import { isUbuntu } from "../env/isUbuntu"
|
||||
import { ubuntuVersion } from "../env/ubuntu_version"
|
||||
import { setupAptPack } from "./setupAptPack"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
import type { InstallationInfo } from "./setupBin"
|
||||
import { setupDnfPack } from "./setupDnfPack"
|
||||
import { setupPacmanPack } from "./setupPacmanPack"
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ export function semverCoerceIfInvalid(version: string) {
|
|||
}
|
||||
|
||||
export function removeVPrefix(version: string) {
|
||||
return parseInt(version.replace(/^v/, ""), 10)
|
||||
return Number.parseInt(version.replace(/^v/, ""), 10)
|
||||
}
|
||||
|
||||
export function addVPrefix(version: string) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { tmpdir } from "os"
|
||||
import * as io from "@actions/io"
|
||||
import spawn from "cross-spawn"
|
||||
import { tmpdir } from "os"
|
||||
import * as path from "patha"
|
||||
import { addExeExt, join } from "patha"
|
||||
|
||||
|
@ -66,5 +66,5 @@ export function runnerWindowsVersion() {
|
|||
return undefined
|
||||
}
|
||||
|
||||
return parseInt(maybeVersionString, 10)
|
||||
return Number.parseInt(maybeVersionString, 10)
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import { hasDnf } from "../utils/env/hasDnf"
|
|||
import { isArch } from "../utils/env/isArch"
|
||||
import { isUbuntu } from "../utils/env/isUbuntu"
|
||||
import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||
import { InstallationInfo } from "../utils/setup/setupBin"
|
||||
import type { InstallationInfo } from "../utils/setup/setupBin"
|
||||
import { setupDnfPack } from "../utils/setup/setupDnfPack"
|
||||
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Opts } from "../cli-options"
|
||||
import { Inputs } from "../tool"
|
||||
import type { Opts } from "../cli-options"
|
||||
import type { Inputs } from "../tool"
|
||||
import { DefaultLinuxVersion, DefaultVersions } from "./default_versions"
|
||||
|
||||
/** Get the default version if passed true or undefined, otherwise return the version itself */
|
||||
|
@ -24,7 +24,7 @@ function getDefaultLinuxVersion(osVersion: number[], toolLinuxVersions: Record<n
|
|||
|
||||
// find which version block the os version is in
|
||||
const satisfyingVersion = Object.keys(toolLinuxVersions)
|
||||
.map((v) => parseInt(v, 10))
|
||||
.map((v) => Number.parseInt(v, 10))
|
||||
.sort((a, b) => b - a) // sort in descending order
|
||||
.find((v) => osVersionMaj >= v)
|
||||
|
||||
|
@ -47,9 +47,9 @@ export function syncVersions(opts: Opts, tools: Inputs[]): boolean {
|
|||
return false
|
||||
}
|
||||
|
||||
toolsInUse.forEach((tool) => {
|
||||
for (const tool of toolsInUse) {
|
||||
opts[tool] = targetVersion
|
||||
})
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue