mirror of
https://github.com/golangci/golangci-lint-action.git
synced 2025-12-20 09:24:39 +00:00
Remove Setup-Go
Signed-off-by: Steve Coffman <steve@khanacademy.org>
This commit is contained in:
parent
bcfc6f96bb
commit
c7f4666b2b
8 changed files with 56509 additions and 52634 deletions
|
|
@ -153,7 +153,6 @@ Inside our action we perform 3 steps:
|
||||||
* restore [cache](https://github.com/actions/cache) of previous analyzes
|
* restore [cache](https://github.com/actions/cache) of previous analyzes
|
||||||
* fetch [action config](https://github.com/golangci/golangci-lint/blob/master/assets/github-action-config.json) and find the latest `golangci-lint` patch version
|
* fetch [action config](https://github.com/golangci/golangci-lint/blob/master/assets/github-action-config.json) and find the latest `golangci-lint` patch version
|
||||||
for needed version (users of this action can specify only minor version of `golangci-lint`). After that install [golangci-lint](https://github.com/golangci/golangci-lint) using [@actions/tool-cache](https://github.com/actions/toolkit/tree/master/packages/tool-cache)
|
for needed version (users of this action can specify only minor version of `golangci-lint`). After that install [golangci-lint](https://github.com/golangci/golangci-lint) using [@actions/tool-cache](https://github.com/actions/toolkit/tree/master/packages/tool-cache)
|
||||||
* install the latest Go 1.x version using [@actions/setup-go](https://github.com/actions/setup-go)
|
|
||||||
2. Run `golangci-lint` with specified by user `args`
|
2. Run `golangci-lint` with specified by user `args`
|
||||||
3. Save cache for later builds
|
3. Save cache for later builds
|
||||||
|
|
||||||
|
|
|
||||||
52797
dist/post_run/index.js
vendored
52797
dist/post_run/index.js
vendored
File diff suppressed because one or more lines are too long
52797
dist/run/index.js
vendored
52797
dist/run/index.js
vendored
File diff suppressed because one or more lines are too long
3405
package-lock.json
generated
3405
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -5,8 +5,6 @@
|
||||||
"description": "golangci-lint github action",
|
"description": "golangci-lint github action",
|
||||||
"main": "dist/main.js",
|
"main": "dist/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare-setup-go": "cd node_modules/setup-go && npm run build",
|
|
||||||
"prepare-deps": "npm run prepare-setup-go",
|
|
||||||
"build": "tsc && ncc build -o dist/run/ src/main.ts && ncc build -o dist/post_run/ src/post_main.ts",
|
"build": "tsc && ncc build -o dist/run/ src/main.ts && ncc build -o dist/post_run/ src/post_main.ts",
|
||||||
"watched_build_main": "tsc && ncc build -w -o dist/run/ src/main.ts",
|
"watched_build_main": "tsc && ncc build -w -o dist/run/ src/main.ts",
|
||||||
"watched_build_post_main": "tsc && ncc build -w -o dist/post_run/ src/post_main.ts",
|
"watched_build_post_main": "tsc && ncc build -w -o dist/post_run/ src/post_main.ts",
|
||||||
|
|
@ -15,7 +13,7 @@
|
||||||
"lint-fix": "eslint **/*.ts --cache --fix",
|
"lint-fix": "eslint **/*.ts --cache --fix",
|
||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --write **/*.ts",
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
"all": "npm run prepare-deps && npm run build && npm run format-check && npm run lint",
|
"all": "npm run build && npm run format-check && npm run lint",
|
||||||
"local": "npm run build && act -j test -b",
|
"local": "npm run build && act -j test -b",
|
||||||
"local-full-version": "npm run build && act -j test-full-version -b"
|
"local-full-version": "npm run build && act -j test-full-version -b"
|
||||||
},
|
},
|
||||||
|
|
@ -33,7 +31,6 @@
|
||||||
"@actions/tool-cache": "^1.7.1",
|
"@actions/tool-cache": "^1.7.1",
|
||||||
"@types/semver": "^7.3.9",
|
"@types/semver": "^7.3.9",
|
||||||
"@types/tmp": "^0.2.3",
|
"@types/tmp": "^0.2.3",
|
||||||
"setup-go": "git+https://github.com/actions/setup-go.git#v2.2.0",
|
|
||||||
"tmp": "^0.2.1"
|
"tmp": "^0.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
4
src/deps.d.ts
vendored
4
src/deps.d.ts
vendored
|
|
@ -1,7 +1,3 @@
|
||||||
declare module "setup-go/lib/main" {
|
|
||||||
function run(): Promise<void>
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "cache/lib/restore" {
|
declare module "cache/lib/restore" {
|
||||||
function run(): Promise<void>
|
function run(): Promise<void>
|
||||||
export default run
|
export default run
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import * as core from "@actions/core"
|
||||||
import * as tc from "@actions/tool-cache"
|
import * as tc from "@actions/tool-cache"
|
||||||
import os from "os"
|
import os from "os"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { run as setupGo } from "setup-go/lib/main"
|
|
||||||
|
|
||||||
import { VersionConfig } from "./version"
|
import { VersionConfig } from "./version"
|
||||||
|
|
||||||
|
|
@ -59,16 +58,3 @@ export async function installLint(versionConfig: VersionConfig): Promise<string>
|
||||||
core.info(`Installed golangci-lint into ${lintPath} in ${Date.now() - startedAt}ms`)
|
core.info(`Installed golangci-lint into ${lintPath} in ${Date.now() - startedAt}ms`)
|
||||||
return lintPath
|
return lintPath
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function installGo(): Promise<void> {
|
|
||||||
const skipGoInstallation = core.getInput(`skip-go-installation`, { required: true }).trim()
|
|
||||||
if (skipGoInstallation.toLowerCase() == "true") {
|
|
||||||
core.info(`Skipping the installation of Go`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const startedAt = Date.now()
|
|
||||||
process.env[`INPUT_GO-VERSION`] = `1`
|
|
||||||
await setupGo()
|
|
||||||
core.info(`Installed Go in ${Date.now() - startedAt}ms`)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { dir } from "tmp"
|
||||||
import { promisify } from "util"
|
import { promisify } from "util"
|
||||||
|
|
||||||
import { restoreCache, saveCache } from "./cache"
|
import { restoreCache, saveCache } from "./cache"
|
||||||
import { installGo, installLint } from "./install"
|
import { installLint } from "./install"
|
||||||
import { findLintVersion } from "./version"
|
import { findLintVersion } from "./version"
|
||||||
|
|
||||||
const execShellCommand = promisify(exec)
|
const execShellCommand = promisify(exec)
|
||||||
|
|
@ -85,11 +85,9 @@ async function prepareEnv(): Promise<Env> {
|
||||||
// Prepare cache, lint and go in parallel.
|
// Prepare cache, lint and go in parallel.
|
||||||
const restoreCachePromise = restoreCache()
|
const restoreCachePromise = restoreCache()
|
||||||
const prepareLintPromise = prepareLint()
|
const prepareLintPromise = prepareLint()
|
||||||
const installGoPromise = installGo()
|
|
||||||
const patchPromise = fetchPatch()
|
const patchPromise = fetchPatch()
|
||||||
|
|
||||||
const lintPath = await prepareLintPromise
|
const lintPath = await prepareLintPromise
|
||||||
await installGoPromise
|
|
||||||
await restoreCachePromise
|
await restoreCachePromise
|
||||||
const patchPath = await patchPromise
|
const patchPath = await patchPromise
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue