Update deps and fix new lint errors
The new github recommended rules added some rules, i18 is ignored for now. The filename regex from github does not apply to typescript so a custom one is made (kebab-case).
This commit is contained in:
+38
-9
@@ -1,6 +1,15 @@
|
||||
{
|
||||
"plugins": ["jest", "@typescript-eslint"],
|
||||
"extends": ["plugin:github/recommended"],
|
||||
"plugins": [
|
||||
"jest",
|
||||
"@typescript-eslint",
|
||||
"prettier",
|
||||
"github"
|
||||
],
|
||||
"extends": [
|
||||
"plugin:github/recommended",
|
||||
"plugin:github/typescript",
|
||||
"prettier"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 9,
|
||||
@@ -8,16 +17,28 @@
|
||||
"project": "./tsconfig.eslint.json"
|
||||
},
|
||||
"rules": {
|
||||
"prettier/prettier": "error",
|
||||
"filenames/match-regex": [
|
||||
"error",
|
||||
"^[a-z0-9-]+(.test)?$"
|
||||
],
|
||||
"i18n-text/no-en": "off",
|
||||
"eslint-comments/no-use": "off",
|
||||
"import/no-namespace": "off",
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": ["error"],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error"
|
||||
],
|
||||
"@typescript-eslint/explicit-member-accessibility": [
|
||||
"error",
|
||||
{"accessibility": "no-public"}
|
||||
{
|
||||
"accessibility": "no-public"
|
||||
}
|
||||
],
|
||||
"no-shadow": "off",
|
||||
"@typescript-eslint/no-shadow": ["error"],
|
||||
"@typescript-eslint/no-shadow": [
|
||||
"error"
|
||||
],
|
||||
"@typescript-eslint/no-require-imports": "error",
|
||||
"@typescript-eslint/array-type": "error",
|
||||
"@typescript-eslint/await-thenable": "error",
|
||||
@@ -26,9 +47,14 @@
|
||||
"@typescript-eslint/consistent-type-assertions": "error",
|
||||
"@typescript-eslint/explicit-function-return-type": [
|
||||
"error",
|
||||
{"allowExpressions": true}
|
||||
{
|
||||
"allowExpressions": true
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/func-call-spacing": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"@typescript-eslint/func-call-spacing": ["error", "never"],
|
||||
"@typescript-eslint/no-array-constructor": "error",
|
||||
"@typescript-eslint/no-empty-interface": "error",
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
@@ -50,7 +76,10 @@
|
||||
"@typescript-eslint/require-array-sort-compare": "error",
|
||||
"@typescript-eslint/restrict-plus-operands": "error",
|
||||
"semi": "off",
|
||||
"@typescript-eslint/semi": ["error", "never"],
|
||||
"@typescript-eslint/semi": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"@typescript-eslint/type-annotation-spacing": "error",
|
||||
"@typescript-eslint/unbound-method": "error"
|
||||
},
|
||||
@@ -59,4 +88,4 @@
|
||||
"es6": true,
|
||||
"jest/globals": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ This action installs the [NVIDIA® CUDA® Toolkit](https://developer.nvidia.com/
|
||||
|
||||
### `cuda`
|
||||
|
||||
**Optional** The CUDA version to install. View `src/link/windowsLinks.ts` and `src/link/linuxLinks.ts` for available versions.
|
||||
**Optional** The CUDA version to install. View `src/link/windows-links.ts` and `src/link/linux-links.ts` for available versions.
|
||||
|
||||
Default: `'11.2.2'`.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {getLinks} from '../../src/links/getLinks'
|
||||
import {LinuxLinks} from '../../src/links/linuxLinks'
|
||||
import {WindowsLinks} from '../../src/links/windowsLinks'
|
||||
import {LinuxLinks} from '../../src/links/linux-links'
|
||||
import {WindowsLinks} from '../../src/links/windows-links'
|
||||
import {getLinks} from '../../src/links/get-links'
|
||||
|
||||
test.concurrent('getLinks gives a valid ILinks class', async () => {
|
||||
const links = await getLinks()
|
||||
@@ -1,6 +1,6 @@
|
||||
import {SemVer} from 'semver'
|
||||
import {AbstractLinks} from '../../src/links/links'
|
||||
import {LinuxLinks} from '../../src/links/linuxLinks'
|
||||
import {LinuxLinks} from '../../src/links/linux-links'
|
||||
import {SemVer} from 'semver'
|
||||
|
||||
test.concurrent('Linux Cuda versions in descending order', async () => {
|
||||
const wLinks: AbstractLinks = LinuxLinks.Instance
|
||||
@@ -1,6 +1,6 @@
|
||||
import {SemVer} from 'semver'
|
||||
import {WindowsLinks} from '../../src/links/windowsLinks'
|
||||
import {AbstractLinks} from '../../src/links/links'
|
||||
import {SemVer} from 'semver'
|
||||
import {WindowsLinks} from '../../src/links/windows-links'
|
||||
|
||||
test.concurrent('Windows Cuda versions in descending order', async () => {
|
||||
const wLinks: AbstractLinks = WindowsLinks.Instance
|
||||
@@ -45,9 +45,8 @@ test.concurrent(
|
||||
'Windows network Cuda version to URL map contains valid URLs',
|
||||
async () => {
|
||||
for (const version of WindowsLinks.Instance.getAvailableNetworkCudaVersions()) {
|
||||
const url: URL = WindowsLinks.Instance.getNetworkURLFromCudaVersion(
|
||||
version
|
||||
)
|
||||
const url: URL =
|
||||
WindowsLinks.Instance.getNetworkURLFromCudaVersion(version)
|
||||
expect(url).toBeInstanceOf(URL)
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import {getOs, OSType} from '../src/platform'
|
||||
import {OSType, getOs} from '../src/platform'
|
||||
import os from 'os'
|
||||
|
||||
test.concurrent('Return either windows of linux platform', async () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {SemVer} from 'semver'
|
||||
import {Method} from '../src/method'
|
||||
import {SemVer} from 'semver'
|
||||
import {getVersion} from '../src/version'
|
||||
|
||||
test.concurrent.each<Method>(['local', 'network'])(
|
||||
|
||||
+1330
-750
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
+18
@@ -24,6 +24,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
@actions/exec
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/glob
|
||||
MIT
|
||||
@@ -64,6 +73,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/io
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2019 GitHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@actions/tool-cache
|
||||
MIT
|
||||
|
||||
+1
-3910
File diff suppressed because one or more lines are too long
Generated
+1656
-3200
File diff suppressed because it is too large
Load Diff
+23
-21
@@ -23,31 +23,33 @@
|
||||
},
|
||||
"homepage": "https://github.com/Jimver/cuda-toolkit#readme",
|
||||
"volta": {
|
||||
"node": "12.21.0"
|
||||
"node": "12.22.7"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "^0.5.0",
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@actions/glob": "^0.1.1",
|
||||
"@actions/tool-cache": "^1.6.1",
|
||||
"@types/semver": "^7.3.4",
|
||||
"semver": "^7.3.4"
|
||||
"@actions/artifact": "^0.5.2",
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/exec": "^1.1.0",
|
||||
"@actions/glob": "^0.1.2",
|
||||
"@actions/tool-cache": "^1.7.1",
|
||||
"@types/semver": "^7.3.9",
|
||||
"semver": "^7.3.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/node": "^14.14.33",
|
||||
"@typescript-eslint/parser": "^4.17.0",
|
||||
"@vercel/ncc": "^0.25.1",
|
||||
"eslint": "^7.21.0",
|
||||
"eslint-plugin-github": "^4.1.2",
|
||||
"eslint-plugin-jest": "^24.2.1",
|
||||
"jest": "^26.6.3",
|
||||
"jest-circus": "^26.6.3",
|
||||
"js-yaml": "^3.14.1",
|
||||
"prettier": "2.2.1",
|
||||
"ts-jest": "^26.5.3",
|
||||
"typescript": "^4.2.3"
|
||||
"@types/jest": "^27.0.3",
|
||||
"@types/node": "^16.11.11",
|
||||
"@typescript-eslint/parser": "^5.5.0",
|
||||
"@vercel/ncc": "^0.32.0",
|
||||
"eslint": "^8.3.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-github": "^4.3.5",
|
||||
"eslint-plugin-jest": "^25.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"jest": "^27.4.2",
|
||||
"jest-circus": "^27.4.2",
|
||||
"js-yaml": "^4.1.0",
|
||||
"prettier": "2.5.0",
|
||||
"ts-jest": "^27.0.7",
|
||||
"typescript": "^4.5.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {SemVer} from 'semver'
|
||||
import * as core from '@actions/core'
|
||||
import {OSType, getOs} from './platform'
|
||||
import {Method} from './method'
|
||||
import {getOs, OSType} from './platform'
|
||||
import {execReturnOutput} from './runCommand'
|
||||
import {SemVer} from 'semver'
|
||||
import {exec} from '@actions/exec'
|
||||
import {execReturnOutput} from './run-command'
|
||||
|
||||
export async function useApt(method: Method): Promise<boolean> {
|
||||
return method === 'network' && (await getOs()) === OSType.linux
|
||||
+7
-7
@@ -1,13 +1,13 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as tc from '@actions/tool-cache'
|
||||
import {SemVer} from 'semver'
|
||||
import {getLinks} from './links/getLinks'
|
||||
import {AbstractLinks} from './links/links'
|
||||
import {getOs, OSType} from './platform'
|
||||
import fs from 'fs'
|
||||
import * as glob from '@actions/glob'
|
||||
import * as tc from '@actions/tool-cache'
|
||||
import {OSType, getOs} from './platform'
|
||||
import {AbstractLinks} from './links/links'
|
||||
import {Method} from './method'
|
||||
import {WindowsLinks} from './links/windowsLinks'
|
||||
import {SemVer} from 'semver'
|
||||
import {WindowsLinks} from './links/windows-links'
|
||||
import fs from 'fs'
|
||||
import {getLinks} from './links/get-links'
|
||||
|
||||
// Download helper which returns the installer executable and caches it for next runs
|
||||
export async function download(
|
||||
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
import {exec} from '@actions/exec'
|
||||
import * as core from '@actions/core'
|
||||
import {getOs, OSType} from './platform'
|
||||
import * as artifact from '@actions/artifact'
|
||||
import * as core from '@actions/core'
|
||||
import {OSType, getOs} from './platform'
|
||||
import {SemVer} from 'semver'
|
||||
import {exec} from '@actions/exec'
|
||||
|
||||
export async function install(
|
||||
executablePath: string,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {getOs, OSType} from '../platform'
|
||||
import {OSType, getOs} from '../platform'
|
||||
import {AbstractLinks} from './links'
|
||||
import {LinuxLinks} from './linuxLinks'
|
||||
import {WindowsLinks} from './windowsLinks'
|
||||
import {LinuxLinks} from './linux-links'
|
||||
import {WindowsLinks} from './windows-links'
|
||||
|
||||
// Platform independent getter for ILinks interface
|
||||
export async function getLinks(): Promise<AbstractLinks> {
|
||||
@@ -1,5 +1,5 @@
|
||||
import {SemVer} from 'semver'
|
||||
import {AbstractLinks} from './links'
|
||||
import {SemVer} from 'semver'
|
||||
|
||||
// # Dictionary of known cuda versions and thier download URLS, which do not follow a consistent pattern :(
|
||||
// $CUDA_KNOWN_URLS = @{
|
||||
+10
-6
@@ -1,11 +1,11 @@
|
||||
import * as core from '@actions/core'
|
||||
import {download} from './downloader'
|
||||
import {install} from './installer'
|
||||
import {aptInstall, aptSetup, useApt} from './aptInstaller'
|
||||
import {Method, parseMethod} from './method'
|
||||
import {updatePath} from './updatePath'
|
||||
import {OSType, getOs} from './platform'
|
||||
import {aptInstall, aptSetup, useApt} from './apt-installer'
|
||||
import {download} from './downloader'
|
||||
import {getVersion} from './version'
|
||||
import {getOs, OSType} from './platform'
|
||||
import {install} from './installer'
|
||||
import {updatePath} from './update-path'
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
@@ -86,7 +86,11 @@ async function run(): Promise<void> {
|
||||
core.setOutput('cuda', cuda)
|
||||
core.setOutput('CUDA_PATH', cudaPath)
|
||||
} catch (error) {
|
||||
core.setFailed(error.message)
|
||||
if (error instanceof Error) {
|
||||
core.setFailed(error)
|
||||
} else {
|
||||
core.setFailed('Unknown error')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import os from 'os'
|
||||
import {debug} from '@actions/core'
|
||||
import os from 'os'
|
||||
|
||||
export enum OSType {
|
||||
windows = 'windows',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {exec} from '@actions/exec'
|
||||
import * as core from '@actions/core'
|
||||
import {exec} from '@actions/exec'
|
||||
|
||||
export async function execReturnOutput(
|
||||
command: string,
|
||||
@@ -1,7 +1,7 @@
|
||||
import {SemVer} from 'semver'
|
||||
import {getOs, OSType} from './platform'
|
||||
import * as path from 'path'
|
||||
import * as core from '@actions/core'
|
||||
import * as path from 'path'
|
||||
import {OSType, getOs} from './platform'
|
||||
import {SemVer} from 'semver'
|
||||
|
||||
export async function updatePath(version: SemVer): Promise<string> {
|
||||
let cudaPath: string
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
import {SemVer} from 'semver'
|
||||
import {AbstractLinks} from './links/links'
|
||||
import * as core from '@actions/core'
|
||||
import {getLinks} from './links/getLinks'
|
||||
import {OSType, getOs} from './platform'
|
||||
import {AbstractLinks} from './links/links'
|
||||
import {Method} from './method'
|
||||
import {getOs, OSType} from './platform'
|
||||
import {WindowsLinks} from './links/windowsLinks'
|
||||
import {SemVer} from 'semver'
|
||||
import {WindowsLinks} from './links/windows-links'
|
||||
import {getLinks} from './links/get-links'
|
||||
|
||||
// Helper for converting string to SemVer and verifying it exists in the links
|
||||
export async function getVersion(
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
],
|
||||
"settings": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
"editor.formatOnSave": true,
|
||||
"eslint.alwaysShowStatus": true,
|
||||
"eslint.lintTask.enable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user