diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4247b56..ebbdcd2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,24 +9,50 @@ permissions: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] + fail-fast: false + steps: - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: pyproject.toml + + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: latest + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + venv-${{ runner.os }}-${{ matrix.python-version }}- + - name: Install dependencies - run: | - pip install '.[dev]' + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --with dev + + - name: Save cached venv + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + uses: actions/cache@v3 + with: + path: .venv + key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} + - name: Run tests - run: | - pytest + run: poetry run pytest + deploy: runs-on: ubuntu-latest needs: [test] @@ -48,4 +74,4 @@ jobs: run: | python -m build - name: Publish - uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index 06a1ead..07c719f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,4 +44,4 @@ multi_line_output = 3 python_version = "3.8" warn_return_any = true warn_unused_configs = true -disallow_untyped_defs = true \ No newline at end of file +disallow_untyped_defs = true