Merge pull request #240 from aminya/dprint [skip ci]

This commit is contained in:
Amin Yahyaabadi 2024-04-03 00:38:55 -07:00 committed by GitHub
commit 072c438abb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
115 changed files with 1902 additions and 1029 deletions

71
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,71 @@
{
"[dockerfile]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[javascript]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[json]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[jsonc]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[markdown]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[typescript]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dprint.dprint"
},
"[yaml]": {
"editor.defaultFormatter": "dprint.dprint"
},
"cSpell.advanced.feature.useReferenceProviderWithRename": true,
"cSpell.checkOnlyEnabledFileTypes": false,
"cSpell.numSuggestions": 3,
"cSpell.showAutocompleteSuggestions": true,
"eslint.enable": true,
"eslint.options": {
"cache": true,
"cacheLocation": "./node_modules/.cache/eslint/",
"errorOnUnmatchedPattern": false,
"extensions": [
"ts",
"tsx",
"js",
"jsx",
"cjs",
"mjs",
"json",
"yaml",
"astro",
"mdx",
"html"
]
},
"eslint.probe": [
"typescript",
"typescriptreact",
"javascript",
"javascriptreact",
"json",
"jsonc",
"yaml",
"markdown",
"html",
"astro"
],
"explorer.copyRelativePathSeparator": "/",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"hadolint.hadolintPath": "./target/bin/hadolint",
// use dprint instead
"prettier.enable": false
}

View File

@ -12,6 +12,7 @@ ignorePaths:
- .vscode/extensions.json
words:
- aarch
- hadolint
- aminya
- applellvm
- bazel
@ -33,6 +34,7 @@ words:
- dearmor
- deps
- devel
- dprint
- DVCPKG
- dyld
- eabi

View File

@ -1,14 +1,13 @@
## base image
FROM archlinux:base as setup-cpp-arch
FROM archlinux:base AS setup-cpp-arch
COPY "./dist/legacy" "/usr/lib/setup-cpp/"
RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
# install nodejs
# install nodejs
pacman -S --noconfirm --needed nodejs npm && \
# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--compiler llvm \
--cmake true \
@ -21,7 +20,7 @@ RUN pacman -Syuu --noconfirm && \
--gcovr true \
--doxygen true \
--ccache true && \
# arch cleanup
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \
rm -rf /tmp/*

View File

@ -1,14 +1,13 @@
## base image
FROM archlinux:base as setup-cpp-arch-mingw
FROM archlinux:base AS setup-cpp-arch-mingw
COPY "./dist/legacy" "/usr/lib/setup-cpp/"
RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
# install nodejs
# install nodejs
pacman -S --noconfirm --needed nodejs npm && \
# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--compiler mingw \
--cmake true \
@ -21,7 +20,7 @@ RUN pacman -Syuu --noconfirm && \
--gcovr true \
--doxygen true \
--ccache true && \
# arch cleanup
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \
rm -rf /tmp/*

View File

@ -10,7 +10,7 @@ async function main() {
.replace(/FROM (.*)/g, `FROM $1\n\nCOPY "./dist/legacy" "/usr/lib/setup-cpp/"`)
.replace("setup-cpp ", "node /usr/lib/setup-cpp/setup-cpp.js ")
// remove the npm install line
.replace(/# install setup-cpp\n\s*npm install -g setup-cpp.*/, "")
.replace(/# install setup-cpp\n\s*npm install -g setup-cpp.*\n/, "")
// write the new file in dev/docker/ci
await writeFile(`./dev/docker/ci/${name}.dockerfile`, modifiedDockerFile)

View File

@ -1,12 +1,11 @@
## base image
FROM fedora:40 as setup-cpp-fedora
FROM fedora:40 AS setup-cpp-fedora
COPY "./dist/legacy" "/usr/lib/setup-cpp/"
# install nodejs
RUN dnf -y install nodejs npm && \
# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--compiler llvm \
--cmake true \
@ -19,7 +18,7 @@ RUN dnf -y install nodejs npm && \
--gcovr true \
--doxygen true \
--ccache true && \
# cleanup
# cleanup
dnf clean all && \
rm -rf /tmp/*

View File

@ -1,12 +1,11 @@
## base image
FROM fedora:40 as setup-cpp-fedora-mingw
FROM fedora:40 AS setup-cpp-fedora-mingw
COPY "./dist/legacy" "/usr/lib/setup-cpp/"
# install nodejs
RUN dnf -y install nodejs npm && \
# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--compiler mingw \
--cmake true \
@ -20,7 +19,7 @@ RUN dnf -y install nodejs npm && \
--doxygen true \
--ccache true \
--powershell true && \
# cleanup
# cleanup
dnf clean all && \
rm -rf /tmp/*

View File

@ -1,13 +1,12 @@
#### Base Image
FROM ubuntu:22.04 as setup-cpp-ubuntu
FROM ubuntu:22.04 AS setup-cpp-ubuntu
COPY "./dist/legacy" "/usr/lib/setup-cpp/"
RUN apt-get update -qq && \
# install nodejs
# install nodejs
apt-get install -y --no-install-recommends nodejs npm && \
# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--nala true \
--compiler llvm \
@ -21,7 +20,7 @@ RUN apt-get update -qq && \
--gcovr true \
--doxygen true \
--ccache true && \
# cleanup
# cleanup
nala autoremove -y && \
nala autopurge -y && \
apt-get clean && \

View File

@ -1,13 +1,12 @@
#### Base Image
FROM ubuntu:22.04 as setup-cpp-ubuntu-mingw
FROM ubuntu:22.04 AS setup-cpp-ubuntu-mingw
COPY "./dist/legacy" "/usr/lib/setup-cpp/"
RUN apt-get update -qq && \
# install nodejs
# install nodejs
apt-get install -y --no-install-recommends nodejs npm && \
# install the compiler and tools
# install the compiler and tools
node /usr/lib/setup-cpp/setup-cpp.js \
--nala true \
--compiler mingw \
@ -22,7 +21,7 @@ RUN apt-get update -qq && \
--doxygen true \
--ccache true \
--powershell true && \
# cleanup
# cleanup
nala autoremove -y && \
nala autopurge -y && \
apt-get clean && \

View File

@ -8,7 +8,7 @@ RUN bash -c 'source ~/.cpprc \
#### Running environment
# use a fresh image as the runner
FROM archlinux:base as runner
FROM archlinux:base AS runner
# copy the built binaries and their runtime dependencies
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/

View File

@ -8,7 +8,7 @@ RUN bash -c 'source ~/.cpprc \
#### Running environment
# use a fresh image as the runner
FROM fedora:40 as runner
FROM fedora:40 AS runner
# copy the built binaries and their runtime dependencies
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/

View File

@ -8,7 +8,7 @@ RUN bash -c 'source ~/.cpprc \
#### Running environment
# use a fresh image as the runner
FROM ubuntu:22.04 as runner
FROM ubuntu:22.04 AS runner
# copy the built binaries and their runtime dependencies
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/

View File

@ -1,13 +1,13 @@
## base image
FROM archlinux:base as setup-cpp-arch
FROM archlinux:base AS setup-cpp-arch
RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
# install nodejs
# install nodejs
pacman -S --noconfirm --needed nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g setup-cpp@v0.37.0 && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--compiler llvm \
--cmake true \
@ -20,7 +20,7 @@ RUN pacman -Syuu --noconfirm && \
--gcovr true \
--doxygen true \
--ccache true && \
# arch cleanup
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \
rm -rf /tmp/*

View File

@ -1,13 +1,13 @@
## base image
FROM archlinux:base as setup-cpp-arch-mingw
FROM archlinux:base AS setup-cpp-arch-mingw
RUN pacman -Syuu --noconfirm && \
pacman-db-upgrade && \
# install nodejs
# install nodejs
pacman -S --noconfirm --needed nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g setup-cpp@v0.37.0 && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--compiler mingw \
--cmake true \
@ -20,7 +20,7 @@ RUN pacman -Syuu --noconfirm && \
--gcovr true \
--doxygen true \
--ccache true && \
# arch cleanup
# arch cleanup
pacman -Scc --noconfirm && \
rm -rf /var/cache/pacman/pkg/* && \
rm -rf /tmp/*

View File

@ -1,11 +1,11 @@
## base image
FROM fedora:40 as setup-cpp-fedora
FROM fedora:40 AS setup-cpp-fedora
# install nodejs
RUN dnf -y install nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g setup-cpp@v0.37.0 && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--compiler llvm \
--cmake true \
@ -18,7 +18,7 @@ RUN dnf -y install nodejs npm && \
--gcovr true \
--doxygen true \
--ccache true && \
# cleanup
# cleanup
dnf clean all && \
rm -rf /tmp/*

View File

@ -1,11 +1,11 @@
## base image
FROM fedora:40 as setup-cpp-fedora-mingw
FROM fedora:40 AS setup-cpp-fedora-mingw
# install nodejs
RUN dnf -y install nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g setup-cpp@v0.37.0 && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--compiler mingw \
--cmake true \
@ -19,7 +19,7 @@ RUN dnf -y install nodejs npm && \
--doxygen true \
--ccache true \
--powershell true && \
# cleanup
# cleanup
dnf clean all && \
rm -rf /tmp/*

View File

@ -1,8 +1,8 @@
#### Base Image
FROM ubuntu:20.04 as setup-cpp-ubuntu-mingw
FROM ubuntu:20.04 AS setup-cpp-ubuntu-mingw
RUN apt-get update -qq && \
# install latest nodejs on ubuntu 20.04
# install latest nodejs on ubuntu 20.04
apt-get update -qq && \
apt-get install -y --no-install-recommends curl gnupg ca-certificates && \
mkdir -p /etc/apt/keyrings && \
@ -10,9 +10,9 @@ RUN apt-get update -qq && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update -qq && \
apt-get install -y --no-install-recommends nodejs && \
# install setup-cpp
# install setup-cpp
npm install -g setup-cpp@v0.37.0 && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--nala true \
--compiler mingw \
@ -27,7 +27,7 @@ RUN apt-get update -qq && \
--doxygen true \
--ccache true \
--powershell true && \
# cleanup
# cleanup
nala autoremove -y && \
nala autopurge -y && \
apt-get clean && \

View File

@ -1,12 +1,12 @@
#### Base Image
FROM ubuntu:22.04 as setup-cpp-ubuntu
FROM ubuntu:22.04 AS setup-cpp-ubuntu
RUN apt-get update -qq && \
# install nodejs
# install nodejs
apt-get install -y --no-install-recommends nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g setup-cpp@v0.37.0 && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--nala true \
--compiler llvm \
@ -20,7 +20,7 @@ RUN apt-get update -qq && \
--gcovr true \
--doxygen true \
--ccache true && \
# cleanup
# cleanup
nala autoremove -y && \
nala autopurge -y && \
apt-get clean && \

View File

@ -1,12 +1,12 @@
#### Base Image
FROM ubuntu:22.04 as setup-cpp-ubuntu-mingw
FROM ubuntu:22.04 AS setup-cpp-ubuntu-mingw
RUN apt-get update -qq && \
# install nodejs
# install nodejs
apt-get install -y --no-install-recommends nodejs npm && \
# install setup-cpp
# install setup-cpp
npm install -g setup-cpp@v0.37.0 && \
# install the compiler and tools
# install the compiler and tools
setup-cpp \
--nala true \
--compiler mingw \
@ -21,7 +21,7 @@ RUN apt-get update -qq && \
--doxygen true \
--ccache true \
--powershell true && \
# cleanup
# cleanup
nala autoremove -y && \
nala autopurge -y && \
apt-get clean && \

View File

@ -12,6 +12,6 @@ async function main() {
writeFileSync(`${file}.map`, map)
}
main().catch(function (err) {
main().catch(function(err) {
throw err
})

View File

@ -35,7 +35,7 @@ function main() {
"--",
`{{caxa}}/node_modules/.bin/node${exe}`,
`{{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

46
dprint.json Normal file
View File

@ -0,0 +1,46 @@
{
"lineWidth": 120,
"indentWidth": 2,
"newLineKind": "lf",
"useTabs": false,
"incremental": true,
"typescript": {
"semiColons": "asi",
"quoteProps": "asNeeded",
"useBraces": "always"
},
"json": {},
"markdown": {},
"dockerfile": {},
"exec": {
"commands": [
{
"command": "node ./node_modules/prettier/bin/prettier.cjs --stdin-filepath {{file_path}} --tab-width {{indent_width}} --print-width {{line_width}}",
"exts": ["yaml", "yml"]
}
],
"associations": [
"**/*{.yaml,.yml}"
]
},
"includes": [
"**/*{.ts,.tsx,.mts,.cts,.js,.jsx,.cjs,.mjs,.json,.md,.yaml,.yml,.dockerfile}"
],
"excludes": [
"**/node_modules",
"*.lock*",
"*-lock*",
"./.cache/",
"**/build",
"**/dist",
"dev/cpp_vcpkg_project"
],
"plugins": [
"https://plugins.dprint.dev/typescript-0.89.3.wasm",
"https://plugins.dprint.dev/json-0.19.2.wasm",
"https://plugins.dprint.dev/markdown-0.16.4.wasm",
"https://plugins.dprint.dev/dockerfile-0.3.0.wasm",
"https://plugins.dprint.dev/exec-0.4.4.json@c207bf9b9a4ee1f0ecb75c594f774924baf62e8e53a2ce9d873816a408cecbf7"
],
"$schema": "https://dprint.dev/schemas/v0.json"
}

