add missing tests #688
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will install Python dependencies, run tests and lint with a single version of Python | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
| name: Python Test | |
| on: [push, workflow_dispatch] | |
| # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | |
| # `contents` is for permission to the contents of the repository. | |
| # `pull-requests` is for permission to pull request | |
| permissions: | |
| contents: write | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| testing: | |
| runs-on: ubuntu-latest | |
| env: | |
| SOGO_P_VOUCHER_SECRET: ${{ secrets.SOGO_P_VOUCHER_SECRET }} | |
| SOGO_AES_ENC_KEY: ${{ secrets.SOGO_AES_ENC_KEY }} | |
| SOGO_P_REDIS_URL: ${{ secrets.SOGO_P_REDIS_URL }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Set up poetry | |
| uses: abatilo/actions-poetry@v4.0.0 | |
| with: | |
| poetry-version: latest | |
| - name: Install package dependencies | |
| run: sudo apt install -y libldap2-dev libsasl2-dev | |
| - name: Install python dependencies | |
| run: poetry install | |
| - name: Test with pytest | |
| run: | | |
| poetry run pytest --doctest-modules --junitxml=junit/test-results.xml --cov=app --cov-report=xml --cov-report=html | |
| - name: Pytest coverage comment | |
| uses: MishaKav/pytest-coverage-comment@main | |
| with: | |
| pytest-xml-coverage-path: ./coverage.xml | |
| junitxml-path: ./junit/test-results.xml | |
| - name: Archive unit text | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unit-test | |
| path: ./junit/test-results.xml | |
| - name: Archive code coverage results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: ./htmlcov |