From ed17be6735233a4547d5662beabf52b8dda1cf07 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 15 May 2024 01:05:15 +0000 Subject: [PATCH] Update CI (#2458) Backport #2432 Reviewed-on: https://gitea.com/xorm/xorm/pulls/2458 --- .gitea/workflows/release-tag.yml | 4 +-- .gitea/workflows/test-cockroach.yml | 31 +++------------------ .gitea/workflows/test-mariadb.yml | 31 +++------------------ .gitea/workflows/test-mssql-collation.yml | 33 ++++------------------- .gitea/workflows/test-mssql.yml | 31 +++------------------ .gitea/workflows/test-mysql.yml | 31 +++------------------ .gitea/workflows/test-mysql8.yml | 31 +++------------------ .gitea/workflows/test-postgres.yml | 31 +++------------------ .gitea/workflows/test-sqlite.yml | 31 +++------------------ .gitea/workflows/test-tidb.yml | 31 +++------------------ 10 files changed, 39 insertions(+), 246 deletions(-) diff --git a/.gitea/workflows/release-tag.yml b/.gitea/workflows/release-tag.yml index 83802ac0..eddaac0f 100644 --- a/.gitea/workflows/release-tag.yml +++ b/.gitea/workflows/release-tag.yml @@ -12,13 +12,13 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: setup go uses: actions/setup-go@v5 with: - go-version: '>=1.20.1' + go-version-file: 'go.mod' - name: Use Go Action id: use-go-action uses: https://gitea.com/actions/release-action@main diff --git a/.gitea/workflows/test-cockroach.yml b/.gitea/workflows/test-cockroach.yml index 25815531..64c2a185 100644 --- a/.gitea/workflows/test-cockroach.yml +++ b/.gitea/workflows/test-cockroach.yml @@ -2,42 +2,19 @@ name: test cockroach on: push: branches: - - master + - main + - v1 pull_request: -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - RUNNER_TOOL_CACHE: /toolcache # specify with your cache path - jobs: test-cockroach: name: test cockroach runs-on: ubuntu-latest steps: - # - name: cache go path - # 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/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: test cockroach env: TEST_COCKROACH_HOST: "cockroach:26257" diff --git a/.gitea/workflows/test-mariadb.yml b/.gitea/workflows/test-mariadb.yml index 4abda6d9..2b610d2b 100644 --- a/.gitea/workflows/test-mariadb.yml +++ b/.gitea/workflows/test-mariadb.yml @@ -2,42 +2,19 @@ name: test mariadb on: push: branches: - - master + - main + - v1 pull_request: -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - RUNNER_TOOL_CACHE: /toolcache # specify with your cache path - jobs: lint: name: test mariadb runs-on: ubuntu-latest steps: - # - name: cache go path - # 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/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: test mariadb env: TEST_MYSQL_HOST: mariadb diff --git a/.gitea/workflows/test-mssql-collation.yml b/.gitea/workflows/test-mssql-collation.yml index cc5d12df..979e1bb0 100644 --- a/.gitea/workflows/test-mssql-collation.yml +++ b/.gitea/workflows/test-mssql-collation.yml @@ -2,42 +2,19 @@ name: test mssql on: push: branches: - - master + - main + - v1 pull_request: -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - RUNNER_TOOL_CACHE: /toolcache # specify with your cache path - jobs: test-mssql-collation: name: test mssql with collation runs-on: ubuntu-latest steps: - # - name: cache go path - # 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@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: test mssql with collation env: TEST_MSSQL_HOST: mssql2 diff --git a/.gitea/workflows/test-mssql.yml b/.gitea/workflows/test-mssql.yml index c2f54dbb..cb155699 100644 --- a/.gitea/workflows/test-mssql.yml +++ b/.gitea/workflows/test-mssql.yml @@ -2,42 +2,19 @@ name: test mssql on: push: branches: - - master + - main + - v1 pull_request: -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - RUNNER_TOOL_CACHE: /toolcache # specify with your cache path - jobs: test-mssql: name: test mssql runs-on: ubuntu-latest steps: - # - name: cache go path - # 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/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: test mssql env: TEST_MSSQL_HOST: mssql diff --git a/.gitea/workflows/test-mysql.yml b/.gitea/workflows/test-mysql.yml index 17a131d0..198f8980 100644 --- a/.gitea/workflows/test-mysql.yml +++ b/.gitea/workflows/test-mysql.yml @@ -2,42 +2,19 @@ name: test mysql on: push: branches: - - master + - main + - v1 pull_request: -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - RUNNER_TOOL_CACHE: /toolcache # specify with your cache path - jobs: test-mysql: name: test mysql runs-on: ubuntu-latest steps: - # - name: cache go path - # 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/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: test mysql utf8mb4 env: TEST_MYSQL_HOST: mysql diff --git a/.gitea/workflows/test-mysql8.yml b/.gitea/workflows/test-mysql8.yml index ead280a4..252d28ff 100644 --- a/.gitea/workflows/test-mysql8.yml +++ b/.gitea/workflows/test-mysql8.yml @@ -2,42 +2,19 @@ name: test mysql8 on: push: branches: - - master + - main + - v1 pull_request: -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - RUNNER_TOOL_CACHE: /toolcache # specify with your cache path - jobs: lint: name: test mysql8 runs-on: ubuntu-latest steps: - # - name: cache go path - # 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/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: test mysql8 env: TEST_MYSQL_HOST: mysql8 diff --git a/.gitea/workflows/test-postgres.yml b/.gitea/workflows/test-postgres.yml index 98b1b27f..f05b78f6 100644 --- a/.gitea/workflows/test-postgres.yml +++ b/.gitea/workflows/test-postgres.yml @@ -2,42 +2,19 @@ name: test postgres on: push: branches: - - master + - main + - v1 pull_request: -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - RUNNER_TOOL_CACHE: /toolcache # specify with your cache path - jobs: lint: name: test postgres runs-on: ubuntu-latest steps: - # - name: cache go path - # 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/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: test postgres env: TEST_PGSQL_HOST: pgsql diff --git a/.gitea/workflows/test-sqlite.yml b/.gitea/workflows/test-sqlite.yml index 000aae80..427697cd 100644 --- a/.gitea/workflows/test-sqlite.yml +++ b/.gitea/workflows/test-sqlite.yml @@ -2,42 +2,19 @@ name: test sqlite on: push: branches: - - master + - main + - v1 pull_request: -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - RUNNER_TOOL_CACHE: /toolcache # specify with your cache path - jobs: test-sqlite: name: unit test & test sqlite runs-on: ubuntu-latest steps: - # - name: cache go path - # 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/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: vet run: make vet - name: format check diff --git a/.gitea/workflows/test-tidb.yml b/.gitea/workflows/test-tidb.yml index 76461d3a..6a02e348 100644 --- a/.gitea/workflows/test-tidb.yml +++ b/.gitea/workflows/test-tidb.yml @@ -2,42 +2,19 @@ name: test tidb on: push: branches: - - master + - main + - v1 pull_request: -env: - GOPROXY: https://goproxy.io,direct - GOPATH: /go_path - GOCACHE: /go_cache - RUNNER_TOOL_CACHE: /toolcache # specify with your cache path - jobs: test-tidb: name: test tidb runs-on: ubuntu-latest steps: - # - name: cache go path - # 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/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.20 - - uses: actions/checkout@v3 + go-version-file: 'go.mod' - name: test tidb env: TEST_TIDB_HOST: "tidb:4000"