From 319f09c2b160d549386b18a6095517177fe32be8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 4 Oct 2023 14:30:44 +0800 Subject: [PATCH 1/3] Use minial required versio on CI and remove unnecessary services --- .github/workflows/pull-db-tests.yml | 47 ++--------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml index c4005648b7433..6a822942af23f 100644 --- a/.github/workflows/pull-db-tests.yml +++ b/.github/workflows/pull-db-tests.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest services: pgsql: - image: postgres:16 + image: postgres:12 env: POSTGRES_DB: test POSTGRES_PASSWORD: postgres @@ -84,49 +84,6 @@ jobs: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest - services: - mysql: - image: mysql:8.1 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: true - MYSQL_DATABASE: test - ports: - - "3306:3306" - elasticsearch: - image: elasticsearch:7.5.0 - env: - discovery.type: single-node - ports: - - "9200:9200" - meilisearch: - image: getmeili/meilisearch:v1.2.0 - env: - MEILI_ENV: development # disable auth - ports: - - "7700:7700" - smtpimap: - image: tabascoterrier/docker-imap-devel:latest - ports: - - "25:25" - - "143:143" - - "587:587" - - "993:993" - redis: - image: redis - options: >- # wait until redis has started - --health-cmd "redis-cli ping" - --health-interval 5s - --health-timeout 3s - --health-retries 10 - ports: - - 6379:6379 - minio: - image: bitnami/minio:2021.3.17 - env: - MINIO_ACCESS_KEY: 123456 - MINIO_SECRET_KEY: 12345678 - ports: - - "9000:9000" steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 @@ -158,7 +115,7 @@ jobs: runs-on: ubuntu-latest services: mysql: - image: mysql:8.1 + image: mysql:8.0 env: MYSQL_ALLOW_EMPTY_PASSWORD: true MYSQL_DATABASE: testgitea From 0d1dedcd5bd7713c9dbc46713c75aa6ed596eba3 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 4 Oct 2023 15:33:44 +0800 Subject: [PATCH 2/3] Use mssql 2017 as test database and fix unit test --- .github/workflows/pull-db-tests.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml index 6a822942af23f..ce1dcb66f98a4 100644 --- a/.github/workflows/pull-db-tests.yml +++ b/.github/workflows/pull-db-tests.yml @@ -84,6 +84,23 @@ jobs: if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest + services: + redis: + image: redis + options: >- # wait until redis has started + --health-cmd "redis-cli ping" + --health-interval 5s + --health-timeout 3s + --health-retries 10 + ports: + - 6379:6379 + minio: + image: bitnami/minio:2021.3.17 + env: + MINIO_ACCESS_KEY: 123456 + MINIO_SECRET_KEY: 12345678 + ports: + - "9000:9000" steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 @@ -160,7 +177,7 @@ jobs: runs-on: ubuntu-latest services: mssql: - image: mcr.microsoft.com/mssql/server:2022-latest + image: mcr.microsoft.com/mssql/server:2017-latest env: ACCEPT_EULA: Y MSSQL_PID: Standard From 1e7f5302b68ef608b764cec250f19f63cb8afe1e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 4 Oct 2023 19:10:41 +0800 Subject: [PATCH 3/3] Add services for test --- .github/workflows/pull-db-tests.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml index ce1dcb66f98a4..9fcdea44ee11b 100644 --- a/.github/workflows/pull-db-tests.yml +++ b/.github/workflows/pull-db-tests.yml @@ -85,6 +85,18 @@ jobs: needs: files-changed runs-on: ubuntu-latest services: + elasticsearch: + image: elasticsearch:7.5.0 + env: + discovery.type: single-node + ports: + - "9200:9200" + meilisearch: + image: getmeili/meilisearch:v1.2.0 + env: + MEILI_ENV: development # disable auth + ports: + - "7700:7700" redis: image: redis options: >- # wait until redis has started