Skip to content

Commit

Permalink
CI: upgrade go version to 1.21.5 (#13973)
Browse files Browse the repository at this point in the history
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: #13983

Approved by: @zhangxu19830126, @sukki37
  • Loading branch information
guguducken authored Jan 8, 2024
1 parent f66efc0 commit 594ad8b
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 81 deletions.
20 changes: 6 additions & 14 deletions .github/actions/setup_env/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ inputs:
go-version:
description: 'version of golang'
required: false
default: "1.20"
default: "1.21.5"
cache:
description: 'wether use cache'
required: false
default: "false"

runs:
using: "composite"
Expand All @@ -14,16 +18,4 @@ runs:
uses: actions/setup-go@v4
with:
go-version: ${{ inputs.go-version }}
cache: true


# setup build-in cache: https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs
# - uses: actions/cache@v3
# name: Restore go mod cache
# with:
# path: |
# ~/.cache/go-build
# ~/go/pkg/mod
# key: ${{ runner.os }}-go-mo-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-mo-
cache: ${{ inputs.cache }}
4 changes: 1 addition & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ jobs:
.github/ISSUE_TEMPLATE/*.yml
.github/ISSUE_TEMPLATE/*.yaml
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
uses: ./.github/actions/setup_env
- name: Prepare ENV
run: |
cd $GITHUB_WORKSPACE && make clean && make config && make build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
ref: ${{ github.event.pull_request.base.ref }}

- name: Set up Go
uses: ./head/.github/actions/setup_env
uses: ./upstream/.github/actions/setup_env

- name: Build MatrixOne for head
run: |
Expand Down
27 changes: 4 additions & 23 deletions .github/workflows/merge-trigger-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,31 +119,12 @@ jobs:
with:
path: ./head
- name: Set up Go
run: |
set +e;
GO_VERSION="1.20.9"
for i in {1..10}; do
sudo bash -c "
set -ex;
rm -rf "go$GO_VERSION.linux-amd64.tar.gz";
rm -rf /usr/local/go;
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/;
"
if [ "$?" -eq 0 ]; then
break;
fi
if [ "$i" -ge 10 ]; then
exit 1;
fi
done
echo "/usr/local/go/bin" >> $GITHUB_PATH
echo "$HOME/go/bin" >> $GITHUB_PATH
echo "GOROOT=/usr/local/go" >> $GITHUB_ENV
echo "GOPATH=$HOME/go" >> $GITHUB_ENV
echo "GOPROXY=https://goproxy.cn,direct" >> $GITHUB_ENV
uses: ./head/.github/actions/setup_env
with:
cache: "false"
- name: Build MatrixOne
run: |
export GOPROXY='https://goproxy.cn,direct'
cd $GITHUB_WORKSPACE/head && make clean && make debug
git rev-parse --short HEAD
- name: Start MO
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/merge-trigger-tke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
# add tencentyun docker image mirror and tencentyun apt mirror
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
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
sed -i 's#FROM ubuntu:latest#FROM ccr.ccs.tencentyun.com/cicd-runner/ubuntu:latest#g' optools/images/Dockerfile
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
sed -i 's#FROM ubuntu:22.04#FROM ccr.ccs.tencentyun.com/cicd-runner/ubuntu:22.04#g' optools/images/Dockerfile
docker build -t $TAGS -f optools/images/Dockerfile . --build-arg GOPROXY='https://goproxy.cn,direct'
docker push $TAGS
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ jobs:
run: |
echo ${{ steps.get_release.outputs.upload_url }}
echo ${{ steps.get_release.outputs.tag_name }}
- name: Use Golang
uses: actions/setup-go@v4
with:
go-version: "1.20.11"
cache: false
- name: Set up Go
uses: ./.github/actions/setup_env
- name: Build normal
run: |
make build
Expand Down Expand Up @@ -66,10 +63,9 @@ jobs:
run: |
echo ${{ steps.get_release.outputs.upload_url }}
echo ${{ steps.get_release.outputs.tag_name }}
- name: Use Golang
uses: actions/setup-go@v4
- name: Set up Go
uses: ./.github/actions/setup_env
with:
go-version: "1.20.11"
cache: false
- name: Build normal
run: |
Expand Down Expand Up @@ -126,11 +122,8 @@ jobs:
run: |
echo ${{ steps.get_release.outputs.upload_url }}
echo ${{ steps.get_release.outputs.tag_name }}
- name: Use Golang
uses: actions/setup-go@v4
with:
go-version: "1.20.11"
cache: false
- name: Set up Go
uses: ./.github/actions/setup_env
- name: Build normal
run: |
make build
Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/robot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@ jobs:
uri_notice: ${{ secrets.DOCU_GROUP_HOOK }}
name_label: "doc influence"
mentions: "Prinz,DengNan"

auto-to-project:
runs-on: ubuntu-latest
if: github.event_name == 'issues' && github.event.action == 'opened'
steps:
- name: Add Issue To GitHub Project
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/matrixorigin/projects/13/views/1
github-token: ${{ secrets.TOKEN_ACTION }}
labeled: kind/bug,kind/docs,kind/enhancement,kind/feature,kind/questions,kind/performance,kind/refactoring,kind/subtask
label-operator: OR

nightly-check:
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
Expand All @@ -117,10 +105,9 @@ jobs:
fetch-depth: '3'
path: ./matrixone
- name: Set up Go
uses: actions/setup-go@v4
uses: ./matrixone/.github/actions/setup_env
with:
go-version: '1.20'
cache: true
cache: false
- name: Set Variables
run: |
echo "ut_report='UT-Report.out'" >> $GITHUB_ENV
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/utils.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: true
uses: ./matrixone/.github/actions/setup_env
- name: Set Variables
run: |
cd $GITHUB_WORKSPACE/matrixone
Expand Down
14 changes: 14 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
run:
concurrency: 8
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 5m
Expand Down Expand Up @@ -36,6 +37,19 @@ linters:
- unused

linters-settings:
# https://github.com/golangci/golangci-lint/issues/3877
depguard:
rules:
main:
files:
- "$all"
- "!$test"
allow:
- $gostd
- github.com
deny:
- pkg: github.com/OpenPeeDeeP/depguard
desc: "example to deny some package"
stylecheck:
checks:
- ST1001
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ fmt:

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

Expand Down
2 changes: 1 addition & 1 deletion optools/bvt_ut/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM matrixorigin/tester:go1.20-jdk8
FROM matrixorigin/tester:go1.21.5-jdk8

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

Expand Down
2 changes: 1 addition & 1 deletion optools/bvt_ut/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function run_bvt() {
else
# use test/distributed/cases as default test cases
echo "> test case: test/distributed/cases"
cd mo-tester && ./run.sh -n -g -p /matrixone-test/test/distributed/cases 2>&1
cd mo-tester && ./run.sh -n -g -p /matrixone-test/test/distributed/cases -e optimistic 2>&1
fi
}

Expand Down
2 changes: 1 addition & 1 deletion optools/compose_bvt/Dockerfile.tester
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM matrixorigin/tester:go1.20-jdk8
FROM matrixorigin/tester:go1.21.5-jdk8

WORKDIR /

Expand Down
4 changes: 2 additions & 2 deletions optools/images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20.7-bookworm as builder
FROM golang:1.21.5-bookworm as builder

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

RUN make build

FROM ubuntu:latest
FROM ubuntu:22.04

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

0 comments on commit 594ad8b

Please sign in to comment.