Remove Setup-Go

Signed-off-by: Steve Coffman <steve@khanacademy.org>
This commit is contained in:
Steve Coffman 2022-02-23 19:33:10 -05:00
parent bcfc6f96bb
commit c7f4666b2b
No known key found for this signature in database
GPG key ID: E0A4049327167A8F
8 changed files with 56509 additions and 52634 deletions

View file

@ -153,7 +153,6 @@ Inside our action we perform 3 steps:
* 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
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`
3. Save cache for later builds

50771
dist/post_run/index.js vendored

File diff suppressed because one or more lines are too long

50771
dist/run/index.js vendored

File diff suppressed because one or more lines are too long

3405
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -5,8 +5,6 @@
"description": "golangci-lint github action",
"main": "dist/main.js",
"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",
"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",
@ -15,7 +13,7 @@
"lint-fix": "eslint **/*.ts --cache --fix",
"format": "prettier --write **/*.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-full-version": "npm run build && act -j test-full-version -b"
},
@ -33,7 +31,6 @@
"@actions/tool-cache": "^1.7.1",
"@types/semver": "^7.3.9",
"@types/tmp": "^0.2.3",
"setup-go": "git+https://github.com/actions/setup-go.git#v2.2.0",
"tmp": "^0.2.1"
},
"devDependencies": {

4
src/deps.d.ts vendored
View file

@ -1,7 +1,3 @@
declare module "setup-go/lib/main" {
function run(): Promise<void>
}
declare module "cache/lib/restore" {
function run(): Promise<void>
export default run

View file

@ -2,7 +2,6 @@ import * as core from "@actions/core"
import * as tc from "@actions/tool-cache"
import os from "os"
import path from "path"
import { run as setupGo } from "setup-go/lib/main"
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`)
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`)
}

View file

@ -7,7 +7,7 @@ import { dir } from "tmp"
import { promisify } from "util"
import { restoreCache, saveCache } from "./cache"
import { installGo, installLint } from "./install"
import { installLint } from "./install"
import { findLintVersion } from "./version"
const execShellCommand = promisify(exec)
@ -85,11 +85,9 @@ async function prepareEnv(): Promise<Env> {
// Prepare cache, lint and go in parallel.
const restoreCachePromise = restoreCache()
const prepareLintPromise = prepareLint()
const installGoPromise = installGo()
const patchPromise = fetchPatch()
const lintPath = await prepareLintPromise
await installGoPromise
await restoreCachePromise
const patchPath = await patchPromise