feat: add submodule examples (#4137)

This commit is contained in:
John Guo
2025-02-27 14:35:00 +08:00
committed by GitHub
parent bda42d18ee
commit 2d3ab4f9fb
216 changed files with 260 additions and 11120 deletions

View File

@ -2,6 +2,9 @@
coverage=$1
# update code of submodules
make subup
# find all path that contains go.mod.
for file in `find . -name go.mod`; do
dirpath=$(dirname $file)
@ -18,16 +21,16 @@ for file in `find . -name go.mod`; do
continue 1
fi
# Check if it's a contrib directory or example directory
if [[ $dirpath =~ "/contrib/" ]] || [ "example" = $(basename $dirpath) ]; then
# Check if it's a contrib directory or examples directory
if [[ $dirpath =~ "/contrib/" ]] || [ "examples" = $(basename $dirpath) ]; 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 example directory, only build without tests
if [ "example" = $(basename $dirpath) ]; then
echo "the example directory only needs to be built, not unit tests and coverage tests."
# If it's examples directory, only build without tests
if [ "examples" = $(basename $dirpath) ]; then
echo "the examples directory only needs to be built, not unit tests and coverage tests."
cd $dirpath
go mod tidy
go build ./...

View File

@ -40,7 +40,7 @@ jobs:
# 1. Update the `LATEST_GO_VERSION` env variable.
# 2. Update the `Report Coverage` action.
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
go-version: [ "1.20", "1.21", "1.22", "1.23" ]
go-version: [ "1.22", "1.23" ]
goarch: [ "386", "amd64" ]
runs-on: ubuntu-20.04
@ -157,13 +157,9 @@ jobs:
# Polaris backend server.
# docker run -d --name polaris \
# -p 8090:8090 -p 8091:8091 -p 8093:8093 -p 9090:9090 -p 9091:9091 \
# loads/polaris-server-standalone:1.11.2
#
# docker run -d --name polaris \
# -p 8090:8090 -p 8091:8091 -p 8093:8093 -p 9090:9090 -p 9091:9091 \
# loads/polaris-standalone:v1.16.3
# polarismesh/polaris-standalone:v1.17.2
polaris:
image: loads/polaris-standalone:v1.17.2
image: polarismesh/polaris-standalone:v1.17.2
ports:
- 8090:8090
- 8091:8091

View File

@ -40,7 +40,7 @@ jobs:
# When adding new go version to the list, make sure:
# 1. Update the `LATEST_GO_VERSION` env variable.
# 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
go-version: [ "1.20", "1.21", "1.22", "1.23" ]
go-version: [ "1.22", "1.23" ]
goarch: [ "386", "amd64" ]
runs-on: ubuntu-latest

View File

@ -17,7 +17,7 @@ services:
retries: 10
initializer:
image: loads/curl:latest
image: alpine/curl:latest
depends_on:
nacos:
condition: service_healthy