diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 37904ac..be63f08 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,27 +58,30 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install Poetry uses: snok/install-poetry@v1.3.4 + with: + virtualenvs-create: true + virtualenvs-in-project: true - - name: Create venv cache - id: cache-venv - uses: actions/cache@v4.0.0 + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 with: - path: ${{env.venv-path}} - key: ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ hashFiles('poetry.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.python-version }}-venv- + path: .venv + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install dependencies - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - poetry install + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root - name: Run Pytest run: | + source .venv/bin/activate poetry run pytest --verbose