From fd61e35710f0984b3b45be1e591e78ad162fbe1b Mon Sep 17 00:00:00 2001 From: Jeremy Grifski Date: Thu, 28 Dec 2023 15:24:13 -0500 Subject: [PATCH] Reworked to the workflows --- .github/workflows/deploy.yml | 36 ++++++++++++++++++++---------------- .github/workflows/test.yml | 29 ++++++++++++++++++----------- 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e9e5967..9d2f106 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,31 +1,35 @@ -name: Deploy +name: Poetry Deployment on: release: types: [published] jobs: - deploy: + all: - runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + python-version: ["3.8"] + poetry-version: ["1.7"] + os: ["ubuntu-latest"] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: '3.x' + python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build + - name: Run Poetry Image + uses: abatilo/actions-poetry@v2 + with: + poetry-version: ${{ matrix.poetry-version }} + + - name: Configure PyPI + run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + run: poetry publish --build --no-interaction diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5c98ed2..f824ec4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,28 +1,35 @@ -name: PyTest +name: Poetry Testing on: pull_request: branches: [main] jobs: - test: + all: - runs-on: ubuntu-latest strategy: + fail-fast: true matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10", "3.11", "3.12"] + poetry-version: ["1.4"] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Run Poetry Image + uses: abatilo/actions-poetry@v2 + with: + poetry-version: ${{ matrix.poetry-version }} + + - name: Install Dependencies + run: poetry install + - name: PyTest - run: python -m pytest \ No newline at end of file + run: poetry run pytest