Skip to content

Commit 0e1e294

Browse files
committed
Update workflow
1 parent a9f5742 commit 0e1e294

File tree

1 file changed

+19
-43
lines changed

1 file changed

+19
-43
lines changed

.github/workflows/ci-build.yaml

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
branches:
99
- 'main'
1010

11+
env:
12+
GO_VERSION: '1.23'
13+
1114
jobs:
1215
check-go:
1316
name: Check Go code
@@ -18,10 +21,8 @@ jobs:
1821
- name: Setup Golang
1922
uses: actions/setup-go@v5
2023
with:
21-
go-version: '1.22.4'
22-
- name: Download all Go modules
23-
run: |
24-
go mod download
24+
go-version: ${{ env.GO_VERSION }}
25+
cache: true
2526
- name: Check for tidyness of go.mod and go.sum
2627
run: |
2728
go mod tidy
@@ -34,17 +35,10 @@ jobs:
3435
- name: Checkout code
3536
uses: actions/checkout@v4
3637
- name: Setup Golang
37-
uses: actions/setup-go@v1
38-
with:
39-
go-version: '1.21'
40-
- name: Restore go build cache
41-
uses: actions/cache@v1
38+
uses: actions/setup-go@v5
4239
with:
43-
path: ~/.cache/go-build
44-
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
45-
- name: Download all Go modules
46-
run: |
47-
go mod download
40+
go-version: ${{ env.GO_VERSION }}
41+
cache: true
4842

4943
lint-go:
5044
name: Lint Go code
@@ -53,7 +47,7 @@ jobs:
5347
- name: Checkout code
5448
uses: actions/checkout@v4
5549
- name: Run golangci-lint
56-
uses: golangci/golangci-lint-action@v3
50+
uses: golangci/golangci-lint-action@v4
5751
with:
5852
args: --timeout 5m
5953

@@ -66,27 +60,18 @@ jobs:
6660
- name: Create checkout directory
6761
run: mkdir -p ~/go/src/github.com/gitpod-io
6862
- name: Checkout code
69-
uses: actions/checkout@v4
70-
with:
71-
fetch-depth: 10
63+
uses: actions/checkout@v5
7264
- name: Create symlink in GOPATH
7365
run: ln -s $(pwd) ~/go/src/github.com/gitpod-io/leeway
7466
- name: Setup Golang
75-
uses: actions/setup-go@v1
76-
with:
77-
go-version: '1.21'
78-
- name: Restore go build cache
79-
uses: actions/cache@v1
67+
uses: actions/setup-go@v5
8068
with:
81-
path: ~/.cache/go-build
82-
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
83-
- name: Download and vendor all required packages
84-
run: |
85-
go mod download
69+
go-version: ${{ env.GO_VERSION }}
70+
cache: true
8671
- name: Run all unit tests
8772
run: go test -v -coverprofile=coverage.out $(go list ./...)
8873
- name: Generate code coverage artifacts
89-
uses: actions/upload-artifact@v2
74+
uses: actions/upload-artifact@v4
9075
with:
9176
name: code-coverage
9277
path: coverage.out
@@ -101,22 +86,13 @@ jobs:
10186
run: mkdir -p ~/go/src/github.com/gitpod-io
10287
- name: Checkout code
10388
uses: actions/checkout@v4
104-
with:
105-
fetch-depth: 10
10689
- name: Create symlink in GOPATH
10790
run: ln -s $(pwd) ~/go/src/github.com/gitpod-io/leeway
10891
- name: Setup Golang
109-
uses: actions/setup-go@v1
110-
with:
111-
go-version: '1.21'
112-
- name: Restore go build cache
113-
uses: actions/cache@v1
92+
uses: actions/setup-go@v5
11493
with:
115-
path: ~/.cache/go-build
116-
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
117-
- name: Download and vendor all required packages
118-
run: |
119-
go mod download
94+
go-version: ${{ env.GO_VERSION }}
95+
cache: true
12096
- name: Run all unit tests
12197
run: go test -race -v $(go list ./...)
12298

@@ -134,10 +110,10 @@ jobs:
134110
run: |
135111
mkdir -p test-results
136112
- name: Get code coverage artifiact
137-
uses: actions/download-artifact@v2
113+
uses: actions/download-artifact@v4
138114
with:
139115
name: code-coverage
140116
- name: Upload code coverage information to codecov.io
141-
uses: codecov/codecov-action@v1
117+
uses: codecov/codecov-action@v4
142118
with:
143119
file: coverage.out

0 commit comments

Comments
 (0)