This is an automated email from the ASF dual-hosted git repository.

linxinyuan pushed a commit to branch aglinxinyuan-patch-2
in repository https://gitbox.apache.org/repos/asf/texera.git

commit 7f39d385438307d5f1c536ec2818aca5360b3f20
Author: Xinyuan Lin <[email protected]>
AuthorDate: Sun Aug 24 14:28:45 2025 -0700

    chore(ci): Add Mock DB and JOOQ Generation to CI
    
    Introduce a Mock database for CI, and let CI generate JOOQ files before it 
runs
    
    Signed-off-by: Xinyuan Lin <[email protected]>
---
 .github/workflows/github-action-build.yml | 45 ++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 16 deletions(-)

diff --git a/.github/workflows/github-action-build.yml 
b/.github/workflows/github-action-build.yml
index 237a2f281f..89d56c4f11 100644
--- a/.github/workflows/github-action-build.yml
+++ b/.github/workflows/github-action-build.yml
@@ -71,42 +71,55 @@ jobs:
         run: yarn --cwd core/gui run build:ci
 
   core:
-    strategy:
-      matrix:
-        os: [ ubuntu-22.04 ]
-        java-version: [ 11 ]
-    runs-on: ${{ matrix.os }}
+    runs-on: ubuntu-latest
     env:
       JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M 
-Dfile.encoding=UTF-8
       JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M 
-Dfile.encoding=UTF-8
+
+    services:
+      postgres:
+        image: postgres:16
+        env:
+          POSTGRES_PASSWORD: postgres
+        ports:
+          - 5432:5432
+        # Add a health check so steps wait until Postgres is ready
+        options: >-
+          --health-cmd="pg_isready -U test -d texera_db"
+          --health-interval=10s
+          --health-timeout=5s
+          --health-retries=5
     steps:
-      - name: Prepare ENV
-        run: sudo apt-get install libncurses5
-      - name: Checkout Texera
-        uses: actions/checkout@v2
-      - name: Setup Java
-        uses: actions/setup-java@v2
+      - name: Checkout
+        uses: actions/checkout@v4
+      - name: Setup JDK
+        uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: ${{ matrix.java-version }}
+          java-version: 11
+      - name: Setup sbt launcher
+        uses: sbt/setup-sbt@v1
       - uses: coursier/cache-action@v6
         with:
           extraSbtFiles: '["core/*.sbt", "core/project/**.{scala,sbt}", 
"core/project/build.properties" ]'
       - name: Lint with scalafmt
         run: cd core && sbt scalafmtCheckAll
+      - name: Create Database
+        run: psql -h localhost -U postgres -f 
deployment/k8s/texera-helmchart/files/texera_ddl.sql
+        env:
+          PGPASSWORD: postgres
+      - name: Jooq Code Generator
+        run: cd core && sbt "DAO/runMain 
edu.uci.ics.texera.dao.JooqCodeGenerator"
       - name: Compile with sbt
         run: cd core && sbt clean package
       - name: Run backend tests
         run: cd core && sbt test
 
   python_udf:
-    runs-on: ${{ matrix.os }}
     strategy:
       matrix:
-        os:
-          - ubuntu-latest
         python-version: [ '3.9', '3.10', '3.11', '3.12' ]
-
+    runs-on: ubuntu-latest
     steps:
       - name: Checkout Texera
         uses: actions/checkout@v2

Reply via email to