mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-16 07:28:27 +00:00
Merge branch 'master' into file-exists
This commit is contained in:
commit
397d3581a5
7 changed files with 12691 additions and 7391 deletions
|
|
@ -48,8 +48,14 @@ jobs:
|
|||
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
||||
# only-new-issues: true
|
||||
|
||||
# Optional: if set to true then the action will use pre-installed Go
|
||||
# Optional: if set to true then the action will use pre-installed Go.
|
||||
# skip-go-installation: true
|
||||
|
||||
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
|
||||
# skip-pkg-cache: true
|
||||
|
||||
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
|
||||
# skip-build-cache: true
|
||||
```
|
||||
|
||||
We recommend running this action in a job separate from other jobs (`go test`, etc)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,14 @@ inputs:
|
|||
description: "if set to true then action uses pre-installed Go"
|
||||
default: false
|
||||
required: true
|
||||
skip-pkg-cache:
|
||||
description: "if set to true then the action don't cache or restore ~/go/pkg."
|
||||
default: false
|
||||
required: true
|
||||
skip-build-cache:
|
||||
description: "if set to true then the action don't cache or restore ~/.cache/go-build."
|
||||
default: false
|
||||
required: true
|
||||
runs:
|
||||
using: "node12"
|
||||
main: "dist/run/index.js"
|
||||
|
|
|
|||
8457
dist/post_run/index.js
vendored
8457
dist/post_run/index.js
vendored
File diff suppressed because it is too large
Load diff
8457
dist/run/index.js
vendored
8457
dist/run/index.js
vendored
File diff suppressed because it is too large
Load diff
3131
package-lock.json
generated
3131
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -26,7 +26,7 @@
|
|||
"author": "golangci",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^1.0.5",
|
||||
"@actions/cache": "^1.0.6",
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/exec": "^1.0.1",
|
||||
"@actions/github": "^4.0.0",
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
"tmp": "^0.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.14.22",
|
||||
"@types/node": "^14.14.25",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
||||
"@typescript-eslint/parser": "^2.34.0",
|
||||
|
|
|
|||
17
src/cache.ts
17
src/cache.ts
|
|
@ -25,7 +25,22 @@ const getLintCacheDir = (): string => {
|
|||
|
||||
const getCacheDirs = (): string[] => {
|
||||
// Not existing dirs are ok here: it works.
|
||||
return [getLintCacheDir(), path.resolve(`${process.env.HOME}/.cache/go-build`), path.resolve(`${process.env.HOME}/go/pkg`)]
|
||||
const skipPkgCache = core.getInput(`skip-pkg-cache`, { required: true }).trim()
|
||||
const skipBuildCache = core.getInput(`skip-build-cache`, { required: true }).trim()
|
||||
const dirs = [getLintCacheDir()]
|
||||
|
||||
if (skipBuildCache.toLowerCase() == "true") {
|
||||
core.info(`Omitting ~/.cache/go-build from cache directories`)
|
||||
} else {
|
||||
dirs.push(path.resolve(`${process.env.HOME}/.cache/go-build`))
|
||||
}
|
||||
if (skipPkgCache.toLowerCase() == "true") {
|
||||
core.info(`Omitting ~/go/pkg from cache directories`)
|
||||
} else {
|
||||
dirs.push(path.resolve(`${process.env.HOME}/go/pkg`))
|
||||
}
|
||||
|
||||
return dirs
|
||||
}
|
||||
|
||||
const getIntervalKey = (invalidationIntervalDays: number): string => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue