Remove Setup-Go (#403)

* Remove Setup-Go

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Add setup-go to test github actions

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* Modify README and action.yml per review

Signed-off-by: Steve Coffman <steve@khanacademy.org>

* build dist

Co-authored-by: Sergey Vilgelm <sergey@vilgelm.com>
This commit is contained in:
Steve Coffman
2022-02-24 12:34:23 -05:00
committed by GitHub
parent bcfc6f96bb
commit 423fbafafc
10 changed files with 50269 additions and 49366 deletions

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