This is an automated email from the ASF dual-hosted git repository. lxfeng pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-seata-go.git
The following commit(s) were added to refs/heads/master by this push: new 8afac065 fix action errors (#839) 8afac065 is described below commit 8afac065e1fde9ffd441e88a21c4ce444bf4b3d9 Author: FengZhang <zfc...@qq.com> AuthorDate: Sat Jun 28 21:20:43 2025 +0800 fix action errors (#839) * fix mysql action * update golang version and fix codecov * fix golang version * fix test error * fix code lint --- .github/workflows/build.yml | 37 +++++++++++++--------- .../sql/datasource/base/meta_cache_test.go | 3 +- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0f7b1f9..e1086a80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,26 +32,28 @@ jobs: strategy: matrix: golang: - - 1.18 + - 1.20 + + services: + mysql: + image: mysql:8.0 + env: + # The MySQL docker container requires these environment variables to be set + # so we can create and migrate the test database. + # See: https://hub.docker.com/_/mysql + MYSQL_DATABASE: seata_go_test + MYSQL_ROOT_PASSWORD: seata_go + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: - name: "set up go" uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.20.14 - # close default MySQL-Server - - name: Shutdown default mysql - run: sudo service mysql stop - # run mysql server - - name: Create mysql database auth - uses: mirromutth/mysql-action@v1.1 - with: - host port: 3306 # Optional, default value is 3306. The port of host - container port: 3306 # Optional, default value is 3306. The port of container - mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL - mysql database: 'seata_go_test' # Optional, default value is "test". The specified database which will be create - mysql root password: 'seata_go' # Required if "mysql user" is empty, default is empty. The root superuser password # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - name: "checkout ${{ github.ref }}" uses: actions/checkout@v3 @@ -65,4 +67,9 @@ jobs: run: go test -v ./... -race -coverprofile=coverage.out -covermode=atomic - name: "upload coverage" - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + version: v0.6.0 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/pkg/datasource/sql/datasource/base/meta_cache_test.go b/pkg/datasource/sql/datasource/base/meta_cache_test.go index 134993b8..bcc86b90 100644 --- a/pkg/datasource/sql/datasource/base/meta_cache_test.go +++ b/pkg/datasource/sql/datasource/base/meta_cache_test.go @@ -142,7 +142,8 @@ func TestBaseTableMetaCache_refresh(t *testing.T) { } go c.refresh(tt.args.ctx) time.Sleep(time.Second * 3) - + c.lock.RLock() + defer c.lock.RUnlock() assert.Equal(t, c.cache["TEST"].value, tt.want) }) } --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org