Skip to content

Commit

Permalink
Github workflow: Changed files action (#922)
Browse files Browse the repository at this point in the history
* Github workflow: Changed files action

* kek

* trigger run tests

* wip

* WIP

* return back

* wip

* wip

* added UI

* wip

* return UI back

* exclude UI files

* wip

* trigger playwright test

* wip

* Revert "trigger playwright test"

This reverts commit 842d6d8.

* Update ui.yml

* Update main.yml

* Update ui.yml

* trigger tests

* return back

* Update ui.yml

* Update index.html

* Update index.html

* Update index.html

* Update index.html

* Update index.html
  • Loading branch information
DimaAmega authored Feb 2, 2024
1 parent ee5589b commit a8c66c8
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 27 deletions.
95 changes: 70 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
types:
- opened
- reopened
Expand All @@ -24,21 +24,62 @@ concurrency:

# 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"
changed_files:
runs-on: ubuntu-latest # windows-latest || macos-latest
name: 👀 List Changed Evidently Files
outputs:
evidently_any_changed: ${{ steps.changed-files.outputs.evidently_tests_any_changed == 'true' || steps.changed-files.outputs.evidently_python_any_changed == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Get all python files that have changed
id: changed-files
uses: tj-actions/changed-files@v40
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
evidently_tests:
- tests/**
- name: Run step if evidently_python file(s) change
if: steps.changed-files.outputs.evidently_python_any_changed == '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_files }}"
- name: Run step if evidently_tests file(s) change
if: steps.changed-files.outputs.evidently_tests_any_changed == 'true'
run: |
echo "One or more evidently_tests file(s) has changed."
echo "List all the files that have changed: ${{ steps.changed-files.outputs.evidently_tests_all_changed_files }}"
linter:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false

needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_changed == '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'
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
Expand All @@ -61,17 +102,19 @@ jobs:
run: flake8 tests
- name: Run Mypy
run: mypy

test-minimal:
name: Test on minimal requirements
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_changed == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: 'x64'
cache: 'pip'
architecture: "x64"
cache: "pip"
- name: Install package
run: pip install -e .[dev,spark,fsspec]
- name: Install minimal dependencies
Expand All @@ -86,8 +129,8 @@ jobs:
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" ]
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"
Expand All @@ -99,8 +142,8 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
cache: 'pip'
architecture: "x64"
cache: "pip"
- name: Install package
run: pip install -e .[dev,spark,fsspec]
- name: Run Tests
Expand All @@ -113,17 +156,17 @@ jobs:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ ubuntu-latest ]
python: [ "3.7"]
minimal: [ false ]
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'
architecture: "x64"
cache: "pip"
- name: Install package
run: pip install -e .[dev,spark,fsspec]
- name: Install minimal reqs
Expand All @@ -134,22 +177,24 @@ jobs:
- 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 &&
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
if: github.event.pull_request.draft == false
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_changed == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
architecture: 'x64'
cache: 'pip'
python-version: "3.7"
architecture: "x64"
cache: "pip"
- name: Install dependencies
run: pip install -r requirements.min.txt
- name: Install wheel
Expand Down
48 changes: 46 additions & 2 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
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:
Expand All @@ -14,10 +19,48 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changed_files:
runs-on: ubuntu-latest # windows-latest || macos-latest
name: 👀 List Changed UI Files
outputs:
ui_any_changed: ${{ steps.changed-files.outputs.ui_any_changed == 'true' }}
evidently_python_any_changed: ${{ steps.changed-files.outputs.evidently_python_any_changed == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Get all UI files that have changed
id: changed-files
uses: tj-actions/changed-files@v40
with:
files_yaml: |
ui:
- ui/**
evidently_python:
- src/evidently/**
- requirements.dev.txt
- requirements.min.txt
- setup.py
- setup.cfg
- setupbase.py
- name: Run step if UI file(s) changed
if: steps.changed-files.outputs.ui_any_changed == 'true'
run: |
echo "One or more ui file(s) has changed."
echo "List all the files that have changed: ${{ steps.changed-files.outputs.ui_all_changed_files }}"
- name: Run step if Playwright file(s) changed
if: steps.changed-files.outputs.evidently_python_any_changed == '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_files }}"
ui-build:
name: UI type-check and build with node v${{ matrix.node-version }}
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.ui_any_changed == 'true' }}
strategy:
matrix:
node-version: [16, 18]
Expand Down Expand Up @@ -63,7 +106,8 @@ jobs:
ui-test:
name: Playwright tests for Service
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_python_any_changed == 'true' }}

steps:
- name: ⬇️ Checkout repo
Expand Down

0 comments on commit a8c66c8

Please sign in to comment.