From 4dbfcf8dc0e1f1224ced2ccc9fa383d0cd6dbe08 Mon Sep 17 00:00:00 2001 From: Yuval Levi <30751157+yuval9313@users.noreply.github.com> Date: Fri, 9 Jun 2023 02:11:52 +0300 Subject: [PATCH] Update all pipelines to gh poetry action and add python 3.11 tests, replace pypi username and password with token --- .github/workflows/lint.yml | 40 ++++++++++++++++++++++++----------- .github/workflows/publish.yml | 12 ++++++----- .github/workflows/test.yml | 10 +++++---- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index afd5d56b..93cd3236 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,45 +2,61 @@ name: Lint pyzeebe on: [push, pull_request] + jobs: type-checking: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - container: python:3.8 + container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v2 + - name: Init python poetry action + uses: abatilo/actions-poetry@v2.1.3 + with: + poetry-version: 1.5.1 - name: Install dependencies - run: | - pip install poetry - poetry install + run: poetry install - name: Lint with mypy run: | poetry run mypy pyzeebe import-checking: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - container: python:3.8 + container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v2 + - name: Init python poetry action + uses: abatilo/actions-poetry@v2.1.3 + with: + poetry-version: 1.5.1 - name: Install dependencies - run: | - pip install poetry - poetry install + run: poetry install - name: Check imports run: | poetry run isort . --check --diff format-checking: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - container: python:3.8 + container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v2 + - name: Init python poetry action + uses: abatilo/actions-poetry@v2.1.3 + with: + poetry-version: 1.5.1 - name: Install dependencies - run: | - pip install poetry - poetry install + run: poetry install - name: Check imports run: | poetry run black --check . diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c9b2c693..0fb01c06 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,14 +14,16 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.10 + - name: Init python poetry action + uses: abatilo/actions-poetry@v2.1.3 + with: + poetry-version: 1.5.1 - name: Install dependencies - run: | - pip install poetry + run: poetry install - name: Build and publish env: - POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} - POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} run: | poetry build poetry publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7729d202..3511b709 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,15 +7,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] container: python:${{ matrix.python-version }} steps: - uses: actions/checkout@v2 + - name: Init python poetry action + uses: abatilo/actions-poetry@v2.1.3 + with: + poetry-version: 1.5.1 - name: Install dependencies - run: | - pip install poetry - poetry install + run: poetry install - name: Test with pytest run: | poetry run coverage run --source=pyzeebe -m py.test tests/unit