Backport #2432

Reviewed-on: https://gitea.com/xorm/xorm/pulls/2458
This commit is contained in:
Lunny Xiao 2024-05-15 01:05:15 +00:00
parent d4f79b8a38
commit ed17be6735
10 changed files with 39 additions and 246 deletions

View File

@ -12,13 +12,13 @@ jobs:
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: setup go - name: setup go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '>=1.20.1' go-version-file: 'go.mod'
- name: Use Go Action - name: Use Go Action
id: use-go-action id: use-go-action
uses: https://gitea.com/actions/release-action@main uses: https://gitea.com/actions/release-action@main

View File

@ -2,42 +2,19 @@ name: test cockroach
on: on:
push: push:
branches: branches:
- master - main
- v1
pull_request: pull_request:
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
RUNNER_TOOL_CACHE: /toolcache # specify with your cache path
jobs: jobs:
test-cockroach: test-cockroach:
name: test cockroach name: test cockroach
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: cache go path - uses: actions/checkout@v4
# id: cache-go-path
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_path
# key: go_path-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_path-${{ github.repository }}-
# go_path-
# - name: cache go cache
# id: cache-go-cache
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_cache
# key: go_cache-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_cache-${{ github.repository }}-
# go_cache-
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.20 go-version-file: 'go.mod'
- uses: actions/checkout@v3
- name: test cockroach - name: test cockroach
env: env:
TEST_COCKROACH_HOST: "cockroach:26257" TEST_COCKROACH_HOST: "cockroach:26257"

View File

@ -2,42 +2,19 @@ name: test mariadb
on: on:
push: push:
branches: branches:
- master - main
- v1
pull_request: pull_request:
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
RUNNER_TOOL_CACHE: /toolcache # specify with your cache path
jobs: jobs:
lint: lint:
name: test mariadb name: test mariadb
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: cache go path - uses: actions/checkout@v4
# id: cache-go-path
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_path
# key: go_path-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_path-${{ github.repository }}-
# go_path-
# - name: cache go cache
# id: cache-go-cache
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_cache
# key: go_cache-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_cache-${{ github.repository }}-
# go_cache-
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.20 go-version-file: 'go.mod'
- uses: actions/checkout@v3
- name: test mariadb - name: test mariadb
env: env:
TEST_MYSQL_HOST: mariadb TEST_MYSQL_HOST: mariadb

View File

@ -2,42 +2,19 @@ name: test mssql
on: on:
push: push:
branches: branches:
- master - main
- v1
pull_request: pull_request:
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
RUNNER_TOOL_CACHE: /toolcache # specify with your cache path
jobs: jobs:
test-mssql-collation: test-mssql-collation:
name: test mssql with collation name: test mssql with collation
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: cache go path - uses: actions/checkout@v4
# id: cache-go-path - uses: actions/setup-go@v5
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_path
# key: go_path-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_path-${{ github.repository }}-
# go_path-
# - name: cache go cache
# id: cache-go-cache
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_cache
# key: go_cache-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_cache-${{ github.repository }}-
# go_cache-
- uses: actions/setup-go@v3
with: with:
go-version: 1.20 go-version-file: 'go.mod'
- uses: actions/checkout@v3
- name: test mssql with collation - name: test mssql with collation
env: env:
TEST_MSSQL_HOST: mssql2 TEST_MSSQL_HOST: mssql2

View File

@ -2,42 +2,19 @@ name: test mssql
on: on:
push: push:
branches: branches:
- master - main
- v1
pull_request: pull_request:
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
RUNNER_TOOL_CACHE: /toolcache # specify with your cache path
jobs: jobs:
test-mssql: test-mssql:
name: test mssql name: test mssql
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: cache go path - uses: actions/checkout@v4
# id: cache-go-path
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_path
# key: go_path-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_path-${{ github.repository }}-
# go_path-
# - name: cache go cache
# id: cache-go-cache
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_cache
# key: go_cache-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_cache-${{ github.repository }}-
# go_cache-
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.20 go-version-file: 'go.mod'
- uses: actions/checkout@v3
- name: test mssql - name: test mssql
env: env:
TEST_MSSQL_HOST: mssql TEST_MSSQL_HOST: mssql

View File

