Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
87e1964
fix(ci): add cache cleaning step to prevent 'no space left on device'…
hailaz Nov 17, 2025
8777b52
fix(ci): move cache cleaning step to coverage test section
hailaz Nov 17, 2025
baed124
fix(ci): 在 examples 构建前执行 go clean --cache 避免 CI 出现 "no space left on…
hailaz Nov 17, 2025
0d00c5a
fix(ci): 将 go clean --cache 替换为 go clean -x,并在构建后增加清理以避免 CI “no space…
hailaz Nov 17, 2025
08b7c5f
fix(ci): 调整 CI 缓存清理位置与命令
hailaz Nov 17, 2025
09124f1
feat(ci): 添加 workflow_dispatch 的 debug 输入以支持手动触发远程调试
hailaz Nov 17, 2025
0cbf6da
fix(ci): 取消 TMate 会话触发条件,使其在所有事件下启动
hailaz Nov 17, 2025
aa2f24b
fix(ci): 禁用 TMate 会话的访问限制以支持所有用户
hailaz Nov 18, 2025
95170d5
fix(ci): 添加 GOPATH 修改步骤以确保 Go 环境正确配置
hailaz Nov 18, 2025
02ef979
fix(ci): 移除 GOPATH 修改步骤以简化 CI 流程
hailaz Nov 18, 2025
e722504
ci: test
hailaz Nov 18, 2025
7730929
fix(ci): 更新子 CI 脚本以处理 examples 目录并简化流程
hailaz Nov 19, 2025
6924ca6
fix(ci): 注释掉清理缓存的代码以避免 CI 管道中的空间错误
hailaz Nov 19, 2025
08e231f
fix(ci): 恢复清理缓存的代码以解决 CI 管道中的空间错误
hailaz Nov 19, 2025
0a464a2
fix(ci): 修复 CI 脚本以避免“设备上没有空间”错误,移除不必要的 Docker 清理命令
hailaz Nov 19, 2025
c004e11
fix(ci): 修正 CI 脚本中的描述和路径匹配,以提高可读性和准确性
hailaz Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ on:
- feature/**
- enhance/**
- fix/**
workflow_dispatch:
inputs:
debug:
type: boolean
description: 'Enable tmate Debug'
required: false
default: false

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
Expand Down Expand Up @@ -207,6 +214,13 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v5

- name: Setup tmate Session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug }}
with:
detached: true
limit-access-to-actor: false

- name: Start Apollo Containers
run: docker compose -f ".github/workflows/apollo/docker-compose.yml" up -d --build

Expand Down
29 changes: 12 additions & 17 deletions .github/workflows/scripts/ci-main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

coverage=$1

# update code of submodules
git clone https://github.com/gogf/examples

# update go.mod in examples directory to replace github.com/gogf/gf packages with local directory
bash .github/workflows/scripts/replace_examples_gomod.sh

# find all path that contains go.mod.
for file in `find . -name go.mod`; do
dirpath=$(dirname $file)
Expand All @@ -24,29 +18,30 @@ for file in `find . -name go.mod`; do
continue 1
fi

# Check if it's a contrib directory or examples directory
if [[ $dirpath =~ "/contrib/" ]] || [[ $dirpath =~ "/examples/" ]]; then
# examples directory was moved to sub ci procedure.
if [[ $dirpath =~ "/examples/" ]]; then
continue 1
fi

# Check if it's a contrib directory
if [[ $dirpath =~ "/contrib/" ]]; then
# Check if go version meets the requirement
if ! go version | grep -qE "go${LATEST_GO_VERSION}"; then
echo "ignore path $dirpath as go version is not ${LATEST_GO_VERSION}: $(go version)"
continue 1
fi
# If it's examples directory, only build without tests
if [[ $dirpath =~ "/examples/" ]]; then
echo "the examples directory only needs to be built, not unit tests and coverage tests."
cd $dirpath
go mod tidy
go build ./...
cd -
continue 1
fi
fi

if [[ $file =~ "/testdata/" ]]; then
echo "ignore testdata path $file"
continue 1
fi

if [[ $dirpath = "." ]]; then
# No space left on device error sometimes occurs in CI pipelines, so clean the cache before tests.
go clean -cache
fi

cd $dirpath
go mod tidy
go build ./...
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/scripts/ci-sub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

coverage=$1

# update code of submodules
git clone https://github.com/gogf/examples

# update go.mod in examples directory to replace github.com/gogf/gf packages with local directory
bash .github/workflows/scripts/replace_examples_gomod.sh

# Function to compare version numbers
version_compare() {
local ver1=$1
Expand Down Expand Up @@ -35,7 +41,19 @@ for file in `find . -name go.mod`; do
dirpath=$(dirname $file)
echo "Processing: $dirpath"

# Only process kubecm directory, skip others
# Only process examples and kubecm directories

# Process examples directory (only build, no tests)
if [[ $dirpath =~ "/examples/" ]]; then
echo " the examples directory only needs to be built, not unit tests."
cd $dirpath
go mod tidy
go build ./...
cd -
continue 1
fi

# Process kubecm directory
if [ "kubecm" != $(basename $dirpath) ]; then
echo " Skipping: not kubecm directory"
continue
Expand Down
Loading