Merge pull request #132 from aminya/update-deps [skip ci]

This commit is contained in:
Amin Yahyaabadi 2022-10-19 15:23:57 -07:00 committed by GitHub
commit 83ace57d30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 1260 additions and 1098 deletions

View File

@ -80,8 +80,8 @@ inputs:
required: false required: false
runs: runs:
using: "node12" using: "node16"
main: "dist/setup_cpp.js" main: "dist/node16/setup_cpp.js"
branding: branding:
icon: "award" icon: "award"

View File

@ -11,7 +11,7 @@ RUN pacman -S --noconfirm --needed nodejs
RUN pacman -S --noconfirm --needed curl RUN pacman -S --noconfirm --needed curl
# add setup_cpp.js # add setup_cpp.js
COPY "./dist/" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation

View File

@ -8,7 +8,7 @@ RUN dnf -y install nodejs
RUN dnf -y install curl RUN dnf -y install curl
# add setup_cpp.js # add setup_cpp.js
COPY "./dist/" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation

View File

@ -12,7 +12,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y --no-install-recommends nodejs RUN apt-get install -y --no-install-recommends nodejs
# add setup_cpp.js # add setup_cpp.js
ADD "./dist/" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation

View File

@ -4,7 +4,7 @@ RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends nodejs RUN apt-get install -y --no-install-recommends nodejs
# add setup_cpp.js # add setup_cpp.js
COPY "./dist/" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation

View File

