Skip to content

[hotfix] Improve README #212

[hotfix] Improve README

[hotfix] Improve README #212

name: Build And Test
on:
push:
pull_request:
branches:
- '**'
workflow_call:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
python_version:
type: string
description: 'The python version.'
required: false
default: '3.7'
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
python_version:
type: string
description: 'The python version.'
required: false
default: '3.7'
jobs:
build-and-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'adopt'
cache: 'maven'
- name: Build and test Feathub Java library
run: |
cd java
mvn clean package -B
- name: Set up python ${{ inputs.python_version || 3.7 }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version || 3.7 }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r python/dev-requirements.txt
- name: Build FeatHub Python library
run: |
# TODO: Add workflow to seperately test each processor.
python -m pip install ./python
python -m pip install ./python[flink]
python -m pip install ./python[spark]
- name: Check notebook examples
run: |
# notebooks should not contain outputs
jupyter nbconvert --clear-output --inplace docs/examples/*.ipynb
if [[ `git status --porcelain docs/examples` ]]; then
exit 1
fi
python -m black --check ./docs/examples
- name: Test Feathub Python library
run: |
python -m black --check ./python
python -m flake8 --config=python/setup.cfg ./python
python -m mypy --config-file python/setup.cfg ./python
pytest -W ignore::DeprecationWarning ./python
- name: Debug with tmate
if: ${{ failure() && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3