diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..dbaedd4 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,39 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bafdb32..8f11a02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,13 +23,20 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: pip install tox + run: | + python -m pip install --upgrade pip + pip install pytest pytest-cov pytest-randomly hypothesis-pytest + pip install -r requirements.txt - name: Unit tests and coverage run: | - pyver=`echo ${{ matrix.python-version }} | tr -d "."` - tox -e py${{ matrix.python-version }} - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + pytest -k "not gpt" \ + --doctest-modules \ + nl2ltl tests \ + --cov=nl2ltl \ + --cov-report=xml \ + --cov-report=html \ + --cov-report=term \ + --hypothesis-show-statistics - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: diff --git a/.github/workflows/test_gpt.yml b/.github/workflows/test_gpt.yml new file mode 100644 index 0000000..f7af973 --- /dev/null +++ b/.github/workflows/test_gpt.yml @@ -0,0 +1,44 @@ +name: test GPT + +on: workflow_dispatch + +jobs: + run: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest] + python-version: ["3.8"] + + timeout-minutes: 30 + + steps: + - uses: actions/checkout@main + - uses: actions/setup-python@main + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-cov pytest-randomly hypothesis-pytest + pip install -r requirements.txt + - name: Unit tests and coverage + run: | + pytest test_gpt.py \ + --doctest-modules \ + nl2ltl tests \ + --cov=nl2ltl \ + --cov-report=xml \ + --cov-report=html \ + --cov-report=term \ + --hypothesis-show-statistics + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true diff --git a/README.md b/README.md index 7d10156..c1de86d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Python](https://img.shields.io/pypi/pyversions/nl2ltl)](https://img.shields.io/pypi/pyversions/nl2ltl) [![PyPI](https://img.shields.io/pypi/v/nl2ltl)](https://img.shields.io/pypi/v/nl2ltl) [![Test](https://github.com/IBM/nl2ltl/actions/workflows/test.yml/badge.svg)](https://github.com/IBM/nl2ltl/actions/workflows/test.yml/badge.svg) +[![TestGPT](https://github.com/IBM/nl2ltl/actions/workflows/test_gpt.yml/badge.svg)](https://github.com/IBM/nl2ltl/actions/workflows/test_gpt.yml/badge.svg) [![Lint](https://github.com/IBM/nl2ltl/actions/workflows/linting.yml/badge.svg)](https://github.com/IBM/nl2ltl/actions/workflows/linting.yml/badge.svg) [![Docs](https://github.com/IBM/nl2ltl/actions/workflows/docs.yml/badge.svg)](https://github.com/IBM/nl2ltl/actions/workflows/docs.yml/badge.svg) [![codecov](https://codecov.io/github/IBM/nl2ltl/branch/main/graph/badge.svg?token=XdAtl04qo6)](https://codecov.io/github.com/IBM/nl2ltl) diff --git a/nl2ltl/__init__.py b/nl2ltl/__init__.py index 28eeffe..257c5a7 100644 --- a/nl2ltl/__init__.py +++ b/nl2ltl/__init__.py @@ -2,6 +2,6 @@ """From Natural Language to Linear-time Temporal Logic on Finite Traces.""" -__version__ = "0.0.2" +__version__ = "0.0.3" from .core import translate # noqa: F401