View File

@ -39,11 +39,11 @@
"copy.matchers.modern": "shx cp ./src/gcc/gcc_matcher.json ./dist/modern/ && shx cp ./src/msvc/msvc_matcher.json ./dist/modern/ && shx cp ./src/python/python_matcher.json ./dist/modern/ && shx cp ./src/llvm/llvm_matcher.json ./dist/modern/",
"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.prettier",
"lint": "run-p --aggregate-output --continue-on-error lint.cspell lint.eslint lint.prettier lint.tsc",
"format": "run-s lint.dprint",
"lint": "run-p --aggregate-output --continue-on-error lint.cspell lint.eslint lint.dprint lint.tsc",
"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.prettier": "prettier --list-different --write .",
"lint.dprint": "dprint fmt",
"lint.tsc": "tsc --noEmit",
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && node ./dev/scripts/pack-exe.mjs",
"prepublishOnly": "rm ./dist/tsconfig.tsbuildinfo",
@ -51,28 +51,25 @@
"start.docker.arch": "docker run -t setup-cpp:arch .",
"start.docker.fedora": "docker run -t setup-cpp:fedora .",
"start.docker.ubuntu": "docker run -t setup-cpp:ubuntu .",
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.prettier lint.tsc",
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.dprint lint.tsc",
"test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
"test.lint.prettier": "prettier . --check",
"test.lint.dprint": "dprint check",
"test": "jest --runInBand --forceExit --coverage",
"build.docker-ci": "node ./dev/docker/ci/docker-ci.mjs"
},
"prettier": "prettier-config-atomic",
"devDependencies": {
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1",
"@babel/cli": "^7.23.9",
"@shockpkg/archive-files": "https://github.com/aminya/archive-files#54ec59fad46aca736ac6feb6c7bb526528141b9d",
"@babel/cli": "^7.24.1",
"@shockpkg/archive-files": "github:aminya/archive-files#54ec59fad46aca736ac6feb6c7bb526528141b9d",
"@swc/jest": "^0.2.36",
"@types/cross-spawn": "^6.0.6",
"@types/eslint": "^8.56.2",
"@types/eslint": "^8.56.6",
"@types/jest": "^29.5.12",
"@types/mri": "^1.1.5",
"@types/node": "^12",
"@types/prettier": "2.7.3",
"@types/semver": "^7.5.7",
"@types/node": "^12.20.55",
"@types/semver": "^7.5.8",
"@types/which": "^3.0.3",
"@upleveled/babel-plugin-remove-node-prefix": "github:aminya/babel-plugin-remove-node-prefix#95fcbd92405b99a6eece48c493548996f12e6519",
"admina": "^1.0.1",
@ -81,12 +78,13 @@
"ci-log": "workspace:*",
"cross-env": "7.0.3",
"cross-spawn": "^7.0.3",
"cspell": "^8.3.2",
"cspell": "^8.6.1",
"dprint": "^0.45.0",
"escape-path-with-spaces": "^1.0.2",
"escape-quotes": "^1.0.2",
"escape-string-regexp": "^5.0.0",
"eslint": "^8.56.0",
"eslint-config-atomic": "^1.20.6",
"eslint": "^8.57.0",
"eslint-config-atomic": "^1.21.2",
"exec-powershell": "workspace:*",
"execa": "^7.2.0",
"is-url-online": "^1.5.0",
@ -95,12 +93,12 @@
"micro-memoize": "^4.1.2",
"mkdirp": "^3.0.1",
"mri": "^1.2.0",
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#97843d525947e3f3776ee359b597316909754c4d",
"npm-check-updates": "^16.14.15",
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#c01f519bd995460228ed3dec4df51df92dc290fd",
"npm-check-updates": "^16.14.18",
"npm-run-all2": "^6.1.2",
"numerous": "1.0.3",
"p-timeout": "^6.1.2",
"parcel": "2.11.0",
"parcel": "2.12.0",
"path-exists": "^5.0.0",
"patha": "^0.4.1",
"prettier": "3.2.2",
@ -115,7 +113,7 @@
"time-delta": "github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e",
"ts-node": "^10.9.2",
"ts-readme": "^1.1.3",
"typescript": "^5.3.3",
"typescript": "^5.4.3",
"ubuntu-version": "^2.0.0",
"untildify-user": "workspace:*",
"which": "^4.0.0"

View File

@ -1,6 +1,6 @@
import { join } from "path"
import { isSudo } from "admina"
import { homedir } from "os"
import { join } from "path"
export function userHomeDir() {
if (isSudo() && typeof process.env.SUDO_USER === "string" && process.env.SUDO_USER !== "") {

File diff suppressed because it is too large Load Diff

2
prettier.config.mjs Normal file
View File

@ -0,0 +1,2 @@
import config from "prettier-config-atomic"
export default config

View File

@ -1,8 +1,8 @@
import { syncVersions, getVersion } from "../versions/versions"
import { parseArgs } from "../cli-options"
import { getCompilerInfo } from "../compilers"
import { Inputs } from "../tool"
import { DefaultLinuxVersion } from "../versions/default_versions"
import { getVersion, syncVersions } from "../versions/versions"
jest.setTimeout(300000)
describe("getCompilerInfo", () => {

View File

@ -1,6 +1,6 @@
import { setupBazel } from "../bazel"
import { testBin } from "../../utils/tests/test-helpers"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { testBin } from "../../utils/tests/test-helpers"
import { setupBazel } from "../bazel"
jest.setTimeout(300000)
describe("setup-bazel", () => {

View File

@ -1,11 +1,11 @@
import { execRootSync } from "admina"
import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu"
import { addAptKeyViaDownload, setupAptPack } from "../utils/setup/setupAptPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
import { execRootSync } from "admina"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupBazel(version: string, _setupDir: string, _arch: string) {

View File

@ -1,5 +1,5 @@
import { setupBrew } from "../brew"
import { testBin } from "../../utils/tests/test-helpers"
import { setupBrew } from "../brew"
jest.setTimeout(300000)
describe("setup-brew", () => {

View File

@ -1,10 +1,10 @@
import { mkdirP } from "@actions/io"
import { execaSync } from "execa"
import { dirname } from "patha"
import which from "which"
import { readFileSync } from "fs"
import { tmpdir } from "os"
import path, { join } from "path"
import { mkdirP } from "@actions/io"
import { readFileSync } from "fs"
import { dirname } from "patha"
import which from "which"
import { addPath } from "../utils/env/addEnv"
/* eslint-disable require-atomic-updates */

View File

@ -1,6 +1,6 @@
import { setupCcache } from "../ccache"
import { testBin } from "../../utils/tests/test-helpers"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { testBin } from "../../utils/tests/test-helpers"
import { setupCcache } from "../ccache"
jest.setTimeout(300000)
describe("setup-ccache", () => {

View File

@ -1,11 +1,11 @@
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 { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupCcache(version: string, _setupDir: string, _arch: string) {

View File

@ -1,8 +1,8 @@
import { getInput } from "@actions/core"
import { info } from "ci-log"
import mri from "mri"
import { InstallationInfo } from "./utils/setup/setupBin"
import { Inputs, inputs } from "./tool"
import { InstallationInfo } from "./utils/setup/setupBin"
export function parseArgs(args: string[]): Opts {
return mri<Record<Inputs, string | undefined> & { help: boolean }>(args, {

View File

@ -1,7 +1,7 @@
import { setupCmake } from "../cmake"
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { GITHUB_ACTIONS } from "ci-info"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { setupCmake } from "../cmake"
jest.setTimeout(300000)

View File

@ -1,9 +1,9 @@
import { extractTar } from "@actions/tool-cache"
import semverLte from "semver/functions/lte"
import semverCoerce from "semver/functions/coerce"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
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"
/** Get the platform data for cmake */
function getCmakePackageInfo(version: string, platform: NodeJS.Platform, arch: string): PackageInfo {

View File

@ -60,12 +60,12 @@ export async function installCompiler(
case "mingw":
case "cygwin":
case "msys": {
const gccVersion =
compiler === "mingw" ? getVersion("mingw", version, osVersion) : getVersion("gcc", version, osVersion)
const installationInfo =
compiler === "mingw"
? await setupMingw(gccVersion, join(setupCppDir, "gcc"), arch)
: await setupGcc(gccVersion, join(setupCppDir, "gcc"), arch)
const gccVersion = compiler === "mingw"
? getVersion("mingw", version, osVersion)
: getVersion("gcc", version, osVersion)
const installationInfo = compiler === "mingw"
? await setupMingw(gccVersion, join(setupCppDir, "gcc"), arch)
: await setupGcc(gccVersion, join(setupCppDir, "gcc"), arch)
if (hasLLVM) {
// remove back the added CPPFLAGS of LLVM that include the LLVM headers

View File

@ -1,6 +1,6 @@
import { setupConan } from "../conan"
import { testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { setupConan } from "../conan"
jest.setTimeout(300000)
describe("setup-conan", () => {

View File

@ -1,6 +1,6 @@
import { setupCppcheck } from "../cppcheck"
import { testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { setupCppcheck } from "../cppcheck"
jest.setTimeout(300000)
describe("setup-cppcheck", () => {

View File

@ -1,12 +1,12 @@
import { addPath } from "../utils/env/addEnv"
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 { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupCppcheck(version: string | undefined, _setupDir: string, _arch: string) {

View File

@ -1,10 +1,10 @@
import { setupDoxygen } from "../doxygen"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { getVersion } from "../../versions/versions"
import which from "which"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { macosVersion } from "../../utils/env/macos_version"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { setupDoxygen } from "../doxygen"
jest.setTimeout(300000)
describe("setup-doxygen", () => {

View File

@ -1,24 +1,24 @@
import { info, notice } from "ci-log"
import { addExeExt, join } from "patha"
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 { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { addExeExt, join } from "patha"
import { extractTar, extractZip } from "../utils/setup/extract"
import { info, notice } from "ci-log"
import { setupGraphviz } from "../graphviz/graphviz"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { getVersion } from "../versions/versions"
import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
import { pathExists } from "path-exists"
import retry from "retry-as-promised"
import { ubuntuVersion } from "../utils/env/ubuntu_version"
import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu"
import { macosVersion } from "../utils/env/macos_version"
import { ubuntuVersion } from "../utils/env/ubuntu_version"
import { setupDmg } from "../utils/setup/setupDmg"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
/** Get the platform data for cmake */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@ -128,11 +128,13 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
async function activateWinDoxygen() {
switch (process.platform) {
case "win32": {
for (const binDir of [
"C:/ProgramData/chocolatey/bin",
"C:/Program Files/doxygen/bin",
"C:/Program Files (x86)/doxygen",
]) {
for (
const binDir of [
"C:/ProgramData/chocolatey/bin",
"C:/Program Files/doxygen/bin",
"C:/Program Files (x86)/doxygen",
]
) {
// eslint-disable-next-line no-await-in-loop
if (await pathExists(join(binDir, "doxygen.exe"))) {
// eslint-disable-next-line no-await-in-loop

View File

@ -1,10 +1,10 @@
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { setupGcc } from "../gcc"
import { getVersion } from "../../versions/versions"
import { join, addExeExt } from "patha"
import { execaSync } from "execa"
import { chmodSync } from "fs"
import { addExeExt, join } from "patha"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { setupGcc } from "../gcc"
jest.setTimeout(3000000)
describe("setup-gcc", () => {

View File

@ -1,23 +1,23 @@
import { addPath, addEnv } from "../utils/env/addEnv"
import { addEnv, addPath } from "../utils/env/addEnv"
import { setupAptPack, updateAptAlternatives } from "../utils/setup/setupAptPack"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import semverMajor from "semver/functions/major"
import semverCoerce from "semver/functions/coerce"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk"
import { join, addExeExt } from "patha"
import { warning, info } from "ci-log"
import { GITHUB_ACTIONS } from "ci-info"
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
import { extract7Zip } from "../utils/setup/extract"
import { info, warning } from "ci-log"
import { ExecaReturnValue } from "execa"
import { pathExists } from "path-exists"
import { addExeExt, join } from "patha"
import semverCoerce from "semver/functions/coerce"
import semverMajor from "semver/functions/major"
import { setupMacOSSDK } from "../macos-sdk/macos-sdk"
import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu"
import { hasDnf } from "../utils/env/hasDnf"
import { extract7Zip } from "../utils/setup/extract"
import { setupAptPack, updateAptAlternatives } from "../utils/setup/setupAptPack"
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { pathExists } from "path-exists"
import { ExecaReturnValue } from "execa"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
interface MingwInfo {
releaseName: string
@ -69,7 +69,8 @@ function getGccPackageInfo(version: string, platform: NodeJS.Platform, arch: str
binFileName: addExeExt("g++"),
extractedFolderName: "mingw64",
extractFunction: extract7Zip,
url: `https://github.com/brechtsanders/winlibs_mingw/releases/download/${mingwInfo.releaseName}/winlibs-${mingwArch}-posix-${exceptionModel}-gcc-${mingwInfo.fileSuffix}.7z`,
url:
`https://github.com/brechtsanders/winlibs_mingw/releases/download/${mingwInfo.releaseName}/winlibs-${mingwArch}-posix-${exceptionModel}-gcc-${mingwInfo.fileSuffix}.7z`,
}
}
default:
@ -171,11 +172,11 @@ export async function setupMingw(version: string, setupDir: string, arch: string
}
if (installationInfo !== undefined) {
// TODO: setup alternatives and update CC/CXX env. ?
//Setting up g++-mingw-w64-i686-win32 (10.3.0-14ubuntu1+24.3) ...
// Setting up g++-mingw-w64-i686-win32 (10.3.0-14ubuntu1+24.3) ...
// update-alternatives: using /usr/bin/i686-w64-mingw32-g++-win32 to provide /usr/bin/i686-w64-mingw32-g++ (i686-w64-mingw32-g++) in auto mode
//Setting up g++-mingw-w64-x86-64-win32 (10.3.0-14ubuntu1+24.3) ...
// Setting up g++-mingw-w64-x86-64-win32 (10.3.0-14ubuntu1+24.3) ...
// update-alternatives: using /usr/bin/x86_64-w64-mingw32-g++-win32 to provide /usr/bin/x86_64-w64-mingw32-g++ (x86_64-w64-mingw32-g++) in auto mode
//await activateGcc(version, installationInfo.binDir)
// await activateGcc(version, installationInfo.binDir)
return installationInfo
}
return undefined

View File

@ -1,7 +1,7 @@
import { setupGcovr } from "../gcovr"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { setupGcovr } from "../gcovr"
jest.setTimeout(300000)
describe("setup-gcovr", () => {

View File

@ -1,7 +1,7 @@
import semverMajor from "semver/functions/major"
import semverValid from "semver/functions/valid"
import { addEnv } from "../utils/env/addEnv"
import { setupPipPack } from "../utils/setup/setupPipPack"
import semverValid from "semver/functions/valid"
import semverMajor from "semver/functions/major"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupGcovr(version: string | undefined, _setupDir: string, _arch: string) {

View File

@ -1,9 +1,9 @@
import { setupGraphviz } from "../graphviz"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { getVersion } from "../../versions/versions"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { macosVersion } from "../../utils/env/macos_version"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { setupGraphviz } from "../graphviz"
jest.setTimeout(300000)
describe("setup-graphviz", () => {

View File

@ -1,13 +1,13 @@
import { addPath } from "../utils/env/addEnv"
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 { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { InstallationInfo } from "../utils/setup/setupBin"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupGraphviz(version: string, _setupDir: string, _arch: string) {

View File

@ -1,12 +1,12 @@
import { endGroup, startGroup } from "@actions/core"
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 { setupVCVarsall } from "./vcvarsall/vcvarsall"
import { getVersion } from "./versions/versions"
import pTimeout from "p-timeout"
import { ToolName, setups } from "./tool"
export const DEFAULT_TIMEOUT = 20 * 60 * 1000 // 20 minutes

View File

@ -1,8 +1,8 @@
import { setupKcov } from "../kcov"
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { InstallationInfo } from "../../utils/setup/setupBin"
import which from "which"
import { info } from "@actions/core"
import which from "which"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { setupKcov } from "../kcov"
jest.setTimeout(300000)
describe("setup-Kcov", () => {

View File

@ -1,21 +1,21 @@
import { info } from "ci-log"
import { execa } from "execa"
import { join, addExeExt } from "patha"
import { addExeExt, join } from "patha"
import { untildifyUser } from "untildify-user"
import which from "which"
import { setupCmake } from "../cmake/cmake"
import { getVersion } from "../versions/versions"
import { setupNinja } from "../ninja/ninja"
import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch"
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 { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { addVPrefix, removeVPrefix } from "../utils/setup/version"
import { info } from "ci-log"
import { untildifyUser } from "untildify-user"
import { setupNinja } from "../ninja/ninja"
import { ubuntuVersion } from "../utils/env/ubuntu_version"
import { getVersion } from "../versions/versions"
function getDownloadKcovPackageInfo(version: string): PackageInfo {
return {

View File

@ -1,13 +1,13 @@
import { setupLLVM, setupClangTools, setupClangFormat } from "../llvm"
import { getSpecificVersionAndUrl } from "../../utils/setup/version"
import { isUrlOnline } from "is-url-online"
import { setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { execaSync } from "execa"
import path, { addExeExt } from "patha"
import { chmodSync } from "fs"
import { getVersion } from "../../versions/versions"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import * as io from "@actions/io"
import { execaSync } from "execa"
import { chmodSync } from "fs"
import { isUrlOnline } from "is-url-online"
import path, { addExeExt } from "patha"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
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"
jest.setTimeout(400000)
@ -27,24 +27,33 @@ describe("setup-llvm", () => {
it("Finds URL for ubuntu version", async () => {
expect(
await getSpecificVersionAndUrl(VERSIONS, "linux", "13.0.0-ubuntu-16.04", (_plantform, version) =>
getLinuxUrl(version),
await getSpecificVersionAndUrl(
VERSIONS,
"linux",
"13.0.0-ubuntu-16.04",
(_plantform, version) => getLinuxUrl(version),
),
).toStrictEqual([
"13.0.0-ubuntu-16.04",
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
])
expect(
await getSpecificVersionAndUrl(VERSIONS, "linux", "13.0.1-ubuntu-18.04", (_plantform, version) =>
getLinuxUrl(version),
await getSpecificVersionAndUrl(
VERSIONS,
"linux",
"13.0.1-ubuntu-18.04",
(_plantform, version) => getLinuxUrl(version),
),
).toStrictEqual([
"13.0.1-ubuntu-18.04",
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
])
expect(
await getSpecificVersionAndUrl(VERSIONS, "linux", "13.0.0-ubuntu-20.04", (_plantform, version) =>
getLinuxUrl(version),
await getSpecificVersionAndUrl(
VERSIONS,
"linux",
"13.0.0-ubuntu-20.04",
(_plantform, version) => getLinuxUrl(version),
),
).toStrictEqual([
"13.0.0-ubuntu-20.04",

View File

@ -1,11 +1,11 @@
import { execRoot } from "admina"
import { info } from "console"
import { execa } from "execa"
import { promises } from "fs"
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 { promises } from "fs"
import { info } from "console"
import { DEFAULT_TIMEOUT } from "../installTool"
const { readFile, writeFile, chmod } = promises
export enum LLVMPackages {
@ -72,7 +72,7 @@ function nonInteractiveScript(script: string) {
return script.replace(
/add-apt-repository "\${REPO_NAME}"/g,
// eslint-disable-next-line no-template-curly-in-string
'add-apt-repository -y "${REPO_NAME}"',
"add-apt-repository -y \"${REPO_NAME}\"",
)
}
@ -80,7 +80,7 @@ async function removeConflictingPackages(givenScript: string) {
// fix conflicts between libclang-rt and libclang
let script = givenScript.replace(
/apt-get install -y/g,
'apt-get install -o Dpkg::Options::="--force-overwrite" -y --fix-broken',
"apt-get install -o Dpkg::Options::=\"--force-overwrite\" -y --fix-broken",
)
// check if these are installed and if so, remove them from the script as they conflict

View File

@ -1,14 +1,14 @@
import semverLte from "semver/functions/lte"
import { isUrlOnline } from "is-url-online"
import { getSpecificVersionAndUrl, getSpecificVersions, getVersions } from "../utils/setup/version"
import { info, warning } from "ci-log"
import { PackageInfo } from "../utils/setup/setupBin"
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 { getSpecificVersionAndUrl, getSpecificVersions, getVersions } from "../utils/setup/version"
//================================================
// ================================================
// Version
//================================================
// ================================================
/** The specific and minimum LLVM versions supported by this action. */
export const VERSIONS: Set<string> = getVersions([
@ -189,9 +189,9 @@ const UBUNTU_SUFFIX_MAP: { [key: string]: string } = {
/** The latest supported LLVM version for the Linux (Ubuntu) platform. */
const MAX_UBUNTU: string = "17.0.6"
//================================================
// ================================================
// URL
//================================================
// ================================================
/** Gets a LLVM download URL for GitHub. */
function getGitHubUrl(version: string, prefix: string, suffix: string): string {
@ -317,11 +317,10 @@ export async function getLLVMPackageInfo(
extractedFolderName: "",
binRelativeDir: "bin",
binFileName: addExeExt("clang"),
extractFunction:
platform === "win32"
? extractExe
: (file: string, dest: string) => {
return extractTarByExe(file, dest, ["--strip-components=1"])
},
extractFunction: platform === "win32"
? extractExe
: (file: string, dest: string) => {
return extractTarByExe(file, dest, ["--strip-components=1"])
},
}
}

View File

@ -1,6 +1,6 @@
import { getExecOutput } from "@actions/exec"
import { addEnv } from "../utils/env/addEnv"
import { error } from "ci-log"
import { addEnv } from "../utils/env/addEnv"
export async function setupMacOSSDK() {
if (process.platform === "darwin") {

View File

@ -11,13 +11,13 @@ import { untildifyUser } from "untildify-user"
import { checkUpdates } from "./check-updates"
import { parseArgs, printHelp } from "./cli-options"
import { installCompiler } from "./compilers"
import { installTool } from "./installTool"
import { tools } from "./tool"
import { finalizeCpprc } from "./utils/env/addEnv"
import { isArch } from "./utils/env/isArch"
import { ubuntuVersion } from "./utils/env/ubuntu_version"
import { setupPacmanPack } from "./utils/setup/setupPacmanPack"
import { syncVersions } from "./versions/versions"
import { installTool } from "./installTool"
import { tools } from "./tool"
/** The main entry function */
async function main(args: string[]): Promise<number> {

View File

@ -1,6 +1,6 @@
import { setupMake } from "../make"
import { testBin } from "../../utils/tests/test-helpers"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { testBin } from "../../utils/tests/test-helpers"
import { setupMake } from "../make"
jest.setTimeout(300000)
describe("setup-make", () => {

View File

@ -1,12 +1,12 @@
import { addPath } from "../utils/env/addEnv"
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 { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupMake(version: string, _setupDir: string, _arch: string) {

View File

@ -1,7 +1,7 @@
import { setupMeson } from "../meson"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { setupMeson } from "../meson"
jest.setTimeout(300000)
describe("setup-meson", () => {

View File

@ -1,7 +1,7 @@
import which from "which"
import { setupMSVC } from "../msvc"
import { runnerWindowsVersion } from "../../utils/tests/test-helpers"
import { warning } from "ci-log"
import which from "which"
import { runnerWindowsVersion } from "../../utils/tests/test-helpers"
import { setupMSVC } from "../msvc"
jest.setTimeout(300000)
describe("setup-msvc", () => {

View File

@ -2,8 +2,8 @@ import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { setupVCVarsall } from "../vcvarsall/vcvarsall"
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { vsversion_to_versionnumber, findVcvarsall } from "msvc-dev-cmd/lib.js"
import { GITHUB_ACTIONS } from "ci-info"
import { findVcvarsall, vsversion_to_versionnumber } from "msvc-dev-cmd/lib.js"
import { join } from "patha"
import { error, info, warning } from "ci-log"

View File

@ -1,7 +1,7 @@
import { setupNala } from "../nala"
import { testBin } from "../../utils/tests/test-helpers"
import { isUbuntu } from "../../utils/env/isUbuntu"
import { execRootSync } from "admina"
import { isUbuntu } from "../../utils/env/isUbuntu"
import { testBin } from "../../utils/tests/test-helpers"
import { setupNala } from "../nala"
jest.setTimeout(300000)
describe("setup-nala", () => {

View File

@ -1,7 +1,7 @@
import { execRootSync } from "admina"
import { dirname } from "patha"
import which from "which"
import { isUbuntu } from "../utils/env/isUbuntu"
import { execRootSync } from "admina"
import { addAptKeyViaDownload, hasNala, setupAptPack } from "../utils/setup/setupAptPack"
let binDir: string | undefined

View File

@ -1,7 +1,7 @@
import { setupNinja } from "../ninja"
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { GITHUB_ACTIONS } from "ci-info"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { setupNinja } from "../ninja"
jest.setTimeout(300000)
async function testNinja(directory: string) {

View File

@ -1,6 +1,6 @@
import { addExeExt } from "patha"
import { extractZip } from "../utils/setup/extract"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
/** Get the platform name Ninja uses in their download links */
function getNinjaPlatform(platform: NodeJS.Platform) {

View File

@ -1,5 +1,5 @@
import { setupOpencppcoverage } from "../opencppcoverage"
import { testBin } from "../../utils/tests/test-helpers"
import { setupOpencppcoverage } from "../opencppcoverage"
jest.setTimeout(300000)
describe("setup-OpenCppCoverage", () => {

View File

@ -1,7 +1,7 @@
import { setupPowershell } from "../powershell"
import { GITHUB_ACTIONS } from "ci-info"
import { testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { GITHUB_ACTIONS } from "ci-info"
import { setupPowershell } from "../powershell"
jest.setTimeout(300000)
describe("setup-powershell", () => {

View File

@ -1,14 +1,14 @@
import { execRootSync } from "admina"
import { addPath } from "../utils/env/addEnv"
import { hasDnf } from "../utils/env/hasDnf"
import { isArch } from "../utils/env/isArch"
import { isUbuntu } from "../utils/env/isUbuntu"
import { ubuntuVersion } from "../utils/env/ubuntu_version"
import { setupAptPack } from "../utils/setup/setupAptPack"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
import { execRootSync } from "admina"
import { ubuntuVersion } from "../utils/env/ubuntu_version"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupPowershell(version: string | undefined, _setupDir: string, _arch: string) {

View File

@ -1,9 +1,9 @@
import { setupPython } from "../python"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { GITHUB_ACTIONS } from "ci-info"
import { info } from "ci-log"
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { setupPython } from "../python"
jest.setTimeout(300000)
describe("setup-python", () => {

View File

@ -1,12 +1,12 @@
import { useCpythonVersion } from "setup-python/src/find-python"
import { findPyPyVersion } from "setup-python/src/find-pypy"
import { useCpythonVersion } from "setup-python/src/find-python"
import { info, warning } from "ci-log"
import { debug } from "@actions/core"
import { join } from "patha"
import { GITHUB_ACTIONS } from "ci-info"
import { IS_MAC } from "setup-python/src/utils"
import { info, warning } from "ci-log"
import { pathExists } from "path-exists"
import { join } from "patha"
import { IS_MAC } from "setup-python/src/utils"
function isPyPyVersion(versionSpec: string) {
return versionSpec.startsWith("pypy")

View File

@ -5,6 +5,7 @@ import { GITHUB_ACTIONS } from "ci-info"
import { info, warning } from "ci-log"
import { execa } from "execa"
import memoize from "micro-memoize"
import { pathExists } from "path-exists"
import { addExeExt, dirname, join } from "patha"
import which from "which"
import { addPath } from "../utils/env/addEnv"
@ -17,11 +18,10 @@ import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { hasPipx, setupPipPackSystem, setupPipPackWithPython } from "../utils/setup/setupPipPack"
import { isBinUptoDate } from "../utils/setup/version"
import { unique } from "../utils/std"
import { MinVersions } from "../versions/default_versions"
import { pathExists } from "path-exists"
import { hasPipx, setupPipPackSystem, setupPipPackWithPython } from "../utils/setup/setupPipPack"
export async function setupPython(version: string, setupDir: string, arch: string): Promise<InstallationInfo> {
const installInfo = await findOrSetupPython(version, setupDir, arch)

View File

@ -1,6 +1,6 @@
import { setupSccache } from "../sccache"
import { testBin } from "../../utils/tests/test-helpers"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { testBin } from "../../utils/tests/test-helpers"
import { setupSccache } from "../sccache"
jest.setTimeout(300000)
describe("setup-sccache", () => {

View File

@ -1,6 +1,6 @@
import { setupSevenZip } from "../sevenzip"
import { testBin } from "../../utils/tests/test-helpers"
import { InstallationInfo } from "../../utils/setup/setupBin"
import { testBin } from "../../utils/tests/test-helpers"
import { setupSevenZip } from "../sevenzip"
jest.setTimeout(300000)
describe("setup-7z", () => {

View File

@ -1,11 +1,11 @@
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 { setupPacmanPack } from "../utils/setup/setupPacmanPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
import { isArch } from "../utils/env/isArch"
import { hasDnf } from "../utils/env/hasDnf"
import { setupDnfPack } from "../utils/setup/setupDnfPack"
import { isUbuntu } from "../utils/env/isUbuntu"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupSevenZip(version: string, _setupDir: string, _arch: string) {

View File

@ -1,7 +1,7 @@
import { setupTask } from "../task"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { GITHUB_ACTIONS } from "ci-info"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../versions/versions"
import { setupTask } from "../task"
jest.setTimeout(300000)
describe("setup-task", () => {

View File

@ -1,6 +1,6 @@
import { addExeExt } from "patha"
import { extractTarByExe, extractZip } from "../utils/setup/extract"
import { setupBin, PackageInfo, InstallationInfo } from "../utils/setup/setupBin"
import { InstallationInfo, PackageInfo, setupBin } from "../utils/setup/setupBin"
/** Get the platform name task uses in their download links */
function getTaskPlatform(platform: NodeJS.Platform) {

View File

@ -10,7 +10,7 @@ import { setupGcc } from "./gcc/gcc"
import { setupGcovr } from "./gcovr/gcovr"
import { setupGraphviz } from "./graphviz/graphviz"
import { setupKcov } from "./kcov/kcov"
import { setupClangTools, setupLLVM, setupClangFormat } from "./llvm/llvm"
import { setupClangFormat, setupClangTools, setupLLVM } from "./llvm/llvm"
import { setupMake } from "./make/make"
import { setupMeson } from "./meson/meson"
import { setupMSVC } from "./msvc/msvc"

View File

@ -29,11 +29,10 @@ export const {
} = fs.promises
import { promisify } from "util"
export const rm =
"rm" in fs.promises
? (
fs.promises as typeof fs.promises & {
rm: (path: string, options?: fs.RmDirOptions) => Promise<void>
}
).rm
: promisify(fs.unlink)
export const rm = "rm" in fs.promises
? (
fs.promises as typeof fs.promises & {
rm: (path: string, options?: fs.RmDirOptions) => Promise<void>
}
).rm
: promisify(fs.unlink)

View File

@ -4,12 +4,10 @@
import * as stream from "stream"
import { promisify } from "util"
export const pipeline =
"promises" in stream && "pipeline" in (stream as any).promises
? ((stream.promises as any).pipeline as Function)
: promisify(stream.pipeline)
export const pipeline = "promises" in stream && "pipeline" in (stream as any).promises
? ((stream.promises as any).pipeline as Function)
: promisify(stream.pipeline)
export const finished =
"promises" in stream && "finished" in (stream as any).promises
? ((stream.promises as any).finished as Function)
: promisify(stream.finished)
export const finished = "promises" in stream && "finished" in (stream as any).promises
? ((stream.promises as any).finished as Function)
: promisify(stream.finished)

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