mirror of https://github.com/aminya/setup-cpp
lint: use dprint for formatting
This commit is contained in:
parent
5ff0bde949
commit
15f5776d5f
|
@ -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
|
||||
}
|
|
@ -33,6 +33,7 @@ words:
|
|||
- dearmor
|
||||
- deps
|
||||
- devel
|
||||
- dprint
|
||||
- DVCPKG
|
||||
- dyld
|
||||
- eabi
|
||||
|
|
|
@ -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/*
|
||||
|
|
|
@ -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/*
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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/*
|
||||
|
||||
|
|
|
@ -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/*
|
||||
|
||||
|
|
|
@ -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 && \
|
||||
|
|
|
@ -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 && \
|
||||
|
|
|
@ -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/
|
||||
|
|
|
@ -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/
|
||||
|
|
|
@ -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/
|
||||
|
|
|
@ -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/*
|
||||
|
|
|
@ -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/*
|
||||
|
|
|
@ -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/*
|
||||
|
||||
|
|
|
@ -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/*
|
||||
|
||||
|
|
|
@ -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 && \
|
||||
|
|
|
@ -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 && \
|
||||
|
|
|
@ -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 && \
|
||||
|
|
|
@ -12,6 +12,6 @@ async function main() {
|
|||
writeFileSync(`${file}.map`, map)
|
||||
}
|
||||
|
||||
main().catch(function (err) {
|
||||
main().catch(function(err) {
|
||||
throw err
|
||||
})
|
||||
|
|
|
@ -35,7 +35,7 @@ function main() {
|
|||
"--",
|
||||
`{{caxa}}/node_modules/.bin/node${exe}`,
|
||||
`{{caxa}}/setup-cpp.js`,
|
||||
]),
|
||||
])
|
||||
),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
36
package.json
36
package.json
|
@ -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",
|
||||
|
@ -96,11 +94,11 @@
|
|||
"mkdirp": "^3.0.1",
|
||||
"mri": "^1.2.0",
|
||||
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#97843d525947e3f3776ee359b597316909754c4d",
|
||||
"npm-check-updates": "^16.14.15",
|
||||
"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"
|
||||
|
|
|
@ -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 !== "") {
|
||||
|
|
1975
pnpm-lock.yaml
1975
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,2 @@
|
|||
import config from "prettier-config-atomic"
|
||||
export default config
|
|
@ -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", () => {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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, {
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -60,10 +60,10 @@ 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"
|
||||
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)
|
||||
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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 [
|
||||
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
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,8 +317,7 @@ export async function getLLVMPackageInfo(
|
|||
extractedFolderName: "",
|
||||
binRelativeDir: "bin",
|
||||
binFileName: addExeExt("clang"),
|
||||
extractFunction:
|
||||
platform === "win32"
|
||||
extractFunction: platform === "win32"
|
||||
? extractExe
|
||||
: (file: string, dest: string) => {
|
||||
return extractTarByExe(file, dest, ["--strip-components=1"])
|
||||
|
|
|
@ -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") {
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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", () => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -29,8 +29,7 @@ export const {
|
|||
} = fs.promises
|
||||
|
||||
import { promisify } from "util"
|
||||
export const rm =
|
||||
"rm" in fs.promises
|
||||
export const rm = "rm" in fs.promises
|
||||
? (
|
||||
fs.promises as typeof fs.promises & {
|
||||
rm: (path: string, options?: fs.RmDirOptions) => Promise<void>
|
||||
|
|
|
@ -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
|
||||
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
|
||||
export const finished = "promises" in stream && "finished" in (stream as any).promises
|
||||
? ((stream.promises as any).finished as Function)
|
||||
: promisify(stream.finished)
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { exportVariable, addPath as ghAddPath, info, setFailed } from "@actions/core"
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { untildifyUser } from "untildify-user"
|
||||
import { appendFileSync, readFileSync, writeFileSync } from "fs"
|
||||
import { error, warning } from "ci-log"
|
||||
import { execPowershell } from "exec-powershell"
|
||||
import { delimiter } from "path"
|
||||
import escapeSpace from "escape-path-with-spaces"
|
||||
import { addPath as ghAddPath, exportVariable, info, setFailed } from "@actions/core"
|
||||
import { grantUserWriteAccess } from "admina"
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { error, warning } from "ci-log"
|
||||
import escapeSpace from "escape-path-with-spaces"
|
||||
import escapeQuote from "escape-quotes"
|
||||
import { execPowershell } from "exec-powershell"
|
||||
import { appendFileSync, readFileSync, writeFileSync } from "fs"
|
||||
import { delimiter } from "path"
|
||||
import { pathExists } from "path-exists"
|
||||
import { untildifyUser } from "untildify-user"
|
||||
|
||||
type AddEnvOptions = {
|
||||
/** If true, the value will be escaped with quotes and spaces will be escaped with backslash */
|
||||
|
@ -58,7 +58,7 @@ export async function addEnv(
|
|||
|
||||
function escapeString(valGiven: string, shouldEscapeSpace: boolean = false) {
|
||||
const spaceEscaped = shouldEscapeSpace ? escapeSpace(valGiven) : valGiven
|
||||
return escapeQuote(spaceEscaped, '"', "\\")
|
||||
return escapeQuote(spaceEscaped, "\"", "\\")
|
||||
}
|
||||
|
||||
const ignoredPaths = [/\/usr\/bin\/?/, /\/usr\/local\/bin\/?/]
|
||||
|
@ -184,7 +184,8 @@ export async function setupCppInProfile() {
|
|||
|
||||
// source cpprc in bashrc/profile
|
||||
|
||||
const source_cpprc_string = `\n# source .cpprc if SOURCE_CPPRC is not set to 0\nif [[ "$SOURCE_CPPRC" != 0 && -f "${cpprc_path}" ]]; then source "${cpprc_path}"; fi\n`
|
||||
const source_cpprc_string =
|
||||
`\n# source .cpprc if SOURCE_CPPRC is not set to 0\nif [[ "$SOURCE_CPPRC" != 0 && -f "${cpprc_path}" ]]; then source "${cpprc_path}"; fi\n`
|
||||
|
||||
try {
|
||||
// source cpprc in .profile
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
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"
|
||||
import { isUbuntu } from "./isUbuntu"
|
||||
import os from "os"
|
||||
import memoize from "micro-memoize"
|
||||
|
||||
async function ubuntuVersion_raw(): Promise<number[] | null> {
|
||||
try {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { execa } from "execa"
|
||||
import { mkdirP } from "@actions/io"
|
||||
import { grantUserWriteAccess } from "admina"
|
||||
import { warning } from "ci-log"
|
||||
import { execa } from "execa"
|
||||
import which from "which"
|
||||
import { setupSevenZip } from "../../sevenzip/sevenzip"
|
||||
import { warning } from "ci-log"
|
||||
import { grantUserWriteAccess } from "admina"
|
||||
export { extractTar, extractXar } from "@actions/tool-cache"
|
||||
|
||||
let sevenZip: string | undefined
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { InstallationInfo } from "./setupBin"
|
||||
import { execRoot, execRootSync } from "admina"
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { addEnv, cpprc_path, setupCppInProfile } from "../env/addEnv"
|
||||
import { pathExists } from "path-exists"
|
||||
import { promises as fsPromises } from "fs"
|
||||
import { pathExists } from "path-exists"
|
||||
import { addEnv, cpprc_path, setupCppInProfile } from "../env/addEnv"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
const { appendFile } = fsPromises
|
||||
import { execa, ExecaError } from "execa"
|
||||
import { info, warning } from "ci-log"
|
||||
import escapeRegex from "escape-string-regexp"
|
||||
import { warning, info } from "ci-log"
|
||||
import { execa, ExecaError } from "execa"
|
||||
import which from "which"
|
||||
|
||||
/* eslint-disable require-atomic-updates */
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import { find, downloadTool, cacheDir } from "@actions/tool-cache"
|
||||
import { addPath } from "../env/addEnv"
|
||||
import { join } from "patha"
|
||||
import { cacheDir, downloadTool, find } from "@actions/tool-cache"
|
||||
import { info } from "ci-log"
|
||||
import { join } from "patha"
|
||||
import { addPath } from "../env/addEnv"
|
||||
|
||||
import { tmpdir } from "os"
|
||||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { setupAptPack } from "./setupAptPack"
|
||||
import { setupPacmanPack } from "./setupPacmanPack"
|
||||
import { isArch } from "../env/isArch"
|
||||
import { hasDnf } from "../env/hasDnf"
|
||||
import { setupDnfPack } from "./setupDnfPack"
|
||||
import { isUbuntu } from "../env/isUbuntu"
|
||||
import { tmpdir } from "os"
|
||||
import { pathExists } from "path-exists"
|
||||
import retry from "retry-as-promised"
|
||||
import { hasDnf } from "../env/hasDnf"
|
||||
import { isArch } from "../env/isArch"
|
||||
import { isUbuntu } from "../env/isUbuntu"
|
||||
import { setupAptPack } from "./setupAptPack"
|
||||
import { setupDnfPack } from "./setupDnfPack"
|
||||
import { setupPacmanPack } from "./setupPacmanPack"
|
||||
|
||||
/** A type that describes a package */
|
||||
export type PackageInfo = {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/* eslint-disable require-atomic-updates */
|
||||
import { addPath } from "../env/addEnv"
|
||||
import { info } from "ci-log"
|
||||
import { execaSync } from "execa"
|
||||
import which from "which"
|
||||
import { setupChocolatey } from "../../chocolatey/chocolatey"
|
||||
import { addPath } from "../env/addEnv"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
import { execaSync } from "execa"
|
||||
import { info } from "ci-log"
|
||||
|
||||
let hasChoco = false
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { InstallationInfo } from "./setupBin"
|
||||
import { execRootSync } from "admina"
|
||||
import { info, warning } from "ci-log"
|
||||
import { execa } from "execa"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
|
||||
type DnfPackage = {
|
||||
name: string
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { InstallationInfo } from "./setupBin"
|
||||
import { execRootSync } from "admina"
|
||||
import { info, warning } from "ci-log"
|
||||
import { execa, execaSync } from "execa"
|
||||
import which from "which"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
|
||||
/* eslint-disable require-atomic-updates */
|
||||
let didUpdate: boolean = false
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import { info } from "@actions/core"
|
||||
import { execa, execaSync } from "execa"
|
||||
import memoize from "micro-memoize"
|
||||
import { mkdirp } from "mkdirp"
|
||||
import { pathExists } from "path-exists"
|
||||
import { addExeExt, dirname, join } from "patha"
|
||||
import { untildifyUser } from "untildify-user"
|
||||
import which from "which"
|
||||
import { addPythonBaseExecPrefix, setupPython } from "../../python/python"
|
||||
import { addPath } from "../env/addEnv"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
import { getVersion } from "../../versions/versions"
|
||||
import { ubuntuVersion } from "../env/ubuntu_version"
|
||||
import memoize from "micro-memoize"
|
||||
import { isArch } from "../env/isArch"
|
||||
import { setupPacmanPack } from "./setupPacmanPack"
|
||||
import { addPath } from "../env/addEnv"
|
||||
import { hasDnf } from "../env/hasDnf"
|
||||
import { setupDnfPack } from "./setupDnfPack"
|
||||
import { isArch } from "../env/isArch"
|
||||
import { isUbuntu } from "../env/isUbuntu"
|
||||
import { ubuntuVersion } from "../env/ubuntu_version"
|
||||
import { setupAptPack } from "./setupAptPack"
|
||||
import { untildifyUser } from "untildify-user"
|
||||
import { mkdirp } from "mkdirp"
|
||||
import { InstallationInfo } from "./setupBin"
|
||||
import { setupDnfPack } from "./setupDnfPack"
|
||||
import { setupPacmanPack } from "./setupPacmanPack"
|
||||
|
||||
export type SetupPipPackOptions = {
|
||||
/** Whether to use pipx instead of pip */
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { isUrlOnline } from "is-url-online"
|
||||
import semverCompare from "semver/functions/compare"
|
||||
import semverCoerce from "semver/functions/coerce"
|
||||
import semverValid from "semver/functions/valid"
|
||||
import { getExecOutput } from "@actions/exec"
|
||||
import { info } from "ci-log"
|
||||
import { isUrlOnline } from "is-url-online"
|
||||
import semverCoerce from "semver/functions/coerce"
|
||||
import semverCompare from "semver/functions/compare"
|
||||
import semverValid from "semver/functions/valid"
|
||||
|
||||
/**
|
||||
* Gets the specific versions supported by this action compatible with the supplied (specific or minimum) version in
|
||||
|
@ -56,9 +56,11 @@ export async function getSpecificVersionAndUrl(
|
|||
// if the given set doesn't include the version, throw an error
|
||||
if (!versions.has(version)) {
|
||||
throw new Error(
|
||||
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${JSON.stringify(
|
||||
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${
|
||||
JSON.stringify(
|
||||
versions,
|
||||
)}`,
|
||||
)
|
||||
}`,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -79,9 +81,11 @@ export async function getSpecificVersionAndUrl(
|
|||
}
|
||||
|
||||
throw new Error(
|
||||
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${JSON.stringify(
|
||||
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${
|
||||
JSON.stringify(
|
||||
versions,
|
||||
)}`,
|
||||
)
|
||||
}`,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
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"
|
||||
import spawn from "cross-spawn"
|
||||
|
||||
import { pathExists } from "path-exists"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { setupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||
import { setupVcpkg } from "../vcpkg"
|
||||
import { testBin, setupTmpDir } from "../../utils/tests/test-helpers"
|
||||
|
||||
jest.setTimeout(300000)
|
||||
async function testVcpkg(directory: string) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { execaSync } from "execa"
|
||||
import { grantUserWriteAccess } from "admina"
|
||||
import { notice } from "ci-log"
|
||||
import { execaSync } from "execa"
|
||||
import { pathExists } from "path-exists"
|
||||
import { addShExt, addShRelativePrefix, dirname, join } from "patha"
|
||||
import { grantUserWriteAccess } from "admina"
|
||||
import which from "which"
|
||||
import { addPath } from "../utils/env/addEnv"
|
||||
import { hasDnf } from "../utils/env/hasDnf"
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
import { setupMSVCDevCmd } from "msvc-dev-cmd/lib.js"
|
||||
import { addEnv } from "../utils/env/addEnv"
|
||||
import { info } from "ci-log"
|
||||
import { setupMSVCDevCmd } from "msvc-dev-cmd/lib.js"
|
||||
import { pathExists } from "path-exists"
|
||||
import { addEnv } from "../utils/env/addEnv"
|
||||
|
||||
function getArch(arch: string): string {
|
||||
switch (arch) {
|
||||
|
|
|
@ -31,7 +31,7 @@ export const DefaultVersions: Record<string, string | undefined> = {
|
|||
task: "3.33.1", // https://github.com/go-task/task/releases
|
||||
doxygen: isArch() ? "1.10.0-1" : "1.10.0", // https://www.doxygen.nl/download.html // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen // https://formulae.brew.sh/formula/doxygen // https://archlinux.org/packages/extra/x86_64/doxygen/
|
||||
gcc: isArch() ? "13.2.1-3" : "13", // https://github.com/brechtsanders/winlibs_mingw/releases and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc
|
||||
//mingw: isArch() ? "12.2.0-1" : "8", // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=mingw-w64 // https://archlinux.org/packages/extra/x86_64/mingw-w64-gcc/
|
||||
// mingw: isArch() ? "12.2.0-1" : "8", // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=mingw-w64 // https://archlinux.org/packages/extra/x86_64/mingw-w64-gcc/
|
||||
}
|
||||
|
||||
export const MinVersions: Record<string, string | undefined> = {
|
||||
|
|
Loading…
Reference in New Issue