-
Notifications
You must be signed in to change notification settings - Fork 46
47 lines (37 loc) · 1.06 KB
/
build.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
name: Build and Test
on: [push]
jobs:
format-code:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies and format code
run: |
sudo apt-get install -y make
pip3 install black isort
make format
if git diff --quiet; then
echo "No code formatting changes detected."
else
echo "Code formatting changes detected. Please run 'make format' locally and commit the changes."
git diff --exit-code
exit 1
fi
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies and run tests
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install -r test_requirements.txt
python -m unittest discover -v