Skip to content

fix directory creation bug in test #75

fix directory creation bug in test

fix directory creation bug in test #75

name: Python Environment Setup and Test
on:
push:
branches-ignore:
- workflow
pull_request:
branches-ignore:
- workflow
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python virtual environment
uses: actions/cache@v2
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-venv-${{ matrix.python-version }}-
- name: Create and activate virtual environment
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m venv ./.venv
source ./.venv/bin/activate
pip install -r setup/requirements.txt
- name: Add project directory to PYTHONPATH
run: |
echo "PYTHONPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Run tests
run: |
source ./.venv/bin/activate
pytest