Make CI to build executable jar #39
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ibis CI | ||
on: | ||
pull_request: | ||
paths: | ||
- 'ibis-server/**' | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }} | ||
cancel-in-progress: true | ||
defaults: | ||
run: | ||
working-directory: ibis-server | ||
jobs: | ||
ruff-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Ruff check | ||
uses: chartboost/ruff-action@v1 | ||
with: | ||
src: './ibis-server' | ||
args: 'format --check' | ||
check-file-changed: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check any non-ibis filed changed | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: 'ibis-server/**' | ||
negation_patterns_first: true | ||
outputs: | ||
any_changed: ${{ steps.changed-files.outputs.any_changed }} | ||
build-java-and-run-engine: | ||
if: needs.check-file-changed.outputs.any_changed == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
cache: 'maven' | ||
- name: Prepare config.properties and executable jar | ||
working-directory: . | ||
run: | | ||
mkdir etc | ||
echo "node.environment=production" >> etc/config.properties | ||
echo "wren.directory=./etc/mdl" >> etc/config.properties | ||
./mvnw clean install -B -DskipTests -P exec-jar | ||
- name: Start Wren JAVA engine | ||
working-directory: . | ||
run: | | ||
WREN_VERSION=$(./mvnw --quiet help:evaluate -Dexpression=project.version -DforceStdout) | ||
java -Dconfig=etc/config.properties \ | ||
--add-opens=java.base/java.nio=ALL-UNNAMED \ | ||
-jar ./wren-server/target/wren-server-${WREN_VERSION}-executable.jar & | ||
run-latest-docker-image: | ||
needs: check-file-changed | ||
if: needs.check-file-changed.outputs.any_changed == 'false' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Start Wren JAVA engine | ||
working-directory: ./example/duckdb-tpch-example | ||
run: | | ||
docker compose --env-file .env up -d | ||
ci: | ||
runs-on: ubuntu-latest | ||
needs: [ruff-check, java-engine] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: ./ibis-server/pyproject.toml | ||
cache: 'poetry' | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Run tests | ||
env: | ||
WREN_ENGINE_ENDPOINT: http://localhost:8080 | ||
run: poetry run pytest -m "not bigquery and not snowflake" | ||
- name: Test bigquery if need | ||
if : contains(github.event.pull_request.labels.*.name, 'bigquery') | ||
env: | ||
WREN_ENGINE_ENDPOINT: http://localhost:8080 | ||
TEST_BIG_QUERY_PROJECT_ID: ${{ secrets.TEST_BIG_QUERY_PROJECT_ID }} | ||
TEST_BIG_QUERY_CREDENTIALS_BASE64_JSON: ${{ secrets.TEST_BIG_QUERY_CREDENTIALS_BASE64_JSON }} | ||
run: poetry run pytest -m bigquery | ||
- name: Test snowflake if need | ||
if : contains(github.event.pull_request.labels.*.name, 'snowflake') | ||
env: | ||
WREN_ENGINE_ENDPOINT: http://localhost:8080 | ||
SNOWFLAKE_USER: ${{ secrets.SNOWFLAKE_USER }} | ||
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }} | ||
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }} | ||
run: poetry run pytest -m snowflake |