Refactor and sqlite plugin #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |