| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| |
| name: build |
| |
| on: |
| push: |
| branches: |
| - 'ci-enable/**' |
| - 'master' |
| pull_request: |
| workflow_dispatch: |
| |
| concurrency: |
| group: ${{ github.workflow }}-${{ github.ref }} |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| |
| jobs: |
| gui: |
| runs-on: ${{ matrix.os }} |
| strategy: |
| matrix: |
| os: [ubuntu-latest, windows-latest, macos-latest] |
| include: |
| - os: macos-latest |
| arch: arm64 |
| - os: ubuntu-latest |
| arch: x64 |
| - os: windows-latest |
| arch: x64 |
| node-version: |
| - 18 |
| steps: |
| - name: Checkout Texera |
| uses: actions/checkout@v2 |
| - name: Setup node |
| uses: actions/setup-node@v4 |
| with: |
| node-version: ${{ matrix.node-version }} |
| architecture: ${{ matrix.arch }} |
| - uses: actions/cache@v3 |
| with: |
| path: | |
| core/gui/node_modules |
| key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node-version }}-yarn-cache-v1-${{ hashFiles('**/yarn.lock') }} |
| restore-keys: | |
| ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node-version }}-yarn-cache-v1- |
| - name: Prepare Yarn 4.5.1 |
| run: corepack enable && corepack prepare yarn@4.5.1 --activate && yarn --cwd core/gui set version 4.5.1 |
| - name: Install dependency |
| run: yarn --cwd core/gui install --immutable --network-timeout=100000 |
| - name: Lint with Prettier & ESLint |
| run: yarn --cwd core/gui format:ci |
| - name: Run frontend unit tests |
| run: yarn --cwd core/gui run test:ci |
| - name: Prod build |
| run: yarn --cwd core/gui run build:ci |
| |
| core: |
| strategy: |
| matrix: |
| os: [ ubuntu-22.04 ] |
| java-version: [ 11 ] |
| runs-on: ${{ matrix.os }} |
| 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 |
| 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 |
| with: |
| distribution: 'temurin' |
| java-version: ${{ matrix.java-version }} |
| - 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: 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' ] |
| |
| steps: |
| - name: Checkout Texera |
| uses: actions/checkout@v2 |
| - name: Set up R for R-UDF |
| uses: r-lib/actions/setup-r@v2 |
| with: |
| r-version: '4.3.3' |
| - uses: r-lib/actions/setup-r-dependencies@v2 |
| with: |
| cache-version: 2 |
| working-directory: "./core/amber" |
| - name: Set up Python ${{ matrix.python-version }} |
| uses: actions/setup-python@v2 |
| with: |
| python-version: ${{ matrix.python-version }} |
| - name: Install dependencies |
| run: | |
| python -m pip install --upgrade pip |
| if [ -f core/amber/requirements.txt ]; then pip install -r core/amber/requirements.txt; fi |
| if [ -f core/amber/r-requirements.txt ]; then pip install -r core/amber/r-requirements.txt; fi |
| if [ -f core/amber/operator-requirements.txt ]; then pip install -r core/amber/operator-requirements.txt; fi |
| - name: Install PostgreSQL |
| run: sudo apt-get update && sudo apt-get install -y postgresql |
| - name: Start PostgreSQL Service |
| run: sudo systemctl start postgresql |
| - name: Create Database and User |
| run: | |
| cd core/scripts/sql && sudo -u postgres psql -f iceberg_postgres_catalog.sql |
| - name: Lint with flake8 and black |
| run: | |
| cd core/amber/src/main/python && flake8 && black . --check |
| - name: Test with pytest |
| run: | |
| cd core/amber/src/main/python && pytest -sv |