Skip to content

Add instructions for examples #153

Add instructions for examples

Add instructions for examples #153

Workflow file for this run

name: GPTJSON Tests
on:
push
jobs:
run_tests:
name: Run python tests
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.11"]
pydantic: ["2.1.1"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install poetry
run:
curl -sSL https://install.python-poetry.org | python3 -
- name: Install python dependencies
run: |
export PATH="/Users/runner/.local/bin:$PATH"
poetry install
- name: Install pydantic version
run: |
poetry add pydantic==${{ matrix.pydantic }}
- name: Run tests
run: |
poetry run pytest
publish_python_package:
name: Publish python package
runs-on: ubuntu-latest
needs: [run_tests]
if: ${{ startsWith(github.ref, 'refs/tags/') && always() && !cancelled() && !contains(needs.*.result, 'failure') }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install poetry
run:
curl -sSL https://install.python-poetry.org | python3 -
- name: Build sdist static artifact
run: |
poetry install
poetry build
- name: Publish
run: |
poetry publish --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }}