Skip to content

Commit

Permalink
Merge pull request #22 from IBM/fix/gh-actions
Browse files Browse the repository at this point in the history
Fix/gh actions
  • Loading branch information
francescofuggitti authored Jun 13, 2023
2 parents 0b2515f + f61d9ae commit 699971a
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 6 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
17 changes: 12 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/test_gpt.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nl2ltl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 699971a

Please sign in to comment.