ci: use Aliyun Go mirror and goproxy.cn for China network
Some checks failed
CI / Lint (push) Failing after 3m44s
CI / Test (push) Failing after 3m42s
CI / Build (push) Has been skipped

go.dev/dl redirects to dl.google.com which is blocked in China.
Use mirrors.aliyun.com for Go toolchain download and goproxy.cn
for Go module proxy.
This commit is contained in:
xfy 2026-06-12 16:23:00 +08:00
parent bb0f321849
commit 000a6afc08

View File

@ -10,6 +10,10 @@ on:
permissions:
contents: read
env:
GO_MIRROR: https://mirrors.aliyun.com/golang
GOPROXY: https://goproxy.cn,direct
jobs:
lint:
name: Lint
@ -20,7 +24,7 @@ jobs:
- name: Install Go
run: |
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf -
curl -sL "${GO_MIRROR}/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf -
echo "/usr/local/go/bin" >> $GITHUB_PATH
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
@ -48,7 +52,7 @@ jobs:
- name: Install Go
run: |
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf -
curl -sL "${GO_MIRROR}/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf -
echo "/usr/local/go/bin" >> $GITHUB_PATH
- name: Run unit tests
@ -66,7 +70,7 @@ jobs:
- name: Install Go
run: |
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
curl -sL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf -
curl -sL "${GO_MIRROR}/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xzf -
echo "/usr/local/go/bin" >> $GITHUB_PATH
- name: Build