From 34ab3f584b992bc1a9ea3307a333e1f871db5d1c Mon Sep 17 00:00:00 2001 From: Francesco Fuggitti Date: Tue, 13 Jun 2023 15:12:42 -0400 Subject: [PATCH] fix: split tests workflows Signed-off-by: Francesco Fuggitti --- .github/workflows/test.yml | 17 +++++++++---- .github/workflows/test_gpt.yml | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test_gpt.yml 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