Skip to content

Commit

Permalink
Reworked to the workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jrg94 committed Dec 28, 2023
1 parent 09348d4 commit fd61e35
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 27 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 18 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
run: poetry run pytest

0 comments on commit fd61e35

Please sign in to comment.