Skip to content

fix CI

fix CI #3155

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]
types:
- opened
- reopened
- synchronize
- ready_for_review
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
changed_files:
runs-on: ubuntu-latest # windows-latest || macos-latest
name: 👀 List Changed Evidently Files
outputs:
evidently_any_modified: ${{ steps.changed-files.outputs.evidently_python_any_modified == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Get all python files that have changed
id: changed-files
uses: tj-actions/changed-files@v42
with:
files_yaml: |
evidently_python:
- src/evidently/**
- '!src/evidently/ui/ui/**'
- '!src/evidently/nbextension/**'
- example_test.py
- examples/**.ipynb
- requirements.dev.txt
- requirements.min.txt
- setup.py
- setup.cfg
- setupbase.py
- pylintrc
- tests/**
- name: Run step if evidently_python file(s) change
if: steps.changed-files.outputs.evidently_python_any_modified == 'true'
run: |
echo "One or more evidently_python file(s) has changed."
echo "List all the files that have changed: ${{ steps.changed-files.outputs.evidently_python_all_changed_and_modified_files }}"
linter:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_modified == 'true' }}
# 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
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_modified == 'true' }}
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,spark,fsspec]
- name: Install minimal dependencies
run: pip install -r requirements.min.txt
- name: Run Tests
run: python -m pytest --durations=50
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 }}
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-latest
python: "3.7"
- os: windows-latest
python: "3.12"
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,spark,fsspec]
- name: Run Tests
run: python -m pytest --durations=50
test-examples:
name: Test examples on ${{ matrix.os }} with py${{ matrix.python }}, min ${{ matrix.minimal }}
needs: test
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
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,spark,fsspec]
- 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 -k 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
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_modified == 'true' }}
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/