Add functionalities to pipeline #20
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: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10.5' | |
- name: List directories | |
run: | | |
echo "Current directory:" | |
pwd | |
echo "List of files in current directory:" | |
ls -la | |
echo "List of files in src directory:" | |
ls -la src/ | |
- 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 dependencies | |
run: pip install -r requirements.txt | |
- name: Set PYTHONPATH | |
run: echo "PYTHONPATH=${{ github.workspace }}" >> $GITHUB_ENV | |
- name: Run pytest | |
run: pytest tests/unit |