Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Shibanov committed Jun 23, 2020
1 parent 103227c commit 96957bd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 46 deletions.
35 changes: 6 additions & 29 deletions .github/workflows/versions.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
name: Validate 'setup-go'
on:
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
schedule:
- cron: 0 0 * * *

Expand All @@ -27,9 +33,6 @@ jobs:
run: __tests__/verify-go.sh ${{ matrix.go }}
shell: bash

- name: Run simple code
run: go run __tests__/simple/simple.go

setup-versions-from-manifest:
name: Setup ${{ matrix.go }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -51,9 +54,6 @@ jobs:
run: __tests__/verify-go.sh ${{ matrix.go }}
shell: bash

- name: Run simple code
run: go run __tests__/simple/simple.go

setup-versions-from-dist:
name: Setup ${{ matrix.go }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -72,26 +72,3 @@ jobs:
- name: verify go
run: __tests__/verify-go.sh ${{ matrix.go }}
shell: bash
- name: Run simple code
run: go run __tests__/simple/simple.go
setup-version-beta:
name: Setup beta ${{ matrix.go }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
go: [1.15beta1]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup-go ${{ matrix.go }}
uses: ./
with:
go-version: ${{ matrix.go }}
stable: false
- name: verify go
run: __tests__/verify-go.sh ${{ matrix.go }}
shell: bash
- name: Run simple code
run: go run __tests__/simple/simple.go
7 changes: 0 additions & 7 deletions __tests__/simple/simple.go

This file was deleted.

11 changes: 4 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6997,8 +6997,8 @@ function installGoVersion(info, auth) {
const downloadPath = yield tc.downloadTool(info.downloadUrl, undefined, auth);
console.log('Extracting Go...');
let extPath = yield extractGoArchive(downloadPath);
if (info.type === "dist") {
extPath = path.join(extPath, "go");
if (info.type === 'dist') {
extPath = path.join(extPath, 'go');
}
console.log('Adding to the cache ...');
return yield tc.cacheDir(extPath, 'go', makeSemver(info.resolvedVersion));
Expand Down Expand Up @@ -7026,7 +7026,7 @@ function getInfoFromManifest(versionSpec, stable, auth) {
const rel = yield tc.findFromManifest(versionSpec, stable, releases);
if (rel && rel.files.length > 0) {
info = {};
info.type = "manifest";
info.type = 'manifest';
info.resolvedVersion = rel.version;
info.downloadUrl = rel.files[0].download_url;
info.fileName = rel.files[0].filename;
Expand All @@ -7038,16 +7038,13 @@ exports.getInfoFromManifest = getInfoFromManifest;
function getInfoFromDist(versionSpec, stable) {
return __awaiter(this, void 0, void 0, function* () {
let version;
if (versionSpec.includes('beta')) {
versionSpec = makeSemver(versionSpec);
}
version = yield findMatch(versionSpec, stable);
if (!version) {
return null;
}
let downloadUrl = `https://storage.googleapis.com/golang/${version.files[0].filename}`;
return {
type: "dist",
type: 'dist',
downloadUrl: downloadUrl,
resolvedVersion: version.version,
fileName: version.files[0].filename
Expand Down
3 changes: 0 additions & 3 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ async function getInfoFromDist(
stable: boolean
): Promise<IGoVersionInfo | null> {
let version: IGoVersion | undefined;
if (versionSpec.includes('beta')) {
versionSpec = makeSemver(versionSpec);
}
version = await findMatch(versionSpec, stable);
if (!version) {
return null;
Expand Down

0 comments on commit 96957bd

Please sign in to comment.