File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ name : ML CI Pipeline
2+
3+ on :
4+ push :
5+ branches : ["test", "dev", "main"]
6+
7+ pull_request :
8+ branches : ["test", "dev", "main"]
9+
10+ jobs :
11+ build :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout repository
15+ uses : actions/checkout@v3
16+
17+ - name : Setup Python
18+ uses : actions/setup-python@v4
19+ with :
20+ python-version : " 3.11.3"
21+
22+ - name : Install Python Virtual Environment
23+ run : pip3 install virtualenv
24+
25+ # Cache Virtual Envrionment step
26+ - name : Virtual Environment
27+ uses : actions/cache@v3
28+ id : cache-venv
29+ with :
30+ path : .venv
31+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
32+ restore-keys : |
33+ ${{ runner.os }}-pip-
34+
35+ - name : Install Dependencies
36+ run : |
37+ if [ ! -d ".venv" ]; then
38+ python3 -m venv .venv
39+ fi
40+ source .venv/bin/activate
41+ pip install --upgrade pip
42+ pip install -r requirements.txt
43+
44+ - name : Lint with flake8
45+ run : |
46+ source .venv/bin/activate
47+ pip install flake8
48+ flake8 *.py --max-line-length=150
49+
50+ - name : Run pytest
51+ run : |
52+ source .venv/bin/activate
53+ pytest
54+
55+
56+
57+
You can’t perform that action at this time.
0 commit comments