Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 594ad8b

Browse files
authored
CI: upgrade go version to 1.21.5 (matrixorigin#13973)
also upgrade golangci-lint, but it report this error <img width="654" alt="image" src="https://github.com/matrixorigin/matrixone/assets/22561920/32394ad9-934a-478b-ab2b-24b0ad5ce807"> open issue: matrixorigin#13983 Approved by: @zhangxu19830126, @sukki37
1 parent f66efc0 commit 594ad8b

14 files changed

+43
-81
lines changed

.github/actions/setup_env/action.yaml

+6-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ inputs:
44
go-version:
55
description: 'version of golang'
66
required: false
7-
default: "1.20"
7+
default: "1.21.5"
8+
cache:
9+
description: 'wether use cache'
10+
required: false
11+
default: "false"
812

913
runs:
1014
using: "composite"
@@ -14,16 +18,4 @@ runs:
1418
uses: actions/setup-go@v4
1519
with:
1620
go-version: ${{ inputs.go-version }}
17-
cache: true
18-
19-
20-
# setup build-in cache: https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs
21-
# - uses: actions/cache@v3
22-
# name: Restore go mod cache
23-
# with:
24-
# path: |
25-
# ~/.cache/go-build
26-
# ~/go/pkg/mod
27-
# key: ${{ runner.os }}-go-mo-${{ hashFiles('**/go.sum') }}
28-
# restore-keys: |
29-
# ${{ runner.os }}-go-mo-
21+
cache: ${{ inputs.cache }}

.github/workflows/ci.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ jobs:
8686
.github/ISSUE_TEMPLATE/*.yml
8787
.github/ISSUE_TEMPLATE/*.yaml
8888
- name: Set up Go
89-
uses: actions/setup-go@v4
90-
with:
91-
go-version: '1.20'
89+
uses: ./.github/actions/setup_env
9290
- name: Prepare ENV
9391
run: |
9492
cd $GITHUB_WORKSPACE && make clean && make config && make build

.github/workflows/e2e-upgrade.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
ref: ${{ github.event.pull_request.base.ref }}
2828

2929
- name: Set up Go
30-
uses: ./head/.github/actions/setup_env
30+
uses: ./upstream/.github/actions/setup_env
3131

3232
- name: Build MatrixOne for head
3333
run: |

.github/workflows/merge-trigger-standalone.yaml

+4-23
Original file line numberDiff line numberDiff line change
@@ -119,31 +119,12 @@ jobs:
119119
with:
120120
path: ./head
121121
- name: Set up Go
122-
run: |
123-
set +e;
124-
GO_VERSION="1.20.9"
125-
for i in {1..10}; do
126-
sudo bash -c "
127-
set -ex;
128-
rm -rf "go$GO_VERSION.linux-amd64.tar.gz";
129-
rm -rf /usr/local/go;
130-
wget "https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz" && tar -zxvf "go$GO_VERSION.linux-amd64.tar.gz" -C /usr/local/;
131-
"
132-
if [ "$?" -eq 0 ]; then
133-
break;
134-
fi
135-
136-
if [ "$i" -ge 10 ]; then
137-
exit 1;
138-
fi
139-
done
140-
echo "/usr/local/go/bin" >> $GITHUB_PATH
141-
echo "$HOME/go/bin" >> $GITHUB_PATH
142-
echo "GOROOT=/usr/local/go" >> $GITHUB_ENV
143-
echo "GOPATH=$HOME/go" >> $GITHUB_ENV
144-
echo "GOPROXY=https://goproxy.cn,direct" >> $GITHUB_ENV
122+
uses: ./head/.github/actions/setup_env
123+
with:
124+
cache: "false"
145125
- name: Build MatrixOne
146126
run: |
127+
export GOPROXY='https://goproxy.cn,direct'
147128
cd $GITHUB_WORKSPACE/head && make clean && make debug
148129
git rev-parse --short HEAD
149130
- name: Start MO

.github/workflows/merge-trigger-tke.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ jobs:
4646
4747
# add tencentyun docker image mirror and tencentyun apt mirror
4848
sed -i 's#^RUN apt-get update#RUN sed -i "s?http.*ubuntu\.com?http://mirrors\.tencentyun\.com?g" /etc/apt/sources.list \&\& apt-get clean all \&\& apt-get update#g' optools/images/Dockerfile
49-
sed -i 's#FROM golang:1.20.7-bookworm as builder#FROM ccr.ccs.tencentyun.com/cicd-runner/golang:1.20.7-bookworm as builder#g' optools/images/Dockerfile
50-
sed -i 's#FROM ubuntu:latest#FROM ccr.ccs.tencentyun.com/cicd-runner/ubuntu:latest#g' optools/images/Dockerfile
49+
sed -i 's#FROM golang:1.21.5-bookworm as builder#FROM ccr.ccs.tencentyun.com/cicd-runner/golang:1.21.5-bookworm as builder#g' optools/images/Dockerfile
50+
sed -i 's#FROM ubuntu:22.04#FROM ccr.ccs.tencentyun.com/cicd-runner/ubuntu:22.04#g' optools/images/Dockerfile
5151
5252
docker build -t $TAGS -f optools/images/Dockerfile . --build-arg GOPROXY='https://goproxy.cn,direct'
5353
docker push $TAGS

.github/workflows/release.yml

+6-13
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ jobs:
1919
run: |
2020
echo ${{ steps.get_release.outputs.upload_url }}
2121
echo ${{ steps.get_release.outputs.tag_name }}
22-
- name: Use Golang
23-
uses: actions/setup-go@v4
24-
with:
25-
go-version: "1.20.11"
26-
cache: false
22+
- name: Set up Go
23+
uses: ./.github/actions/setup_env
2724
- name: Build normal
2825
run: |
2926
make build
@@ -66,10 +63,9 @@ jobs:
6663
run: |
6764
echo ${{ steps.get_release.outputs.upload_url }}
6865
echo ${{ steps.get_release.outputs.tag_name }}
69-
- name: Use Golang
70-
uses: actions/setup-go@v4
66+
- name: Set up Go
67+
uses: ./.github/actions/setup_env
7168
with:
72-
go-version: "1.20.11"
7369
cache: false
7470
- name: Build normal
7571
run: |
@@ -126,11 +122,8 @@ jobs:
126122
run: |
127123
echo ${{ steps.get_release.outputs.upload_url }}
128124
echo ${{ steps.get_release.outputs.tag_name }}
129-
- name: Use Golang
130-
uses: actions/setup-go@v4
131-
with:
132-
go-version: "1.20.11"
133-
cache: false
125+
- name: Set up Go
126+
uses: ./.github/actions/setup_env
134127
- name: Build normal
135128
run: |
136129
make build

.github/workflows/robot.yml

+2-15
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,6 @@ jobs:
9595
uri_notice: ${{ secrets.DOCU_GROUP_HOOK }}
9696
name_label: "doc influence"
9797
mentions: "Prinz,DengNan"
98-
99-
auto-to-project:
100-
runs-on: ubuntu-latest
101-
if: github.event_name == 'issues' && github.event.action == 'opened'
102-
steps:
103-
- name: Add Issue To GitHub Project
104-
uses: actions/[email protected]
105-
with:
106-
project-url: https://github.com/orgs/matrixorigin/projects/13/views/1
107-
github-token: ${{ secrets.TOKEN_ACTION }}
108-
labeled: kind/bug,kind/docs,kind/enhancement,kind/feature,kind/questions,kind/performance,kind/refactoring,kind/subtask
109-
label-operator: OR
11098

11199
nightly-check:
112100
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
@@ -117,10 +105,9 @@ jobs:
117105
fetch-depth: '3'
118106
path: ./matrixone
119107
- name: Set up Go
120-
uses: actions/setup-go@v4
108+
uses: ./matrixone/.github/actions/setup_env
121109
with:
122-
go-version: '1.20'
123-
cache: true
110+
cache: false
124111
- name: Set Variables
125112
run: |
126113
echo "ut_report='UT-Report.out'" >> $GITHUB_ENV

.github/workflows/utils.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ jobs:
8888
repository: ${{ github.event.pull_request.head.repo.full_name }}
8989
ref: ${{ github.event.pull_request.head.ref }}
9090
- name: Set up Go
91-
uses: actions/setup-go@v4
92-
with:
93-
go-version: '1.20'
94-
cache: true
91+
uses: ./matrixone/.github/actions/setup_env
9592
- name: Set Variables
9693
run: |
9794
cd $GITHUB_WORKSPACE/matrixone

.golangci.yml

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
run:
2+
concurrency: 8
23
# Timeout for analysis, e.g. 30s, 5m.
34
# Default: 1m
45
timeout: 5m
@@ -36,6 +37,19 @@ linters:
3637
- unused
3738

3839
linters-settings:
40+
# https://github.com/golangci/golangci-lint/issues/3877
41+
depguard:
42+
rules:
43+
main:
44+
files:
45+
- "$all"
46+
- "!$test"
47+
allow:
48+
- $gostd
49+
- github.com
50+
deny:
51+
- pkg: github.com/OpenPeeDeeP/depguard
52+
desc: "example to deny some package"
3953
stylecheck:
4054
checks:
4155
- ST1001

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fmt:
201201

202202
.PHONY: install-static-check-tools
203203
install-static-check-tools:
204-
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $(GOPATH)/bin v1.52.2
204+
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $(GOPATH)/bin v1.55.2
205205
@go install github.com/matrixorigin/linter/cmd/molint@latest
206206
@go install github.com/apache/skywalking-eyes/cmd/[email protected]
207207

optools/bvt_ut/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM matrixorigin/tester:go1.20-jdk8
1+
FROM matrixorigin/tester:go1.21.5-jdk8
22

33
ARG GOPROXY="https://proxy.golang.org,direct"
44

optools/bvt_ut/entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function run_bvt() {
4949
else
5050
# use test/distributed/cases as default test cases
5151
echo "> test case: test/distributed/cases"
52-
cd mo-tester && ./run.sh -n -g -p /matrixone-test/test/distributed/cases 2>&1
52+
cd mo-tester && ./run.sh -n -g -p /matrixone-test/test/distributed/cases -e optimistic 2>&1
5353
fi
5454
}
5555

optools/compose_bvt/Dockerfile.tester

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM matrixorigin/tester:go1.20-jdk8
1+
FROM matrixorigin/tester:go1.21.5-jdk8
22

33
WORKDIR /
44

optools/images/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20.7-bookworm as builder
1+
FROM golang:1.21.5-bookworm as builder
22

33
# goproxy
44
ARG GOPROXY="https://proxy.golang.org,direct"
@@ -19,7 +19,7 @@ COPY . .
1919

2020
RUN make build
2121

22-
FROM ubuntu:latest
22+
FROM ubuntu:22.04
2323

2424
COPY --from=builder /go/src/github.com/matrixorigin/matrixone/mo-service /mo-service
2525
COPY --from=builder /go/src/github.com/matrixorigin/matrixone/etc /etc

0 commit comments

Comments
 (0)