Initial pull #595
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: CI | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
push: | |
branches: | |
- develop | |
- dev | |
- release | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
build: | |
name: ${{ matrix.os }} x py${{ matrix.python }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: "Windows Graphviz install" | |
if: runner.os == 'Windows' | |
uses: crazy-max/ghaction-chocolatey@v3 | |
with: | |
args: -h | |
- name: Install Graphviz for Windows | |
if: runner.os == 'Windows' | |
run: | | |
choco install graphviz --version=2.49.3 | |
- name: Install pygraphviz for Windows | |
if: runner.os == 'Windows' | |
run: | | |
python -m pip install --use-pep517 --config-settings="--global-option=build_ext" --config-settings="--global-option=-IC:\\Program Files\\Graphviz\\include" --config-settings="--global-option=-LC:\\Program Files\\Graphviz\\lib" pygraphviz | |
- name: Install Graphviz for other platforms | |
if: runner.os != 'Windows' | |
uses: ts-graphviz/setup-graphviz@v2 | |
with: | |
macos-skip-brew-update: 'true' | |
- name: Cache venv | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-build-${{ matrix.python }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
${{ matrix.install_graphviz }} | |
echo "Cache Version ${{ secrets.CACHE_VERSION }}" | |
poetry install | |
poetry run pip install ERAlchemy2 | |
poetry config --list | |
- name: Print tool versions | |
run: | | |
poetry run pylint --version | |
poetry run pytest --version | |
poetry run black --version | |
poetry run pyright --version | |
- name: Check if the code is formatted | |
run: poetry run black --check dataprep | |
- name: Type check the project | |
run: poetry run pyright dataprep || true | |
- name: Build binary dependencies | |
run: poetry build | |
- name: Test the project | |
run: poetry run pytest --cov-report xml --cov=dataprep dataprep/tests | |
env: | |
DATAPREP_BROWSER_TESTS: 0 | |
DATAPREP_CREDENTIAL_TESTS: 0 | |
DATAPREP_DATA_CONNECTOR_YELP_TOKEN: "" | |
DATAPREP_DATA_CONNECTOR_YOUTUBE_TOKEN: "" | |
- name: Style check the project | |
run: poetry run pylint dataprep || true | |
- uses: codecov/codecov-action@v2 | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
with: | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
# path_to_write_report: ./coverage.xml | |
- uses: codacy/codacy-coverage-reporter-action@v1 | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage.xml | |
docs-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Graphviz | |
uses: ts-graphviz/[email protected] | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
curl -L https://github.com/jgm/pandoc/releases/download/2.11.2/pandoc-2.11.2-1-amd64.deb -o /tmp/pandoc.deb && sudo dpkg -i /tmp/pandoc.deb | |
- name: Cache venv | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-build-${{ matrix.python }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
poetry install | |
poetry run pip install ERAlchemy2 | |
- name: Build docs | |
run: poetry run sphinx-build -M html docs/source docs/build | |
- name: Archive docs | |
uses: actions/upload-artifact@v2 | |
with: | |
name: docs | |
path: docs/build/html |