Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 5 additions & 26 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
with:
fetch-depth: 1 # 浅克隆提升速度

- name: Set up JDK 24
- name: Set up JDK 17
uses: actions/setup-java@v5.0.0
with:
java-version: '24'
java-version: '17'
distribution: 'graalvm'
cache: gradle

Expand Down Expand Up @@ -158,10 +158,10 @@ jobs:
with:
fetch-depth: 1 # 浅克隆

- name: Set up JDK 24
- name: Set up JDK 17
uses: actions/setup-java@v5.0.0
with:
java-version: '24'
java-version: '17'
distribution: 'graalvm'
cache: gradle

Expand Down Expand Up @@ -215,28 +215,7 @@ jobs:
${{ runner.os }}-docker-${{ matrix.group }}-
${{ runner.os }}-docker-

# 🚀 并行预拉取数据库镜像 - 使用更轻量的镜像
- name: Pre-pull database images
if: matrix.containers == 'database'
run: |
echo "🐘 拉取数据库镜像..."
docker pull postgres:16-alpine &
docker pull mysql:8.0 &
docker pull redis:7-alpine &
wait
echo "✅ 数据库镜像拉取完成"
continue-on-error: true

# 🗄️ 预拉取缓存相关镜像
- name: Pre-pull cache images
if: matrix.containers == 'cache'
run: |
echo "📦 拉取缓存镜像..."
docker pull redis:7-alpine &
docker pull minio/minio:RELEASE.2024-01-16T16-07-38Z &
wait
echo "✅ 缓存镜像拉取完成"
continue-on-error: true


- name: Grant execute permission
run: chmod +x gradlew
Expand Down
46 changes: 10 additions & 36 deletions .github/workflows/maven-central-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK 24
- name: Set up JDK 17
uses: actions/setup-java@v5.0.0
with:
java-version: '24'
java-version: '17'
distribution: 'graalvm'
cache: gradle

Expand Down Expand Up @@ -226,10 +226,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK 24
- name: Set up JDK 17
uses: actions/setup-java@v5.0.0
with:
java-version: '24'
java-version: '17'
distribution: 'graalvm'
cache: gradle

Expand Down Expand Up @@ -472,48 +472,22 @@ jobs:
timeout-minutes: 15

steps:
- name: Wait for Maven Central sync
- name: Skip verification (save time)
run: |
echo "⏳ 等待 Maven Central 同步..."
sleep 300 # 等待 5 分钟

- name: Verify publication
run: |
version="${{ needs.pre-publish-validation.outputs.version }}"
group="io.github.truenine"

echo "🔍 验证发布的 artifacts..."

# 检查主要模块是否可用
modules=("shared" "gradle-plugin" "bom")

for module in "${modules[@]}"; do
artifact="${group}:composeserver-${module}:${version}"
echo "检查 $artifact ..."

# 尝试从 Maven Central 获取 metadata
url="https://search.maven.org/solrsearch/select?q=g:${group}+AND+a:composeserver-${module}+AND+v:${version}&rows=1&wt=json"

response=$(curl -s "$url" || echo '{"response":{"numFound":0}}')
found=$(echo "$response" | jq -r '.response.numFound')

if [[ "$found" -gt 0 ]]; then
echo "✅ $artifact 已成功发布"
else
echo "⚠️ $artifact 尚未在 Maven Central 上可见(可能仍在同步中)"
fi
done
echo "⏭️ 跳过 Maven Central 同步验证以节省时间"
echo "📝 发布已完成,Maven Central 同步通常需要几小时"

- name: Generate verification report
run: |
echo "## 🔍 发布验证报告" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**版本:** ${{ needs.pre-publish-validation.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 📊 验证状态" >> $GITHUB_STEP_SUMMARY
echo "### 📊 发布状态" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- ✅ 发布任务已完成" >> $GITHUB_STEP_SUMMARY
echo "- ⏳ Maven Central 同步可能需要几小时" >> $GITHUB_STEP_SUMMARY
echo "- 🔍 建议在 4-6 小时后再次验证" >> $GITHUB_STEP_SUMMARY
echo "- 🔍 建议在 4-6 小时后手动验证可用性" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### 🔗 相关链接" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ package itest.integrate.cacheable

import org.springframework.boot.autoconfigure.SpringBootApplication

@SpringBootApplication
internal class TestEntrance
@SpringBootApplication internal class TestEntrance
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,36 @@ package itest.integrate.cacheable.factory

import io.github.truenine.composeserver.testtoolkit.testcontainers.ICacheRedisContainer
import jakarta.annotation.Resource
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.data.redis.connection.RedisConnectionFactory
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory
import kotlin.test.Test
import kotlin.test.assertIs
import kotlin.test.assertEquals
import kotlin.test.assertIs
import kotlin.test.assertNotNull
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.data.redis.connection.RedisConnectionFactory
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory

@SpringBootTest
class RedisConnectionFactoryIntegrationTest : ICacheRedisContainer {

@Resource
lateinit var factory: RedisConnectionFactory
@Resource lateinit var factory: RedisConnectionFactory

@Test
fun `验证工厂使用最新的RESP3协议连接`() {
val lettuceFactory = assertIs<LettuceConnectionFactory>(factory)

// 验证连接成功
val connection = lettuceFactory.connection
try {
val pingResult = connection.ping()
assertEquals("PONG", pingResult)

// 获取客户端选项并验证协议版本
val clientOptions = lettuceFactory.clientConfiguration.clientOptions.orElse(null)
assertNotNull(clientOptions, "客户端选项不应为空")

// 验证协议版本为 RESP3
val protocolVersion = clientOptions.protocolVersion
assertEquals("RESP3", protocolVersion.toString(), "应该使用最新的 RESP3 协议")

} finally {
connection.close()
}
Expand Down
Loading