diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d655819a..7696c0bf 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,15 +1,12 @@ name: basic tests on: + pull_request: + branches: + - main push: branches: - - 'user/**' - - 'feature/**' - - 'improvement/**' - - 'bugfix/**' - - 'dependabot/**' - - 'w/**' - - 'q/**' + - main permissions: write-all @@ -20,7 +17,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' cache: pip @@ -35,6 +32,12 @@ jobs: - run: tox -e tests-api-mock - run: tox -e coverage-report - run: tox -e tests-server + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: ${{ github.repository }} + flags: unittests,server,api-mock tests-noqueue: runs-on: ubuntu-20.04 @@ -42,7 +45,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' cache: pip @@ -51,6 +54,12 @@ jobs: - name: Install tox run: pip install tox - run: tox -e tests-noqueue + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: ${{ github.repository }} + flags: tests-noqueue all-tests: runs-on: ubuntu-20.04 @@ -58,7 +67,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' cache: pip @@ -67,6 +76,12 @@ jobs: - name: Install tox run: pip install tox - run: tox -e tests + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: ${{ github.repository }} + flags: all-tests lint: runs-on: ubuntu-20.04 @@ -74,7 +89,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' cache: pip diff --git a/.gitignore b/.gitignore index 70761f6b..4b248b8f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ settings.yml .pytest_cache/ build/ .env +coverage.xml diff --git a/requirements.txt b/requirements.txt index 11b836ff..861c9a3d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,7 @@ py-gfm==0.1.4 pytest==7.4.2 PyYAML==6.0 requests==2.28.2 -requests-mock==1.10.0 +requests-mock==1.12.1 werkzeug==2.2.3 WTForms==3.0.1 jwt==1.3.1 diff --git a/tox.ini b/tox.ini index 41522a8e..5636c105 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,8 @@ commands = flake8 bert_e/ [testenv:utests] deps = pip==22.3.1 -commands = pytest bert_e/tests/unit/ {posargs} + pytest-cov==5.0.0 +commands = pytest bert_e/tests/unit/ --cov=bert_e --cov-report=xml {posargs} [testenv:tests-api-mock] deps =