refactor: use modernc sqlite driver as default (#37562)

The mattn driver is still kept, can be enabled by
TAGS="sqlite_mattn sqlite_unlock_notify"

---------

Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
wxiaoguang
2026-05-07 02:57:59 +08:00
committed by GitHub
parent b093c2c43c
commit a39af1a829
34 changed files with 185 additions and 149 deletions

View File

@@ -45,8 +45,7 @@ jobs:
cache-name: seed
- run: make deps-backend
- run: TAGS="bindata" make backend
- run: TAGS="bindata sqlite sqlite_unlock_notify" make backend
- run: TAGS="bindata gogit sqlite sqlite_unlock_notify" GOEXPERIMENT="" make backend
- run: TAGS="bindata gogit" GOEXPERIMENT="" make backend
lint:
runs-on: ubuntu-latest
@@ -54,9 +53,9 @@ jobs:
fail-fast: false
matrix:
include:
- { job: lint-backend, tags: "bindata sqlite sqlite_unlock_notify", target: "lint-backend" }
- { job: lint-go-windows, tags: "bindata sqlite sqlite_unlock_notify", target: "lint-go-windows" }
- { job: lint-go-gogit, tags: "bindata gogit sqlite sqlite_unlock_notify", target: "lint-go" }
- { job: lint-backend, tags: "bindata", target: "lint-backend" }
- { job: lint-go-windows, tags: "bindata", target: "lint-go-windows" }
- { job: lint-go-gogit, tags: "bindata gogit", target: "lint-go" }
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0

View File

@@ -32,7 +32,7 @@ jobs:
- run: make deps-backend deps-tools
- run: make lint-backend
env:
TAGS: bindata sqlite sqlite_unlock_notify
TAGS: bindata
lint-on-demand:
needs: files-changed
@@ -82,7 +82,7 @@ jobs:
- run: make deps-backend deps-tools
- run: make lint-go-windows
env:
TAGS: bindata sqlite sqlite_unlock_notify
TAGS: bindata
GOOS: windows
GOARCH: amd64
@@ -104,7 +104,7 @@ jobs:
- run: make deps-backend deps-tools
- run: make lint-go
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
TAGS: bindata gogit
checks-backend:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'

View File

@@ -62,6 +62,8 @@ jobs:
run: GITEA_TEST_DATABASE=pgsql make test-integration
timeout-minutes: 50
env:
# pgsql is chosen to be the unlucky one to run with the slow "race detector", it is about 60% slower.
GOTEST_FLAGS: -race -timeout=40m
TAGS: bindata gogit
TEST_LDAP: 1
@@ -82,7 +84,7 @@ jobs:
- run: make deps-backend
- run: make backend
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
TAGS: bindata gogit
GOEXPERIMENT:
- name: run migration tests
run: GITEA_TEST_DATABASE=sqlite make test-migration
@@ -92,9 +94,10 @@ jobs:
run: GITEA_TEST_DATABASE=sqlite make test-integration
timeout-minutes: 50
env:
# sqlite driver can contain large amount of Golang code, so don't use race detector for it, otherwise, extremely slow
GOTEST_FLAGS: -timeout=40m
TAGS: bindata gogit
GOEXPERIMENT:
GOTEST_FLAGS: -race -timeout=40m
test-unit:
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
@@ -154,15 +157,15 @@ jobs:
- name: unit-tests
run: make test-backend test-check
env:
TAGS: bindata sqlite sqlite_unlock_notify
GOTEST_FLAGS: -race -timeout=20m
TAGS: bindata
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
- name: unit-tests-gogit
run: make test-backend test-check
env:
TAGS: bindata gogit sqlite sqlite_unlock_notify
GOEXPERIMENT:
GOTEST_FLAGS: -race -timeout=20m
TAGS: bindata gogit
GOEXPERIMENT:
GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }}
test-mysql:

View File

@@ -40,11 +40,11 @@ jobs:
- run: make deps-backend
- run: make backend
env:
TAGS: bindata sqlite sqlite_unlock_notify
TAGS: bindata
- run: make playwright
- run: make test-e2e
timeout-minutes: 10
env:
TAGS: bindata sqlite sqlite_unlock_notify
TAGS: bindata
FORCE_COLOR: 1
GITEA_TEST_E2E_DEBUG: 1

View File

@@ -32,7 +32,7 @@ jobs:
# xgo build
- run: make release
env:
TAGS: bindata sqlite sqlite_unlock_notify
TAGS: bindata
- name: import gpg key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0

View File

@@ -33,7 +33,7 @@ jobs:
# xgo build
- run: make release
env:
TAGS: bindata sqlite sqlite_unlock_notify
TAGS: bindata
- name: import gpg key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0

View File

@@ -36,7 +36,7 @@ jobs:
# xgo build
- run: make release
env:
TAGS: bindata sqlite sqlite_unlock_notify
TAGS: bindata
- name: import gpg key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0