diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5740e0c..c54e6fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,30 +22,40 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.10', '3.11', '3.12', '3.13'] runs-on: ${{ matrix.os }} - + defaults: + run: + shell: bash steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} id: setup-python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: poetry - + - name: Load cached Poetry installation + id: cached-poetry + uses: actions/cache@v4 + with: + path: ${{ runner.os == 'Windows' && 'C:\Users\runneradmin\.local' || runner.os == 'macOS' && '/Users/runner/.local' || '/home/runner/.local' }} + key: poetry-${{ matrix.python-version }}-${{ runner.os }} - name: Install Poetry + if: steps.cached-poetry.outputs.cache-hit != 'true' uses: snok/install-poetry@v1 with: version: 1.8.3 virtualenvs-create: true virtualenvs-in-project: true installer-parallel: true - - - name: Check Poetry + - name: Add Poetry to PATH for bash (Windows) + if: runner.os == 'Windows' + shell: bash + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Configure poetry + if: steps.cached-poetry.outputs.cache-hit == 'true' + run: poetry config virtualenvs.in-project true + - name: Check Poetry version run: poetry --version - - name: Install dependencies run: poetry install --no-interaction --no-ansi - - name: Run tests run: poetry run pytest -q