@ -2,42 +2,19 @@ name: test mysql
on: on:
push: push:
branches: branches:
- master - main
- v1
pull_request: pull_request:
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
RUNNER_TOOL_CACHE: /toolcache # specify with your cache path
jobs: jobs:
test-mysql: test-mysql:
name: test mysql name: test mysql
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: cache go path - uses: actions/checkout@v4
# id: cache-go-path
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_path
# key: go_path-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_path-${{ github.repository }}-
# go_path-
# - name: cache go cache
# id: cache-go-cache
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_cache
# key: go_cache-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_cache-${{ github.repository }}-
# go_cache-
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.20 go-version-file: 'go.mod'
- uses: actions/checkout@v3
- name: test mysql utf8mb4 - name: test mysql utf8mb4
env: env:
TEST_MYSQL_HOST: mysql TEST_MYSQL_HOST: mysql

View File

@ -2,42 +2,19 @@ name: test mysql8
on: on:
push: push:
branches: branches:
- master - main
- v1
pull_request: pull_request:
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
RUNNER_TOOL_CACHE: /toolcache # specify with your cache path
jobs: jobs:
lint: lint:
name: test mysql8 name: test mysql8
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: cache go path - uses: actions/checkout@v4
# id: cache-go-path
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_path
# key: go_path-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_path-${{ github.repository }}-
# go_path-
# - name: cache go cache
# id: cache-go-cache
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_cache
# key: go_cache-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_cache-${{ github.repository }}-
# go_cache-
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.20 go-version-file: 'go.mod'
- uses: actions/checkout@v3
- name: test mysql8 - name: test mysql8
env: env:
TEST_MYSQL_HOST: mysql8 TEST_MYSQL_HOST: mysql8

View File

@ -2,42 +2,19 @@ name: test postgres
on: on:
push: push:
branches: branches:
- master - main
- v1
pull_request: pull_request:
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
RUNNER_TOOL_CACHE: /toolcache # specify with your cache path
jobs: jobs:
lint: lint:
name: test postgres name: test postgres
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: cache go path - uses: actions/checkout@v4
# id: cache-go-path
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_path
# key: go_path-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_path-${{ github.repository }}-
# go_path-
# - name: cache go cache
# id: cache-go-cache
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_cache
# key: go_cache-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_cache-${{ github.repository }}-
# go_cache-
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.20 go-version-file: 'go.mod'
- uses: actions/checkout@v3
- name: test postgres - name: test postgres
env: env:
TEST_PGSQL_HOST: pgsql TEST_PGSQL_HOST: pgsql

View File

@ -2,42 +2,19 @@ name: test sqlite
on: on:
push: push:
branches: branches:
- master - main
- v1
pull_request: pull_request:
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
RUNNER_TOOL_CACHE: /toolcache # specify with your cache path
jobs: jobs:
test-sqlite: test-sqlite:
name: unit test & test sqlite name: unit test & test sqlite
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: cache go path - uses: actions/checkout@v4
# id: cache-go-path
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_path
# key: go_path-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_path-${{ github.repository }}-
# go_path-
# - name: cache go cache
# id: cache-go-cache
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_cache
# key: go_cache-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_cache-${{ github.repository }}-
# go_cache-
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.20 go-version-file: 'go.mod'
- uses: actions/checkout@v3
- name: vet - name: vet
run: make vet run: make vet
- name: format check - name: format check

View File

@ -2,42 +2,19 @@ name: test tidb
on: on:
push: push:
branches: branches:
- master - main
- v1
pull_request: pull_request:
env:
GOPROXY: https://goproxy.io,direct
GOPATH: /go_path
GOCACHE: /go_cache
RUNNER_TOOL_CACHE: /toolcache # specify with your cache path
jobs: jobs:
test-tidb: test-tidb:
name: test tidb name: test tidb
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# - name: cache go path - uses: actions/checkout@v4
# id: cache-go-path
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_path
# key: go_path-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_path-${{ github.repository }}-
# go_path-
# - name: cache go cache
# id: cache-go-cache
# uses: https://github.com/actions/cache@v3
# with:
# path: /go_cache
# key: go_cache-${{ github.repository }}-${{ github.ref_name }}
# restore-keys: |
# go_cache-${{ github.repository }}-
# go_cache-
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
with: with:
go-version: 1.20 go-version-file: 'go.mod'
- uses: actions/checkout@v3
- name: test tidb - name: test tidb
env: env:
TEST_TIDB_HOST: "tidb:4000" TEST_TIDB_HOST: "tidb:4000"