Skip to content

Commit a987b65

Browse files
committed
Update Github CI flow to use Go 1.18, bump actions versions
1 parent 572466d commit a987b65

File tree

2 files changed

+22
-43
lines changed

2 files changed

+22
-43
lines changed

.github/workflows/echo.yml

+19-40
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- '_fixture/**'
2020
- '.github/**'
2121
- 'codecov.yml'
22+
workflow_dispatch:
2223

2324
jobs:
2425
test:
@@ -27,41 +28,30 @@ jobs:
2728
os: [ubuntu-latest, macos-latest, windows-latest]
2829
# Each major Go release is supported until there are two newer major releases. https://golang.org/doc/devel/release.html#policy
2930
# Echo tests with last four major releases
30-
go: [1.14, 1.15, 1.16, 1.17]
31+
go: [1.16, 1.17, 1.18]
3132
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
3233
runs-on: ${{ matrix.os }}
3334
steps:
34-
- name: Set up Go ${{ matrix.go }}
35-
uses: actions/setup-go@v1
36-
with:
37-
go-version: ${{ matrix.go }}
38-
39-
- name: Set GOPATH and PATH
40-
run: |
41-
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
42-
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH
43-
shell: bash
44-
45-
- name: Set build variables
46-
run: |
47-
echo "GOPROXY=https://proxy.golang.org" >> $GITHUB_ENV
48-
echo "GO111MODULE=on" >> $GITHUB_ENV
49-
5035
- name: Checkout Code
51-
uses: actions/checkout@v1
36+
uses: actions/checkout@v3
5237
with:
5338
ref: ${{ github.ref }}
5439

40+
- name: Set up Go ${{ matrix.go }}
41+
uses: actions/setup-go@v3
42+
with:
43+
go-version: ${{ matrix.go }}
44+
5545
- name: Install Dependencies
56-
run: go get -v golang.org/x/lint/golint
46+
run: go install golang.org/x/lint/golint@latest
5747

5848
- name: Run Tests
5949
run: |
6050
golint -set_exit_status ./...
6151
go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
6252
6353
- name: Upload coverage to Codecov
64-
if: success() && matrix.go == 1.17 && matrix.os == 'ubuntu-latest'
54+
if: success() && matrix.go == 1.18 && matrix.os == 'ubuntu-latest'
6555
uses: codecov/codecov-action@v1
6656
with:
6757
token:
@@ -71,39 +61,28 @@ jobs:
7161
strategy:
7262
matrix:
7363
os: [ubuntu-latest]
74-
go: [1.17]
64+
go: [1.18]
7565
name: Benchmark comparison ${{ matrix.os }} @ Go ${{ matrix.go }}
7666
runs-on: ${{ matrix.os }}
7767
steps:
78-
- name: Set up Go ${{ matrix.go }}
79-
uses: actions/setup-go@v1
80-
with:
81-
go-version: ${{ matrix.go }}
82-
83-
- name: Set GOPATH and PATH
84-
run: |
85-
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
86-
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH
87-
shell: bash
88-
89-
- name: Set build variables
90-
run: |
91-
echo "GOPROXY=https://proxy.golang.org" >> $GITHUB_ENV
92-
echo "GO111MODULE=on" >> $GITHUB_ENV
93-
9468
- name: Checkout Code (Previous)
95-
uses: actions/checkout@v2
69+
uses: actions/checkout@v3
9670
with:
9771
ref: ${{ github.base_ref }}
9872
path: previous
9973

10074
- name: Checkout Code (New)
101-
uses: actions/checkout@v2
75+
uses: actions/checkout@v3
10276
with:
10377
path: new
10478

79+
- name: Set up Go ${{ matrix.go }}
80+
uses: actions/setup-go@v3
81+
with:
82+
go-version: ${{ matrix.go }}
83+
10584
- name: Install Dependencies
106-
run: go get -v golang.org/x/perf/cmd/benchstat
85+
run: go install golang.org/x/perf/cmd/benchstat@latest
10786

10887
- name: Run Benchmark (Previous)
10988
run: |

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tag:
99
check: lint vet race ## Check project
1010

1111
init:
12-
@go get -u golang.org/x/lint/golint
12+
@go install golang.org/x/lint/golint@latest
1313

1414
lint: ## Lint the files
1515
@golint -set_exit_status ${PKG_LIST}
@@ -29,6 +29,6 @@ benchmark: ## Run benchmarks
2929
help: ## Display this help screen
3030
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
3131

32-
goversion ?= "1.15"
33-
test_version: ## Run tests inside Docker with given version (defaults to 1.15 oldest supported). Example: make test_version goversion=1.15
32+
goversion ?= "1.16"
33+
test_version: ## Run tests inside Docker with given version (defaults to 1.15 oldest supported). Example: make test_version goversion=1.16
3434
@docker run --rm -it -v $(shell pwd):/project golang:$(goversion) /bin/sh -c "cd /project && make init check"

0 commit comments

Comments
 (0)