Skip to content

Commit

Permalink
update go action to always get the latest available and other updates (
Browse files Browse the repository at this point in the history
…#1352)

* check and use the latest go available

Signed-off-by: cpanato <[email protected]>

* update to use go 1.17 and always get the latest available

Signed-off-by: cpanato <[email protected]>

* update to use go 1.17 and always get the latest available

* add go1.18 and always get the latest available

Signed-off-by: cpanato <[email protected]>

* update golangci-lint to release 1.45.2

Signed-off-by: cpanato <[email protected]>

* nolint staticcheck for SA1026

Signed-off-by: cpanato <[email protected]>
  • Loading branch information
cpanato authored Apr 21, 2022
1 parent 570ba6c commit 1db6ac0
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ jobs:

strategy:
matrix:
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x]
go-version: [1.14, 1.15, 1.16, 1.17, 1.18]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
check-latest: true

- run: |
go build ./...
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bump-deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.17
check-latest: true

- run: ./hack/bump-deps.sh
- name: Create Pull Request
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Basic e2e test

on:
pull_request:
pull_request:
branches: ['main']

jobs:
Expand All @@ -19,7 +19,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17.x
go-version: 1.17
check-latest: true

- name: crane append to an image, set the entrypoint, run it locally, roundtrip it
shell: bash
Expand Down Expand Up @@ -53,7 +54,7 @@ jobs:
--new_layer crane.tar))
# Run the image with and without args.
docker run $img
docker run $img
docker run $img --help
# Make sure we can roundtrip it through pull/push
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ecr-auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
- name: Set up Go 1.17.x
uses: actions/setup-go@v3
with:
go-version: 1.17.x
go-version: 1.17
check-latest: true

- name: Check out code
uses: actions/checkout@v3
Expand Down Expand Up @@ -51,7 +52,8 @@ jobs:
- name: Set up Go 1.17.x
uses: actions/setup-go@v3
with:
go-version: 1.17.x
go-version: 1.17
check-latest: true

- name: Check out code
uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ghcr-auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17.x
go-version: 1.17
check-latest: true

- name: Install krane
working-directory: ./cmd/krane
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17.x
go-version: 1.17
check-latest: true
- run: ./hack/presubmit.sh
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
run: git fetch --prune --unshallow
- uses: actions/setup-go@v3
with:
go-version: 1.16.x
go-version: 1.17
check-latest: true
- uses: goreleaser/goreleaser-action@v2
with:
version: latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
stale-pr-message: |-
This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.
inactivity. Keep fresh with the 'lifecycle/frozen' label.
stale-pr-label: 'lifecycle/stale'
exempt-pr-labels: 'lifecycle/frozen'

Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.16.x
go-version: 1.17
check-latest: true
- uses: actions/checkout@v3
- uses: chainguard-dev/actions/goimports@84c993eaf02da1c325854fb272a4df9184bd80fc # main

Expand All @@ -24,11 +25,12 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.16.x
go-version: 1.17
check-latest: true

- uses: golangci/[email protected]
with:
version: v1.42.1
version: v1.45.2

- uses: reviewdog/action-misspell@v1
if: ${{ always() }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.14.x, 1.15.x, 1.16.x, 1.17.x]
go-version: [1.14, 1.15, 1.16, 1.17, 1.18]

name: Unit Tests
runs-on: ubuntu-latest
Expand All @@ -21,6 +21,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
check-latest: true

- run: go test -coverprofile=coverage.txt -covermode=atomic -race ./...

Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/transport/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func TestCheckErrorWithError(t *testing.T) {
}}

for _, test := range tests {
b, err := json.Marshal(test.error)
b, err := json.Marshal(test.error) // nolint: staticcheck
if err != nil {
t.Errorf("json.Marshal(%v) = %v", test.error, err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/remote/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ func TestWriteWithErrors(t *testing.T) {
if r.Method != http.MethodPost {
t.Errorf("Method; got %v, want %v", r.Method, http.MethodPost)
}
b, err := json.Marshal(expectedError)
b, err := json.Marshal(expectedError) // nolint: staticcheck
if err != nil {
t.Fatalf("json.Marshal() = %v", err)
}
Expand Down

0 comments on commit 1db6ac0

Please sign in to comment.