@ -27,7 +27,7 @@ function main() {
return Promise.all( return Promise.all(
exes.map((exe) => exes.map((exe) =>
exec( exec(
`./node_modules/.bin/caxa --input ./dist --output ./exe/setup_cpp_${getPlatformName()}${exe} -- "{{caxa}}/node_modules/.bin/node${exe}" "{{caxa}}/setup_cpp.js"` `./node_modules/.bin/caxa --input ./dist/node16 --output ./exe/setup_cpp_${getPlatformName()}${exe} -- "{{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

2
dist/node12/setup_cpp.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/node12/setup_cpp.js.map vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

17
dist/node16/gcc_matcher.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "gcc",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}

17
dist/node16/llvm_matcher.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "llvm",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}

18
dist/node16/msvc_matcher.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "msvc",
"pattern": [
{
"regexp": "^(?:\\s+\\d+>)?(\\S.*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
]
}
]
}

18
dist/node16/python_matcher.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "python",
"pattern": [
{
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
"file": 1,
"line": 2
},
{
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
"message": 2
}
]
}
]
}

2
dist/node16/setup_cpp.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/node16/setup_cpp.js.map vendored Normal file

File diff suppressed because one or more lines are too long

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,17 +6,17 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"author": "Amin Yahyaabadi", "author": "Amin Yahyaabadi",
"exports": { "exports": {
"import": "./dist/setup-cpp.mjs", "import": "./dist/node12/setup-cpp.mjs",
"require": "./dist/setup-cpp.js" "require": "./dist/node12/setup-cpp.js"
}, },
"main": "./dist/setup_cpp.js", "main": "./dist/node12/setup_cpp.js",
"source": "./src/main.ts", "source": "./src/main.ts",
"bin": { "bin": {
"setup-cpp": "./dist/setup_cpp.js", "setup-cpp": "./dist/node12/setup_cpp.js",
"setup_cpp": "./dist/setup_cpp.js" "setup_cpp": "./dist/node12/setup_cpp.js"
}, },
"scripts": { "scripts": {
"build": "shx rm -rf dist/ && shx mkdir ./dist && run-p lint.tsc build.parcel copy.matchers", "build": "shx rm -rf dist/ && shx mkdir -p ./dist/node12 ./dist/node16 && run-p lint.tsc build.parcel copy.matchers",
"build.docker": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup_cpp .", "build.docker": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup_cpp .",
"build.docker.arch": "pnpm build && docker build -f ./dev/docker/arch_node.dockerfile -t setup_cpp:arch .", "build.docker.arch": "pnpm build && docker build -f ./dev/docker/arch_node.dockerfile -t setup_cpp:arch .",
"build.docker.fedora": "pnpm build && docker build -f ./dev/docker/fedora_node.dockerfile -t setup_cpp:fedora .", "build.docker.fedora": "pnpm build && docker build -f ./dev/docker/fedora_node.dockerfile -t setup_cpp:fedora .",
@ -24,7 +24,7 @@
"build.parcel": "cross-env NODE_ENV=production parcel build --detailed-report", "build.parcel": "cross-env NODE_ENV=production parcel build --detailed-report",
"bump": "ncu -u -x execa,numerous && pnpm update", "bump": "ncu -u -x execa,numerous && pnpm update",
"clean": "shx rm -rf .parcel-cache dist exe", "clean": "shx rm -rf .parcel-cache dist exe",
"copy.matchers": "shx cp ./src/gcc/gcc_matcher.json ./dist/ && shx cp ./src/msvc/msvc_matcher.json ./dist && shx cp ./src/python/python_matcher.json ./dist/ && shx cp ./src/llvm/llvm_matcher.json ./dist/ ", "copy.matchers": "shx cp ./src/gcc/gcc_matcher.json ./dist/node12/ && shx cp ./src/msvc/msvc_matcher.json ./dist/node12/ && shx cp ./src/python/python_matcher.json ./dist/node12/ && shx cp ./src/llvm/llvm_matcher.json ./dist/node12/ && shx cp ./dist/node12/*.json ./dist/node16/",
"dev": "cross-env NODE_ENV=development parcel watch", "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", "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", "format": "run-s lint.prettier",
@ -50,7 +50,7 @@
}, },
"prettier": "prettier-config-atomic", "prettier": "prettier-config-atomic",
"dependencies": { "dependencies": {
"@actions/core": "^1.9.1", "@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1", "@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2", "@actions/io": "^1.1.2",
"@actions/tool-cache": "^2.0.1", "@actions/tool-cache": "^2.0.1",
@ -65,8 +65,8 @@
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1", "msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",
"numerous": "1.0.3", "numerous": "1.0.3",
"patha": "^0.4.1", "patha": "^0.4.1",
"semver": "7.3.7", "semver": "7.3.8",
"setup-python": "github:actions/setup-python#c474c82340438924daab9282d07300bfe7e3692d", "setup-python": "github:actions/setup-python#v4.3.0",
"time-delta": "github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e", "time-delta": "github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e",
"ubuntu-version": "^2.0.0", "ubuntu-version": "^2.0.0",
"untildify-user": "workspace:1.0.0", "untildify-user": "workspace:1.0.0",
@ -75,21 +75,21 @@
}, },
"devDependencies": { "devDependencies": {
"@types/cross-spawn": "^6.0.2", "@types/cross-spawn": "^6.0.2",
"@types/jest": "^29.0.3", "@types/jest": "^29.2.0",
"@types/mri": "^1.1.1", "@types/mri": "^1.1.1",
"@types/node": "^18.7.18", "@types/node": "^18.11.2",
"@types/semver": "^7.3.12", "@types/semver": "^7.3.12",
"@types/which": "^2.0.1", "@types/which": "^2.0.1",
"caxa": "^2.1.0", "caxa": "^3.0.1",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"cross-spawn": "^7.0.3", "cross-spawn": "^7.0.3",
"cspell": "^6.9.1", "cspell": "^6.12.0",
"eslint": "^8.23.1", "eslint": "^8.25.0",
"eslint-config-atomic": "^1.18.1", "eslint-config-atomic": "^1.18.1",
"gen-readme": "^1.6.0", "gen-readme": "^1.6.0",
"jest": "^29.0.3", "jest": "^29.2.1",
"loose-ts-check": "^1.2.0", "loose-ts-check": "^1.2.0",
"npm-check-updates": "^16.1.3", "npm-check-updates": "^16.3.14",
"npm-run-all2": "^6.0.2", "npm-run-all2": "^6.0.2",
"parcel": "2.7.0", "parcel": "2.7.0",
"prettier": "2.7.1", "prettier": "2.7.1",
@ -97,9 +97,9 @@
"readme-md-generator": "^1.0.0", "readme-md-generator": "^1.0.0",
"shx": "0.3.4", "shx": "0.3.4",
"terser-config-atomic": "^0.1.1", "terser-config-atomic": "^0.1.1",
"ts-jest": "^29.0.1", "ts-jest": "^29.0.3",
"ts-readme": "^1.1.3", "ts-readme": "^1.1.3",
"typescript": "^4.8.3" "typescript": "^4.8.4"
}, },
"engines": { "engines": {
"node": ">=12.x" "node": ">=12.x"
@ -127,10 +127,11 @@
"electron": false, "electron": false,
"patha": "patha/dist/index.node.mjs" "patha": "patha/dist/index.node.mjs"
}, },
"main.actions": "./dist/node16/setup_cpp.js",
"pnpm": { "pnpm": {
"overrides": { "overrides": {
"semver": "7.3.7", "semver": "7.3.8",
"eslint": "^8.23.1", "eslint": "^8.25.0",
"prettier": "2.7.1", "prettier": "2.7.1",
"lru-cache": "7.8.1", "lru-cache": "7.8.1",
"core-js": "*", "core-js": "*",
@ -151,6 +152,15 @@
"includeNodeModules": true, "includeNodeModules": true,
"optimize": true, "optimize": true,
"outputFormat": "commonjs" "outputFormat": "commonjs"
},
"main.actions": {
"context": "node",
"engines": {
"node": ">=16.x"
},
"includeNodeModules": true,
"optimize": true,
"outputFormat": "commonjs"
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -5,69 +5,47 @@ import { info, warning } from "ci-log"
import { debug } from "@actions/core" import { debug } from "@actions/core"
import { join } from "patha" import { join } from "patha"
import ciDetect from "@npmcli/ci-detect" import ciDetect from "@npmcli/ci-detect"
import { isCacheFeatureAvailable, IS_LINUX, IS_WINDOWS } from "setup-python/src/utils" import { isCacheFeatureAvailable, IS_MAC } from "setup-python/src/utils"
import { getCacheDistributor } from "setup-python/src/cache-distributions/cache-factory" import { getCacheDistributor } from "setup-python/src/cache-distributions/cache-factory"
function isPyPyVersion(versionSpec: string) { function isPyPyVersion(versionSpec: string) {
return versionSpec.startsWith("pypy") return versionSpec.startsWith("pypy")
} }
/*
function resolveVersionInput(version: string): string {
let versionFile = getInput("python-version-file")
if (version && versionFile) {
warning("Both python-version and python-version-file inputs are specified, only python-version will be used")
}
if (version) {
return version
}
versionFile = versionFile || ".python-version"
if (!existsSync(versionFile)) {
throw new Error(`The specified python version file at: ${versionFile} does not exist`)
}
version = readFileSync(versionFile, "utf8")
info(`Resolved ${versionFile} as ${version}`)
return version
}
*/
export async function cacheDependencies(cache: string, pythonVersion: string) { export async function cacheDependencies(cache: string, pythonVersion: string) {
const cacheDependencyPath = undefined // core.getInput("cache-dependency-path") || undefined const cacheDependencyPath = undefined
const cacheDistributor = getCacheDistributor(cache, pythonVersion, cacheDependencyPath) const cacheDistributor = getCacheDistributor(cache, pythonVersion, cacheDependencyPath)
await cacheDistributor.restoreCache() await cacheDistributor.restoreCache()
} }
const checkLatest = false
export async function setupActionsPython(version: string, _setupDir: string, arch: string) { export async function setupActionsPython(version: string, _setupDir: string, arch: string) {
// According to the README windows binaries do not require to be installed if (IS_MAC) {
// in the specific location, but Mac and Linux do process.env.AGENT_TOOLSDIRECTORY = "/Users/runner/hostedtoolcache"
if (!IS_WINDOWS && !process.env.AGENT_TOOLSDIRECTORY?.trim()) { }
if (IS_LINUX) {
process.env.AGENT_TOOLSDIRECTORY = "/opt/hostedtoolcache" const agent_toolsdirectory = process.env.AGENT_TOOLSDIRECTORY?.trim()
} else { if (typeof agent_toolsdirectory === "string" && agent_toolsdirectory !== "") {
process.env.AGENT_TOOLSDIRECTORY = "/Users/runner/hostedtoolcache"
}
process.env.RUNNER_TOOL_CACHE = process.env.AGENT_TOOLSDIRECTORY process.env.RUNNER_TOOL_CACHE = process.env.AGENT_TOOLSDIRECTORY
} }
debug(`Python is expected to be installed into RUNNER_TOOL_CACHE=${process.env.RUNNER_TOOL_CACHE}`)
// const version = resolveVersionInput(versionGiven) debug(`Python is expected to be installed into ${process.env.RUNNER_TOOL_CACHE}`)
if (version) { if (version) {
let pythonVersion: string let pythonVersion: string
if (isPyPyVersion(version)) { if (isPyPyVersion(version)) {
const installed = await findPyPyVersion(version, arch, true) const installed = await findPyPyVersion(version, arch, true, checkLatest)
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}` pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`
info(`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`) info(`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`)
} else { } else {
const installed = await useCpythonVersion(version, arch, true) const installed = await useCpythonVersion(version, arch, true, checkLatest)
pythonVersion = installed.version pythonVersion = installed.version
info(`Successfully set up ${installed.impl} (${pythonVersion})`) info(`Successfully set up ${installed.impl} (${pythonVersion})`)
} }
if (isCacheFeatureAvailable()) { if (isCacheFeatureAvailable()) {
const cache = "pip" // core.getInput("cache") // package manager used for caching const cache = "pip" // package manager used for caching
await cacheDependencies(cache, pythonVersion) await cacheDependencies(cache, pythonVersion)
} }
} }

View File

@ -2,7 +2,7 @@
"compilerOptions": { "compilerOptions": {
"strict": true, "strict": true,
"strictNullChecks": true, "strictNullChecks": true,
"noUnusedLocals": true, "noUnusedLocals": false,
"noUnusedParameters": true, "noUnusedParameters": true,
"noImplicitReturns": true, "noImplicitReturns": true,
"noImplicitAny": true, "noImplicitAny": true,