ci: remove GitHub-hosted actions, manual checkout + Go from CN mirror
Self-hosted Gitea runner has flaky/blocked access to github.com, causing actions/checkout and actions/setup-go to time out intermittently across all jobs. Replace them with: - manual git checkout against $GITHUB_SERVER_URL (the Gitea host, reachable from job containers) - Go installed from mirrors.aliyun.com Python job stays on the python3.12-nodejs20 container (fixes the original PEP 660 editable-install failure). No more github.com network dependency. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
+43
-10
@@ -5,6 +5,10 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
GO_VERSION: "1.23.12"
|
||||||
|
GOPROXY: "https://goproxy.cn,direct"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
go:
|
go:
|
||||||
name: Go (api)
|
name: Go (api)
|
||||||
@@ -25,11 +29,22 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
OPENGOODS_DATABASE_URL: postgres://opengoods:opengoods@postgres:5432/opengoods?sslmode=disable
|
OPENGOODS_DATABASE_URL: postgres://opengoods:opengoods@postgres:5432/opengoods?sslmode=disable
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: actions/setup-go@v5
|
working-directory: ${{ github.workspace }}
|
||||||
with:
|
run: |
|
||||||
go-version: "1.23"
|
git config --global --add safe.directory '*'
|
||||||
cache-dependency-path: api/go.sum
|
git init -q .
|
||||||
|
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
git -c protocol.version=2 fetch -q --no-tags --depth 1 origin "${GITHUB_REF}"
|
||||||
|
git checkout -q --force FETCH_HEAD
|
||||||
|
- name: Setup Go
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
curl -fsSL -o /tmp/go.tgz "https://mirrors.aliyun.com/golang/go${GO_VERSION}.linux-amd64.tar.gz"
|
||||||
|
rm -rf /usr/local/go
|
||||||
|
tar -C /usr/local -xzf /tmp/go.tgz
|
||||||
|
echo "/usr/local/go/bin" >> "$GITHUB_PATH"
|
||||||
|
echo "$HOME/go/bin" >> "$GITHUB_PATH"
|
||||||
- name: Apply migrations
|
- name: Apply migrations
|
||||||
working-directory: .
|
working-directory: .
|
||||||
run: |
|
run: |
|
||||||
@@ -50,7 +65,14 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
working-directory: ingestion
|
working-directory: ingestion
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
git init -q .
|
||||||
|
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
git -c protocol.version=2 fetch -q --no-tags --depth 1 origin "${GITHUB_REF}"
|
||||||
|
git checkout -q --force FETCH_HEAD
|
||||||
- name: Install
|
- name: Install
|
||||||
run: pip install -e ".[dev]"
|
run: pip install -e ".[dev]"
|
||||||
- name: Ruff lint
|
- name: Ruff lint
|
||||||
@@ -76,10 +98,21 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DBURL: postgres://opengoods:opengoods@postgres:5432/opengoods?sslmode=disable
|
DBURL: postgres://opengoods:opengoods@postgres:5432/opengoods?sslmode=disable
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
- uses: actions/setup-go@v5
|
working-directory: ${{ github.workspace }}
|
||||||
with:
|
run: |
|
||||||
go-version: "1.23"
|
git config --global --add safe.directory '*'
|
||||||
|
git init -q .
|
||||||
|
git remote add origin "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
|
||||||
|
git -c protocol.version=2 fetch -q --no-tags --depth 1 origin "${GITHUB_REF}"
|
||||||
|
git checkout -q --force FETCH_HEAD
|
||||||
|
- name: Setup Go
|
||||||
|
run: |
|
||||||
|
curl -fsSL -o /tmp/go.tgz "https://mirrors.aliyun.com/golang/go${GO_VERSION}.linux-amd64.tar.gz"
|
||||||
|
rm -rf /usr/local/go
|
||||||
|
tar -C /usr/local -xzf /tmp/go.tgz
|
||||||
|
echo "/usr/local/go/bin" >> "$GITHUB_PATH"
|
||||||
|
echo "$HOME/go/bin" >> "$GITHUB_PATH"
|
||||||
- name: Install golang-migrate
|
- name: Install golang-migrate
|
||||||
run: go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@v4.18.1
|
run: go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@v4.18.1
|
||||||
- name: Migrate up
|
- name: Migrate up
|
||||||
|
|||||||
Reference in New Issue
Block a user