Skip to content

Commit d2dcdce

Browse files
committed
feat: add discovery module release workflow with testing and verification steps
1 parent 6f1a987 commit d2dcdce

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,72 @@ jobs:
218218
name: rust-docs
219219
path: farp-rust/target/doc/
220220

221+
# Go discovery module release
222+
discovery-release:
223+
name: Discovery Module Release
224+
runs-on: ubuntu-latest
225+
needs: release
226+
227+
steps:
228+
- name: Check out code
229+
uses: actions/checkout@v6
230+
with:
231+
fetch-depth: 0
232+
233+
- name: Set up Go
234+
uses: actions/setup-go@v6
235+
with:
236+
go-version: '1.23'
237+
238+
- name: Check if discovery module exists
239+
id: check_discovery
240+
run: |
241+
if [ -f "discovery/go.mod" ]; then
242+
echo "exists=true" >> $GITHUB_OUTPUT
243+
else
244+
echo "exists=false" >> $GITHUB_OUTPUT
245+
fi
246+
247+
- name: Get latest tag
248+
if: steps.check_discovery.outputs.exists == 'true'
249+
id: get_tag
250+
run: |
251+
git fetch --tags
252+
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
253+
echo "tag=$TAG" >> $GITHUB_OUTPUT
254+
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
255+
256+
- name: Test discovery base module
257+
if: steps.check_discovery.outputs.exists == 'true'
258+
working-directory: discovery
259+
run: |
260+
go mod tidy
261+
go vet ./...
262+
go test -v -race ./...
263+
264+
- name: Test discovery sub-modules
265+
if: steps.check_discovery.outputs.exists == 'true'
266+
run: |
267+
for dir in discovery/redis discovery/consul discovery/etcd discovery/kubernetes discovery/mdns; do
268+
if [ -f "$dir/go.mod" ]; then
269+
echo "=== Testing $dir ==="
270+
cd "$dir"
271+
go mod tidy
272+
go vet ./...
273+
go test -v -race ./...
274+
cd "$GITHUB_WORKSPACE"
275+
fi
276+
done
277+
278+
- name: Verify all discovery modules
279+
if: steps.check_discovery.outputs.exists == 'true'
280+
run: |
281+
for dir in discovery discovery/redis discovery/consul discovery/etcd discovery/kubernetes discovery/mdns; do
282+
if [ -f "$dir/go.mod" ]; then
283+
echo "=== Verifying $dir ==="
284+
cd "$dir"
285+
go mod verify
286+
cd "$GITHUB_WORKSPACE"
287+
fi
288+
done
289+

0 commit comments

Comments
 (0)