Skip to content

Commit

Permalink
Remove Setup-Go (#403)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
StevenACoffman and SVilgelm committed Feb 24, 2022
1 parent bcfc6f9 commit 423fbaf
Show file tree
Hide file tree
Showing 10 changed files with 49,143 additions and 48,240 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- run: |
npm install
npm run all
Expand All @@ -33,6 +34,7 @@ jobs:
pull-requests: read
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: ./
with:
version: ${{ matrix.version }}
Expand All @@ -51,6 +53,7 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: ./
with:
working-directory: sample-go-mod
Expand Down
7 changes: 2 additions & 5 deletions README.md
Expand Up @@ -36,6 +36,7 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
Expand All @@ -52,9 +53,6 @@ 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.
# skip-go-installation: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

Expand Down Expand Up @@ -92,6 +90,7 @@ jobs:
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v2
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
Expand Down Expand Up @@ -133,7 +132,6 @@ The action was implemented with performance in mind:

For example, in a repository of [golangci-lint](https://github.com/golangci/golangci-lint) running this action without the cache takes 50s, but with cache takes 14s:
* in parallel:
* 13s to download Go
* 4s to restore 50 MB of cache
* 1s to find and install `golangci-lint`
* 1s to run `golangci-lint` (it takes 35s without cache)
Expand All @@ -153,7 +151,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

Expand Down
4 changes: 0 additions & 4 deletions action.yml
Expand Up @@ -20,10 +20,6 @@ inputs:
description: "if set to true and the action runs on a pull request - the action outputs only newly found issues"
default: false
required: true
skip-go-installation:
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 doesn't cache or restore ~/go/pkg."
default: false
Expand Down

0 comments on commit 423fbaf

Please sign in to comment.