Skip to content

Add StatTest to json encoder (#769) #2

Add StatTest to json encoder (#769)

Add StatTest to json encoder (#769) #2

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
linter:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
architecture: 'x64'
cache: 'pip'
# Runs a single command using the runners shell
- name: Install dependencies
run: pip install -r requirements.min.txt && pip install -r requirements.dev.txt
# run black separately for source and tests folders (prevent generated examples folder checking)
# temporary specify line length and python version explicitly for black
# it cannot find the settings in setup.cfg
- name: Run Black
run: black --check --diff -l 120 -t py37 src
- name: Run Black for Tests
run: black --check --diff -l 120 -t py37 tests
# run isort separately for source and tests folders (prevent generated examples folder checking)
- name: Run iSort
run: isort --check src
- name: Run iSort for Tests
run: isort --check tests
# run flake8 separately for source and tests folders
- name: Run Flake8
run: flake8 src
- name: Run Flake8 for Tests
run: flake8 tests
- name: Run Mypy
run: mypy
test-minimal:
name: Test on minimal requirements
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: 'x64'
cache: 'pip'
- name: Install package
run: pip install -e .[dev]
- name: Install minimal dependencies
run: pip install -r requirements.min.txt
- name: Run Tests
run: python -m pytest
test:
# The type of runner that the job will run on
name: Test ${{ matrix.os }} with py${{ matrix.python }}
needs: linter
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
exclude:
- os: macos-latest
python: "3.7"
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
cache: 'pip'
- name: Install package
run: pip install -e .[dev]
- name: Run Tests
run: python -m pytest
test-examples:
name: Test examples on ${{ matrix.os }} with py${{ matrix.python }}, min ${{ matrix.minimal }}
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python: [ "3.7"]
minimal: [ false ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
cache: 'pip'
- name: Install package
run: pip install -e .[dev]
- name: Install minimal reqs
if: matrix.minimal
run: pip install -r requirements.min.txt
- name: Prepare examples dependencies
run: pip install catboost sentence-transformers
- name: Export examples
run: jupyter nbconvert --to python examples/*/*.ipynb --output-dir example_scripts
- name: Download test data
run: curl https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip -o Bike-Sharing-Dataset.zip &&
unzip Bike-Sharing-Dataset.zip -d Bike-Sharing-Dataset
- name: Run examples
run: python example_test.py
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
architecture: 'x64'
cache: 'pip'
- name: Install dependencies
run: pip install -r requirements.min.txt
- name: Install wheel
run: pip install wheel
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Archive built package
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: dist/