-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (42 loc) · 1.35 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
name: Python unit tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Cache pip packages
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install pip-tools
run: |
python -m pip install --upgrade pip
pip install pip-tools
- name: Compile requirements
run: |
if [ -f podcastTextGenerationApp/requirements.in ]; then pip-compile podcastTextGenerationApp/requirements.in; fi
- name: Install dependencies
run: |
if [ -f podcastTextGenerationApp/requirements.txt ]; then pip install -r podcastTextGenerationApp/requirements.txt; fi
- name: Set PYTHONPATH and run tests
run: |
export PYTHONPATH=${PYTHONPATH}:$(pwd)/podcastTextGenerationApp
echo "PYTHONPATH=$PYTHONPATH:$(pwd)/podcastTextGenerationApp" >> $GITHUB_ENV
- name: Analysing the code with pylint
run: |
pylint --fail-under=7.5 $(git ls-files '*.py')
- name: Run Tests
run : |
python -m unittest