-
Notifications
You must be signed in to change notification settings - Fork 595
206 lines (195 loc) · 7.03 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# 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-22.04 # 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:
- .github/**
- src/evidently/**
- '!src/evidently/ui/assets/**'
- '!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-22.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@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
architecture: "x64"
cache: "pip"
cache-dependency-path: requirements.min.txt
# Runs a single command using the runners shell
- name: Install dependencies
run: pip install -r requirements.min.txt && pip install -r requirements.dev.txt
- name: Run pre-commit
run: pre-commit run --all
- name: Run Mypy
run: mypy
prepare-cache-data:
name: Prepare cache data
runs-on: ubuntu-22.04
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_modified == 'true' }}
steps:
- uses: actions/cache@v3
id: cache-bikes-dataset
env:
cache-name: cache-bikes-dataset
with:
path: Bike-Sharing-Dataset.zip
key: cache-bikes-dataset
- name: Download test data
if: ${{ steps.cache-bikes-dataset.outputs.cache-hit != 'true' }}
run: curl -k https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip -o Bike-Sharing-Dataset.zip
test-minimal:
name: Test on minimal requirements
runs-on: ubuntu-22.04
needs:
- changed_files
- prepare-cache-data
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_modified == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
architecture: "x64"
cache: "pip"
cache-dependency-path: requirements.min.txt
- uses: actions/cache@v3
id: cache-bikes-dataset
env:
cache-name: cache-bikes-dataset
with:
path: Bike-Sharing-Dataset.zip
key: cache-bikes-dataset
enableCrossOsArchive: true
- name: Download test data
if: ${{ steps.cache-bikes-dataset.outputs.cache-hit != 'true' }}
run: curl -k https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip -o Bike-Sharing-Dataset.zip
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install minimal dependencies
run: pip install -r requirements.min.txt
- name: Install package
run: pip install -e .[dev,spark,fsspec]
- name: Run pip-audit
run: pip-audit --ignore-vuln PYSEC-2024-48 --ignore-vuln GHSA-jw8x-6495-233v
- 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
- prepare-cache-data
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-13]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: windows-latest
python: "3.12"
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
architecture: "x64"
cache: "pip"
cache-dependency-path: setup.py
- uses: actions/cache@v3
id: cache-scipy-data
with:
path: ~/scikit_learn_data
key: cache-scipy-data
enableCrossOsArchive: true
- uses: actions/cache@v3
id: cache-bikes-dataset
env:
cache-name: cache-bikes-dataset
with:
path: Bike-Sharing-Dataset.zip
key: cache-bikes-dataset
enableCrossOsArchive: true
- name: Download test data
if: ${{ steps.cache-bikes-dataset.outputs.cache-hit != 'true' }}
run: curl -k https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip -o Bike-Sharing-Dataset.zip
- name: Install package
run: pip install -e .[dev,spark,fsspec]
- name: Run Tests
run: python -m pytest --durations=50
build:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_modified == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
architecture: "x64"
cache: "pip"
cache-dependency-path: setup.py
- name: Install dependencies
run: pip install -e ".[dev]"
- 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@v4
with:
name: build-artifacts
path: dist/