Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Aug 11, 2024
1 parent 9c40238 commit 4c5619c
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/develop-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: kitex version tests

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clear repository
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE

- uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22.4

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: build go image
run: |
sh ./go_latest.sh go1.23
PWD=$(pwd)
export GOROOT=$PWD/go1.23
export PATH=$GOROOT/bin:$PATH
go version
continue-on-error: true

- name: run on specific version kitex
run: |
go version
sh ./update_kitext.sh 0bc4a44e9521a73914965c8c3b236e100edd1a95
9 changes: 9 additions & 0 deletions go_latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

TAG=$1

git clone -b release-branch.$TAG https://github.com/golang/go.git $TAG

cd $TAG/src

./all.bash
20 changes: 20 additions & 0 deletions update_kitex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

version=$1

# find go.mod and update dependencies
find . -name go.mod -print0 | while IFS= read -r -d '' script; do
# get absolute dir path
pwd=$(pwd)
script_dir=$(dirname "$script")
cd "$script_dir"
go get -v "github.com/cloudwego/kitex@$version"
go mod tidy
cd "$pwd"
done

find . -name test.sh -print0 | while IFS= read -r -d '' script; do
script_dir=$(dirname "$script")
chmod +x "$script"
(cd "$script_dir" && bash "./$(basename "$script")")
done

0 comments on commit 4c5619c

Please sign in to comment.