diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f7940b3..315e748 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,6 @@ name: test -on: [pull request] +on: push jobs: test: @@ -8,6 +8,15 @@ jobs: runs-on: ubuntu-latest steps: + - name: Cache Poetry dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cache + ~/.local/share/virtualenvs + key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-poetry- - uses: actions/checkout@v2 - name: Set up Python 3.10 uses: actions/setup-python@v2 @@ -27,6 +36,11 @@ jobs: shell: bash run: python -m poetry install + - name: Create Environment File + run: echo "PYTHONPATH=$(pwd):$(pwd)/src" >> ${{ runner.workspace }}/.env + - name: Test with pytest - run: | - python3 -m poetry run pytest --cov + run: python -m poetry run pytest --cov + env: + PYTHONPATH: ${{ env.PYTHONPATH }} + ENV_FILE: ${{ runner.workspace }}/.env \ No newline at end of file