diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml index 718d8821..7fadefc0 100644 --- a/.github/workflows/code-quality.yaml +++ b/.github/workflows/code-quality.yaml @@ -23,20 +23,14 @@ jobs: if: github.ref != 'refs/heads/main' steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - - - name: Install Poetry and dependencies - run: | - set -e - - curl -sSL https://install.python-poetry.org | python3 - - poetry install --all-extras - + - name: Install Poetry + uses: snok/install-poetry@v1 + - name: Install dataclasses-json + run: poetry install --all-extras - uses: reviewdog/action-setup@v1 - - name: run mypy run: poetry run mypy --no-warn-no-return dataclasses_json diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 462593f2..dfa9b21d 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -22,27 +22,25 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} allow-prereleases: true - - name: Install Poetry and dependencies + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: >- + ${{ + matrix.python-version == '3.7' && '1.5.1' + || (matrix.python-version == '3.8' && '1.8.5' + || (matrix.python-version == '3.9' && '2.2.1' + || 'latest')) + }} + - name: Install dataclasses-json shell: bash - env: - PYTHON_VERSION: ${{ matrix.python-version }} - run: | - set -e - - if [[ "$PYTHON_VERSION" == '3.7' ]] - then - curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1 - else - curl -sSL https://install.python-poetry.org | python3 - - fi - - poetry install --all-extras + run: poetry install --all-extras - name: Lint with flake8 run: | set -e @@ -52,7 +50,6 @@ jobs: set -euxo pipefail poetry run pytest ./tests --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=term-missing:skip-covered | tee pytest-coverage.txt - - name: Publish Code Coverage uses: MishaKav/pytest-coverage-comment@main if: ${{ !github.event.pull_request.head.repo.fork }} @@ -69,28 +66,24 @@ jobs: permissions: id-token: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: - python-version: "3.9.x" - - name: Install Poetry and Prepare version - run: | - set -e - - curl -sSL https://install.python-poetry.org | python3 - - poetry self add "poetry-dynamic-versioning[plugin]" + python-version: "3.10" + - name: Install Poetry + uses: snok/install-poetry@v1 + - name: Prepare version + run: poetry self add "poetry-dynamic-versioning[plugin]" - name: Build package run: | set -e poetry build - - name: Publish distribution 📦 to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ - - name: Publish distribution 📦 to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1